Changeset 75
- Timestamp:
- 07/02/13 11:50:11 (11 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/pom.xml
r64 r75 49 49 <groupId>com.esotericsoftware.kryo</groupId> 50 50 <artifactId>kryo</artifactId> 51 <version>2.2 1</version>51 <version>2.20</version> 52 52 </dependency> 53 53 <dependency> -
trunk/src/main/java/omq/client/proxy/MultiProxymq.java
r70 r75 4 4 import java.lang.reflect.Method; 5 5 import java.util.Properties; 6 7 import org.apache.log4j.Logger; 6 8 7 9 import com.rabbitmq.client.AMQP.BasicProperties; … … 20 22 */ 21 23 public class MultiProxymq implements InvocationHandler { 24 private static final Logger logger = Logger.getLogger(MultiProxymq.class.getName()); 22 25 private static final String multi = "multi#"; 23 26 … … 37 40 Properties env = broker.getEnvironment(); 38 41 replyQueueName = env.getProperty(ParameterQueue.RPC_REPLY_QUEUE); 39 exchange = multi + env.getProperty(ParameterQueue.RPC_EXCHANGE);42 exchange = multi + uid; 40 43 serializerType = env.getProperty(ParameterQueue.SERIALIZER_NAME, Serializer.JAVA); 41 44 } … … 55 58 broker.getChannel().basicPublish(exchange, routingkey, props, bytesRequest); 56 59 60 logger.debug("Proxymq: " + uid + " invokes " + methodName + ", corrID" + corrId + ", exchange: " + exchange + ", replyQueue: " + replyQueueName 61 + ", serializerType: " + serializerType + ", multi call: " + request.isMulti() + ", async call: " + request.isAsync()); 62 57 63 return null; 58 64 } -
trunk/src/main/java/omq/client/proxy/Proxymq.java
r72 r75 90 90 env = broker.getEnvironment(); 91 91 exchange = env.getProperty(ParameterQueue.RPC_EXCHANGE); 92 multiExchange = multi + exchange;92 multiExchange = multi + uid; 93 93 replyQueueName = env.getProperty(ParameterQueue.RPC_REPLY_QUEUE); 94 94 -
trunk/src/main/java/omq/common/message/Request.java
r58 r75 23 23 } 24 24 25 public Request(String id, String method, Object[] params) { 26 this.id = id; 27 this.method = method; 28 this.params = params; 29 } 30 31 private Request(String id, String method, boolean async, Object[] params) { 25 public Request(String id, String method, boolean async, Object[] params) { 32 26 this.id = id; 33 27 this.method = method; … … 36 30 } 37 31 38 p rivateRequest(String id, String method, boolean async, Object[] params, boolean multi) {32 public Request(String id, String method, boolean async, Object[] params, boolean multi) { 39 33 this.id = id; 40 34 this.method = method; -
trunk/src/main/java/omq/common/util/Serializers/GsonImp.java
r72 r75 33 33 String id = jsonObj.get("id").getAsString(); 34 34 String method = jsonObj.get("method").getAsString(); 35 boolean async = jsonObj.get("async").getAsBoolean(); 35 36 36 37 List<Class<?>> types = obj.getParams(method); … … 48 49 i++; 49 50 } 50 51 return new Request(id, method, arguments); 51 return new Request(id, method, async, arguments); 52 52 } catch (NullPointerException e) { 53 return new Request(id, method, null);53 return new Request(id, method, async, null); 54 54 } 55 55 } -
trunk/src/main/java/omq/server/RemoteObject.java
r74 r75 97 97 Delivery delivery = consumer.nextDelivery(); 98 98 99 logger.debug(UID + " has received a message ");99 logger.debug(UID + " has received a message, serializer: " + delivery.getProperties().getType()); 100 100 101 101 remoteWrapper.notifyDelivery(delivery); … … 219 219 String routingKey = UID; 220 220 // Multi info 221 String multiExchange = multi + exchange;221 String multiExchange = multi + UID; 222 222 223 223 boolean durable = Boolean.parseBoolean(env.getProperty(ParameterQueue.DURABLE_QUEUES, "false")); -
trunk/src/main/resources/log4j.xml
r64 r75 4 4 <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> 5 5 <appender name="consoleAppender" class="org.apache.log4j.ConsoleAppender"> 6 <param name="Threshold" value=" INFO" />6 <param name="Threshold" value="DEBUG" /> 7 7 <layout class="org.apache.log4j.PatternLayout"> 8 8 <param name="ConversionPattern" value="%d{[yyyy-MM-dd HH:mm:ss]} %-5p %c:%L - %m%n" /> … … 30 30 31 31 <root> 32 <priority value =" info" />32 <priority value ="DEBUG" /> 33 33 <appender-ref ref="consoleAppender" /> 34 34 <appender-ref ref="A2" /> -
trunk/src/test/java/omq/test/workspace/WorkspaceTest.java
r74 r75 20 20 @RunWith(value = Parameterized.class) 21 21 public class WorkspaceTest { 22 private String type; 22 23 private static Broker serverBroker; 23 24 private static Broker clientBroker1; 24 25 private static Broker clientBroker2; 26 private static RemoteWorkspaceImpl w1C1; 27 private static RemoteWorkspaceImpl w3C1; 28 private static RemoteWorkspaceImpl w1C2; 29 private static RemoteWorkspaceImpl w2C2; 25 30 private static String[] workspaces = { "w1", "w2", "w3" }; 26 31 private static RemoteWorkspace[] remoteWorks = new RemoteWorkspace[3]; … … 28 33 // In this case the Constructor acts as a server 29 34 public WorkspaceTest(String type) throws Exception { 35 this.type = type; 30 36 Properties env = new Properties(); 31 37 env.setProperty(ParameterQueue.USER_NAME, "guest"); … … 75 81 clientBroker2 = new Broker(env); 76 82 83 // Client 1 will subscribe to changes in the workspaces w1 and w3 84 w1C1 = new RemoteWorkspaceImpl(); 85 w3C1 = new RemoteWorkspaceImpl(); 86 87 clientBroker1.bind(workspaces[0], w1C1); 88 clientBroker1.bind(workspaces[2], w3C1); 89 90 // Client 2 will subscribe to changes in the workspaces w1 and w2 91 w1C2 = new RemoteWorkspaceImpl(); 92 w2C2 = new RemoteWorkspaceImpl(); 93 94 clientBroker2.bind(workspaces[0], w1C2); 95 clientBroker2.bind(workspaces[1], w2C2); 96 77 97 System.out.println("Client 1 & client2 started"); 78 98 } … … 85 105 @Test 86 106 public void test() throws Exception { 107 System.out.println("Starting test: " + type); 87 108 String expected = null; 88 109 String actual = null; 89 90 // Client 1 will subscribe to changes in the workspaces w1 and w391 RemoteWorkspaceImpl w1C1 = new RemoteWorkspaceImpl();92 RemoteWorkspaceImpl w3C1 = new RemoteWorkspaceImpl();93 94 clientBroker1.bind(workspaces[0], w1C1);95 clientBroker1.bind(workspaces[2], w3C1);96 97 // Client 2 will subscribe to changes in the workspaces w1 and w298 RemoteWorkspaceImpl w1C2 = new RemoteWorkspaceImpl();99 RemoteWorkspaceImpl w2C2 = new RemoteWorkspaceImpl();100 101 clientBroker2.bind(workspaces[0], w1C2);102 clientBroker2.bind(workspaces[2], w2C2);103 110 104 111 // The server will notify a change in the w2
Note: See TracChangeset
for help on using the changeset viewer.