Exemplo n.º 1
0
 public void configure() throws ConfigurationException {
   if (getMessageProtocol() == null) {
     throw new ConfigurationException(getLogPrefix() + "messageProtocol must be set");
   }
   if (!getMessageProtocol().equalsIgnoreCase(REQUEST_REPLY)
       && !getMessageProtocol().equalsIgnoreCase(FIRE_AND_FORGET)) {
     throw new ConfigurationException(
         getLogPrefix()
             + "illegal value for messageProtocol ["
             + getMessageProtocol()
             + "], must be '"
             + REQUEST_REPLY
             + "' or '"
             + FIRE_AND_FORGET
             + "'");
   }
   if (getMessageProtocol().equalsIgnoreCase(REQUEST_REPLY)) {
     setForceMessageIdAsCorrelationId(true);
     if (CACHE_CONSUMER.equals(getCacheMode())) {
       ConfigurationWarnings configWarnings = ConfigurationWarnings.getInstance();
       configWarnings.add(
           log, "attribute [cacheMode] already has a default value [" + CACHE_CONSUMER + "]");
     }
     setCacheMode("CACHE_CONSUMER");
   } else {
     setUseReplyTo(false);
   }
   super.configure();
 }
Exemplo n.º 2
0
 public void afterMessageProcessed(PipeLineResult plr, Object rawMessage, Map threadContext)
     throws ListenerException {
   super.afterMessageProcessed(plr, rawMessage, threadContext);
   if (getMessageProtocol().equalsIgnoreCase(REQUEST_REPLY)) {
     Destination replyTo = (Destination) threadContext.get("replyTo");
     if (replyTo == null) {
       log.warn(
           "no replyTo address found for messageProtocol ["
               + getMessageProtocol()
               + "], response is lost");
     }
   }
 }