camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "prabumca06@gmail.com" <prabumc...@gmail.com>
Subject Camel routing issue after upgrade into active-mq 5.8
Date Wed, 04 Sep 2013 18:50:10 GMT
My code worked fine in activemq 5.5 only issue after upgrading activemq 5.8 

Camel i having code like

from(MESSAGING_TEST_CONSUMER_TYPE_SPECIFIC_QNAME).process(new
MemosProcess(getContext().createProducerTemplate())) 
.end(); 



class MemosProcess implements Processor,QnamesInterface {    
  private static final Logger LOG =
LoggerFactory.getLogger(MemosProcess.class);     
      
      ProducerTemplate prodtemplate=null; 
      public MemosProcess(){     
      
      }
      public MemosProcess(ProducerTemplate template) {      
        this.prodtemplate=template;
      }
            
      @Override
      public void process(Exchange exchange) throws Exception {                          
           
          JmsMessage msg = (JmsMessage) exchange.getIn();
          Map<String, Object> headers = msg.getHeaders();
          
          String eventType            = (String) headers.get(EVENT_TYPE);
          String msgId                = (String) headers.get(MESSAGE_ID);
          System.out.println("Memos-msgid:"+msgId);
          int msg_Expiry_Time         = Integer.parseInt((String)
headers.get(EXPIRY_TIME));                    
          InetAddress address         = InetAddress.getLocalHost();          
          String hostname             = address.getHostName();                           
          
          long MSG_EXPIRY  = System.currentTimeMillis() + msg_Expiry_Time;
          headers.put(JMSExpiration,MSG_EXPIRY);          
          
          String restfulServiceURL =(String)
headers.get(MEMOS_RESTFULSERVICE_URL);
          restfulServiceURL=restfulServiceURL+"update";          
          
          if (eventType.equalsIgnoreCase(CONSUMER_EVENT_TYPE)) {                       
                        
            String serversList    = (String)
headers.get(MEMOS_TARGET_SERVERS);            
            
            String servers []     = serversList.split(":");                
            String handler1       = "";
            String handler2       = "";                                
            
            if (servers.length >=2) {
              handler1       = servers[0];
              handler2       = servers[1];
            }            
            headers.put(MEMOS_TARGET_SERVER,handler1);                
            prodtemplate.sendBodyAndHeaders(CONSUMER_TEST_QNAME,"Consumer
test",headers);            
            headers.put(MEMOS_TARGET_SERVER,handler2);
            new MemosProcess().callService(msgId,
hostname,restfulServiceURL);
            prodtemplate.sendBodyAndHeaders(CONSUMER_TEST_QNAME,"Consumer
test",headers);            
          }else if(eventType.equalsIgnoreCase(PRODUCER_EVENT_TYPE)){
            new MemosProcess().callService(msgId,
hostname,restfulServiceURL);
            prodtemplate.sendBodyAndHeaders(PRODUCER_TEST_QNAME,"Producer
test",headers);                                                            
          }          
       }


above code worked fine in active 5.5 but after upgrade into active 5.8 it is
not working 

Message getting hang in MESSAGING_TEST_CONSUMER_TYPE_SPECIFIC_QNAME not
calling memosprocess class. 

Please kindly help me. 



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-routing-issue-after-upgrade-into-active-mq-5-8-tp5738700.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message