コード例 #1
0
 public void processMessages() throws EMessagingException {
   for (MessageDefinition messageDefinition : messageHub.receive(client)) {
     Map<Object, Object> executionContext = new HashMap<Object, Object>();
     executionContext.put(PARAM_MESSAGE, messageDefinition);
     ListenerProcessor.executeByEngineType(listener.getModule(), executionContext, listener);
   }
 }
コード例 #2
0
 @Override
 public void stop() {
   try {
     messageHub.unsubscribe(client, topic);
     MessageListenerManager.getInstance().unregisterProcessor(this);
   } catch (EMessagingException e) {
     logger.error(e.getMessage(), e);
   }
 }
コード例 #3
0
  @Override
  public void start(Listener listener) {
    this.listener = listener;
    this.client = listener.getParams().get(PARAM_CLIENT);
    this.topic = listener.getParams().get(PARAM_TOPIC);

    try {
      messageHub.subscribe(client, topic);
      MessageListenerManager.getInstance().registerProcessor(this);
    } catch (EMessagingException e) {
      logger.error(e.getMessage(), e);
    }
  }