source: trunk/src/test/java/faultToleranceTest/ServerTest.java @ 44

Last change on this file since 44 was 44, checked in by stoda, 11 years ago

Objectmq converted to maven project

File size: 1.1 KB
Line 
1package faultToleranceTest;
2
3import java.util.Properties;
4
5import omq.common.broker.Broker;
6import omq.common.util.ParameterQueue;
7import omq.common.util.Serializer;
8import calculatorTest.CalculatorImpl;
9
10public class ServerTest {
11        private static CalculatorImpl calc;
12
13        public static void main(String[] args) throws Exception {
14                Properties env = new Properties();
15                env.setProperty(ParameterQueue.USER_NAME, "guest");
16                env.setProperty(ParameterQueue.USER_PASS, "guest");
17
18                // Get host info of rabbimq (where it is)
19                env.setProperty(ParameterQueue.SERVER_HOST, "127.0.0.1");
20                env.setProperty(ParameterQueue.SERVER_PORT, "5672");
21                env.setProperty(ParameterQueue.DURABLE_QUEUES, "false");
22                env.setProperty(ParameterQueue.SERIALIZER_NAME, Serializer.java);
23                env.setProperty(ParameterQueue.ENABLECOMPRESSION, "false");
24
25                // Set info about where the message will be sent
26                env.setProperty(ParameterQueue.RPC_EXCHANGE, "rpc_exchange");
27                env.setProperty(ParameterQueue.RETRY_TIME_CONNECTION, "2000");
28
29                calc = new CalculatorImpl();
30
31                Broker.initBroker(env);
32                Broker.bind("calculator1", calc);
33
34                System.out.println("Server started");
35        }
36}
Note: See TracBrowser for help on using the repository browser.