Changeset 49 for trunk/src/main/java/omq/common/event
- Timestamp:
- 06/19/13 15:59:53 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/main/java/omq/common/event/EventDispatcher.java
r44 r49 9 9 import omq.common.util.ParameterQueue; 10 10 import omq.common.util.Serializer; 11 12 import org.apache.log4j.Logger; 11 13 12 14 import com.rabbitmq.client.Channel; … … 26 28 @SuppressWarnings("rawtypes") 27 29 public class EventDispatcher extends Thread { 30 private static final Logger logger = Logger.getLogger(EventDispatcher.class.getName()); 28 31 private static EventDispatcher dispatcher; 29 32 … … 67 70 68 71 public static void stopEventDispatcher() throws Exception { 72 logger.warn("Stopping EventDispatcher"); 69 73 dispatcher.setListeners(null); 70 74 dispatcher.killed = true; … … 102 106 event = Serializer.deserializeEvent(delivery.getBody()); 103 107 104 System.out.println("Event received -> Topic: " + event.getTopic() + "CorrId: " + event.getCorrId());108 logger.info("Event received -> Topic: " + event.getTopic() + "CorrId: " + event.getCorrId()); 105 109 // Log.saveLog("Client-Deserialize", delivery.getBody()); 106 110 … … 112 116 dispatch(event.getTopic(), event); 113 117 } catch (InterruptedException i) { 114 System.out.println("InterruptedException e: " + i); 115 i.printStackTrace(); 118 logger.error(i); 116 119 } catch (ShutdownSignalException e) { 117 System.out.println("ShutdownSignalException e: " + e); 118 e.printStackTrace(); 120 logger.error(e); 119 121 try { 120 122 if (channel.isOpen()) { … … 127 129 Thread.sleep(milis); 128 130 } catch (InterruptedException e2) { 129 e2.printStackTrace();131 logger.error(e2); 130 132 } 131 e1.printStackTrace();133 logger.error(e1); 132 134 } 133 135 } catch (ConsumerCancelledException e) { 134 System.out.println("ConsumerCancelledException e: " + e); 135 e.printStackTrace(); 136 logger.error(e); 136 137 } catch (Exception e) { 137 System.out.println("Exception e: " + e); 138 e.printStackTrace(); 138 logger.error(e); 139 139 } 140 140 } … … 160 160 String reference = e.getTopic(); 161 161 162 System.out.println("EventDispatcher declaring fanout -> " + reference + " Binding with: " + queueName);162 logger.info("Declaring fanout -> " + reference + " Binding with: " + queueName); 163 163 164 164 channel.exchangeDeclare(reference, "fanout");
Note: See TracChangeset
for help on using the changeset viewer.