Index: trunk/objectmq/src/omq/client/proxy/Proxymq.java
===================================================================
--- trunk/objectmq/src/omq/client/proxy/Proxymq.java	(revision 17)
+++ trunk/objectmq/src/omq/client/proxy/Proxymq.java	(revision 18)
@@ -20,4 +20,5 @@
 import omq.common.message.Request;
 import omq.common.message.Response;
+import omq.common.util.Log;
 import omq.common.util.ParameterQueue;
 import omq.common.util.Serializer;
@@ -126,11 +127,10 @@
 		}
 	}
-
-	private void publishAsyncRequest(Request request) throws IOException, SerializerException {
+	
+	private void publishMessage(Request request, String replyQueueName) throws IOException, SerializerException{
 		String corrId = request.getId();
 
 		// Get the environment properties
 		String exchange = env.getProperty(ParameterQueue.RPC_EXCHANGE);
-		String replyQueueName = env.getProperty(ParameterQueue.RPC_REPLY_QUEUE);
 		String routingkey = this.uid;
 
@@ -139,5 +139,13 @@
 
 		// Publish the message
-		channel.basicPublish(exchange, routingkey, props, Serializer.serialize(request));
+		byte[] bytesRequest = Serializer.serialize(request);				
+		channel.basicPublish(exchange, routingkey, props, bytesRequest);
+		Log.saveLog("Client-Serialize", bytesRequest);		
+	}
+
+	private void publishAsyncRequest(Request request) throws IOException, SerializerException {
+		// Get the environment properties
+		String replyQueueName = env.getProperty(ParameterQueue.RPC_REPLY_QUEUE);
+		publishMessage(request, replyQueueName);
 	}
 
@@ -149,10 +157,5 @@
 
 		// Get the environment properties
-		String exchange = env.getProperty(ParameterQueue.RPC_EXCHANGE);
 		String replyQueueName = env.getProperty(ParameterQueue.RPC_REPLY_QUEUE);
-		String routingkey = this.uid;
-
-		// Add the correlation ID and create a replyTo property
-		BasicProperties props = new BasicProperties.Builder().appId(uid).correlationId(corrId).replyTo(replyQueueName).build();
 
 		// Publish the message
@@ -160,5 +163,5 @@
 		while (i < retries) {
 			try {
-				channel.basicPublish(exchange, routingkey, props, Serializer.serialize(request));
+				publishMessage(request, replyQueueName);
 				return getResult(corrId, timeout, type);
 			} catch (TimeoutException te) {
@@ -208,4 +211,5 @@
 			}
 			resp = Serializer.deserializeResponse(results.get(corrId), type);
+			Log.saveLog("Client-Deserialize", results.get(corrId));
 			// Remove and indicate the key exists (a hashmap can contain a null
 			// object, using this we'll know whether a response has been
Index: trunk/objectmq/src/omq/common/broker/Broker.java
===================================================================
--- trunk/objectmq/src/omq/common/broker/Broker.java	(revision 17)
+++ trunk/objectmq/src/omq/common/broker/Broker.java	(revision 18)
@@ -7,9 +7,13 @@
 import omq.client.proxy.Proxymq;
 import omq.client.remote.response.ResponseListener;
+import omq.common.event.Event;
 import omq.common.event.EventDispatcher;
+import omq.common.event.EventWrapper;
 import omq.common.util.Environment;
 import omq.common.util.OmqConnectionFactory;
+import omq.common.util.Serializer;
 import omq.exception.EnvironmentException;
 import omq.exception.RemoteException;
+import omq.exception.SerializerException;
 import omq.server.remote.request.RemoteObject;
 
@@ -91,4 +95,12 @@
 		}
 	}
+	
+	
+	public static void trigger(Event event) throws IOException, SerializerException{
+		String UID = event.getTopic();
+		EventWrapper wrapper = new EventWrapper(event);
+		channel.exchangeDeclare(UID, "fanout");
+		channel.basicPublish(UID, "", null, Serializer.serialize(wrapper));
+	}
 
 }
Index: trunk/objectmq/src/omq/common/util/Log.java
===================================================================
--- trunk/objectmq/src/omq/common/util/Log.java	(revision 18)
+++ trunk/objectmq/src/omq/common/util/Log.java	(revision 18)
@@ -0,0 +1,46 @@
+package omq.common.util;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.Date;
+import java.util.Properties;
+
+import omq.exception.EnvironmentException;
+
+import org.apache.commons.io.IOUtils;
+
+public class Log {
+
+	public static void saveLog(String processName, byte[] bytesResponse) throws IOException {
+		try {
+			Properties env = Environment.getEnvironment();
+
+			String debugPath = env.getProperty(ParameterQueue.DEBUGFILE, "");
+			if (debugPath.length() > 0) {
+				long timeNow = (new Date()).getTime();
+
+				File outputFolder = new File(debugPath + File.separator + processName);
+				outputFolder.mkdirs();
+
+				File outputFileContent = new File(outputFolder.getAbsoluteFile() + File.separator + "content_" + timeNow);
+				FileOutputStream outputStream = new FileOutputStream(outputFileContent);
+				IOUtils.write(bytesResponse, outputStream);
+				outputStream.close();
+				
+				File outputFileLog = new File(debugPath + File.separator + "log");
+				boolean exist = outputFileLog.exists();
+				
+				FileWriter fw = new FileWriter(outputFileLog, true); // the true will append the new data
+				if(!exist){
+					fw.write("#ProcessName\t\tFile\t\t\t\t\tDate\t\t\tSize\n");
+				}
+				fw.write(processName + "\t" + "content_" + timeNow + "\t" + timeNow + "\t" + bytesResponse.length + "\tbytes\n");
+				fw.close();
+			}
+		} catch (EnvironmentException e) {
+			throw new IOException(e.getMessage(), e);
+		}
+	}
+}
Index: trunk/objectmq/src/omq/common/util/ParameterQueue.java
===================================================================
--- trunk/objectmq/src/omq/common/util/ParameterQueue.java	(revision 17)
+++ trunk/objectmq/src/omq/common/util/ParameterQueue.java	(revision 18)
@@ -30,4 +30,6 @@
 
 	public static String ENABLE_SSL = "revo.enable_ssl";
+	public static String DEBUGFILE = "revo.debug_file";
+	
 
 	/*
Index: trunk/objectmq/src/omq/common/util/Serializer.java
===================================================================
--- trunk/objectmq/src/omq/common/util/Serializer.java	(revision 17)
+++ trunk/objectmq/src/omq/common/util/Serializer.java	(revision 18)
@@ -37,4 +37,8 @@
 				String className = env.getProperty(ParameterQueue.SERIALIZERNAME, "omq.common.util.Serializers.JavaImp");
 
+				if (className == null || className.isEmpty()) {
+					throw new ClassNotFoundException("Class name is null or empty.");
+				}
+				
 				serializer = (ISerializer) Class.forName(className).newInstance();
 			} catch (Exception ex) {
Index: trunk/objectmq/src/omq/server/remote/request/InvocationThread.java
===================================================================
--- trunk/objectmq/src/omq/server/remote/request/InvocationThread.java	(revision 17)
+++ trunk/objectmq/src/omq/server/remote/request/InvocationThread.java	(revision 18)
@@ -5,4 +5,5 @@
 import omq.common.message.Request;
 import omq.common.message.Response;
+import omq.common.util.Log;
 import omq.common.util.Serializer;
 
@@ -35,4 +36,5 @@
 				// Deserialize the json
 				Request request = Serializer.deserializeRequest(delivery.getBody(), obj);
+				Log.saveLog("Server-Deserialize", delivery.getBody());
 
 				// Invoke the method
@@ -46,7 +48,11 @@
 					BasicProperties props = delivery.getProperties();
 
-					BasicProperties replyProps = new BasicProperties.Builder().appId(obj.getRef()).correlationId(props.getCorrelationId()).build();
+					BasicProperties replyProps = new BasicProperties.Builder().appId(obj.getRef())
+							.correlationId(props.getCorrelationId()).build();
 
-					channel.basicPublish("", props.getReplyTo(), replyProps, Serializer.serialize(resp));
+					byte[] bytesResponse = Serializer.serialize(resp);
+					channel.basicPublish("", props.getReplyTo(), replyProps, bytesResponse);
+
+					Log.saveLog("Server-Serialize", bytesResponse);
 				}
 
Index: trunk/objectmq/src/omq/ztest/calculator/CalculatorImpl.java
===================================================================
--- trunk/objectmq/src/omq/ztest/calculator/CalculatorImpl.java	(revision 17)
+++ trunk/objectmq/src/omq/ztest/calculator/CalculatorImpl.java	(revision 18)
@@ -4,4 +4,5 @@
 
 import omq.client.annotation.AsyncMethod;
+import omq.common.broker.Broker;
 import omq.exception.SerializerException;
 import omq.server.remote.request.RemoteObject;
@@ -33,6 +34,7 @@
 
 	public void divideByZero() throws IOException, SerializerException {
-		ZeroEvent ze = new ZeroEvent("my zero event");
-		notifyEvent(ze);
+		ZeroEvent ze = new ZeroEvent("my zero event", "zero-event");
+		Broker.trigger(ze);
+		//notifyEvent(ze);
 	}
 
Index: trunk/objectmq/src/omq/ztest/calculator/CalculatorTest.java
===================================================================
--- trunk/objectmq/src/omq/ztest/calculator/CalculatorTest.java	(revision 17)
+++ trunk/objectmq/src/omq/ztest/calculator/CalculatorTest.java	(revision 18)
@@ -22,5 +22,5 @@
 
 		// Set host info of rabbimq (where it is)
-		env.setProperty(ParameterQueue.SERVER_HOST, "127.0.0.1");
+		env.setProperty(ParameterQueue.SERVER_HOST, "10.30.239.228");
 		env.setProperty(ParameterQueue.SERVER_PORT, "5672");
 		// env.setProperty(ParameterQueue.SERIALIZERNAME,
@@ -31,4 +31,5 @@
 		// Set info about where the message will be sent
 		env.setProperty(ParameterQueue.RPC_EXCHANGE, "rpc_exchange");
+		env.setProperty(ParameterQueue.DEBUGFILE, "c:\\middlewareDebug");
 
 		// Set info about the queue & the exchange where the ResponseListener
@@ -75,5 +76,5 @@
 	@Test
 	public void notifyEvent() throws Exception {
-		ZeroListener zL = new ZeroListener();
+		ZeroListener zL = new ZeroListener("zero-event");
 
 		remoteCalc.addListener(zL);
Index: trunk/objectmq/src/omq/ztest/calculator/ServerTest.java
===================================================================
--- trunk/objectmq/src/omq/ztest/calculator/ServerTest.java	(revision 17)
+++ trunk/objectmq/src/omq/ztest/calculator/ServerTest.java	(revision 18)
@@ -16,5 +16,5 @@
 
 		// Get host info of rabbimq (where it is)
-		env.setProperty(ParameterQueue.SERVER_HOST, "127.0.0.1");
+		env.setProperty(ParameterQueue.SERVER_HOST, "10.30.239.228");
 		env.setProperty(ParameterQueue.SERVER_PORT, "5672");
 		// env.setProperty(ParameterQueue.SERIALIZERNAME,
Index: trunk/objectmq/src/omq/ztest/calculator/ZeroEvent.java
===================================================================
--- trunk/objectmq/src/omq/ztest/calculator/ZeroEvent.java	(revision 17)
+++ trunk/objectmq/src/omq/ztest/calculator/ZeroEvent.java	(revision 18)
@@ -12,6 +12,6 @@
 	}
 
-	public ZeroEvent(String corrId) {
-		super(corrId);
+	public ZeroEvent(String corrId, String topic) {
+		super(corrId, topic);
 	}
 
Index: trunk/objectmq/src/omq/ztest/calculator/ZeroListener.java
===================================================================
--- trunk/objectmq/src/omq/ztest/calculator/ZeroListener.java	(revision 17)
+++ trunk/objectmq/src/omq/ztest/calculator/ZeroListener.java	(revision 18)
@@ -5,4 +5,8 @@
 public class ZeroListener extends EventListener<ZeroEvent> {
 
+	public ZeroListener(String topic){
+		super(topic);
+	}
+	
 	@Override
 	public void notifyEvent(ZeroEvent event) {
