package multiThreadTest;

import java.util.Properties;

import omq.common.broker.Broker;
import omq.common.util.ParameterQueue;

public class ServerTest {

	public static void main(String[] args) throws Exception {
		Properties env = new Properties();
		env.setProperty(ParameterQueue.USER_NAME, "guest");
		env.setProperty(ParameterQueue.USER_PASS, "guest");

		// Get host info of rabbimq (where it is)
		env.setProperty(ParameterQueue.SERVER_HOST, "127.0.0.1");
		env.setProperty(ParameterQueue.SERVER_PORT, "5672");
		// env.setProperty(ParameterQueue.SERIALIZERNAME,
		// "omq.common.util.Serializers.GsonImp");
		env.setProperty(ParameterQueue.ENABLECOMPRESSION, "false");
		env.setProperty(ParameterQueue.NUM_THREADS, "4");

		// Set info about where the message will be sent
		env.setProperty(ParameterQueue.RPC_EXCHANGE, "rpc_exchange");
		env.setProperty(ParameterQueue.RETRY_TIME_CONNECTION, "2000");

		String car = "audi";
		String tfn = "aifon";

		Broker.initBroker(env);
		Broker.bind(car, new CarImpl());
		Broker.bind(tfn, new MobileImpl());

		System.out.println("Server started");
	}
}