1 | package exceptionTest; |
---|
2 | |
---|
3 | import java.util.Properties; |
---|
4 | |
---|
5 | import omq.common.broker.Broker; |
---|
6 | import omq.common.util.ParameterQueue; |
---|
7 | import omq.common.util.Serializer; |
---|
8 | |
---|
9 | public class ServerTest { |
---|
10 | |
---|
11 | public static void main(String[] args) throws Exception { |
---|
12 | Properties env = new Properties(); |
---|
13 | env.setProperty(ParameterQueue.USER_NAME, "guest"); |
---|
14 | env.setProperty(ParameterQueue.USER_PASS, "guest"); |
---|
15 | |
---|
16 | // Get host info of rabbimq (where it is) |
---|
17 | env.setProperty(ParameterQueue.SERVER_HOST, "127.0.0.1"); |
---|
18 | env.setProperty(ParameterQueue.SERVER_PORT, "5672"); |
---|
19 | env.setProperty(ParameterQueue.DURABLE_QUEUES, "false"); |
---|
20 | env.setProperty(ParameterQueue.SERIALIZER_NAME, Serializer.kryo); |
---|
21 | env.setProperty(ParameterQueue.ENABLECOMPRESSION, "false"); |
---|
22 | |
---|
23 | // Set info about where the message will be sent |
---|
24 | env.setProperty(ParameterQueue.RPC_EXCHANGE, "rpc_exchange"); |
---|
25 | env.setProperty(ParameterQueue.RETRY_TIME_CONNECTION, "2000"); |
---|
26 | |
---|
27 | OmqServerImpl server = new OmqServerImpl(); |
---|
28 | |
---|
29 | Broker.initBroker(env); |
---|
30 | Broker.bind("server", server); |
---|
31 | } |
---|
32 | } |
---|