You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by chandler <pe...@sandia.gov> on 2017/05/08 23:07:59 UTC

Re: ERROR [org.apache.camel.component.jms.DefaultJmsMessageListenerContainer]

Yes, I have a set of routes. One of my camel processors does a JMS
request/reply using the org.apache.camel.ProducerTemplate.requestBody(...)
see below. I believe 
1. The Camel request/reply (InOut) 20 sec default timeout occurs. And the
route is terminated. 
2. However, the requestBody is still pending (has not returned, still
listening on the Temporary Reply Queue).
3. DefaultJmsMessageListenerContainer tries to refresh the JMS Connection on
the now defunct Temporary Reply Queue.

Is there a way to set the reply timeout on the
DefaultJmsMessageListenerContainer. Is there a way to set the timeout on
org.apache.camel.ProducerTemplate.requestBody(...) to less than the camel
request/reply (InOut) 20 sec default timeout?  

      public String send(Exchange exchange, String payload) {
		exchange.getIn().setBody(payload, String.class);
		HttpServletRequest req =
exchange.getIn().getBody(HttpServletRequest.class);
		logger.info("Requesting IP address "+ getClientIpAddr(req));
		String jmsURL = "activemq:queue:" + getRequestQueueName() +
"?jmsMessageType=" + getJmsMessageType() + "&replyToType=" +
getReplyToType() + "&concurrentConsumers=" + getConcurrentConsumers();
		logger.info("Remove +++ jms URL " + jmsURL);
		ProducerTemplate pt = exchange.getContext().createProducerTemplate();
		String results = (String) pt.requestBody(jmsURL, payload);
		try {
			pt.stop();
		} catch (Exception e) {
			System.out.println(" Can't stop the ProducerTemplate ");
		}

		return results;
	}



--
View this message in context: http://camel.465427.n5.nabble.com/ERROR-org-apache-camel-component-jms-DefaultJmsMessageListenerContainer-tp5792757p5799122.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: ERROR [org.apache.camel.component.jms.DefaultJmsMessageListenerContainer]

Posted by chandler <pe...@sandia.gov>.
Final thought, when the JMS component "requestTimeout" is triggered.
Shouldn't associated (running) Producer Template(s) be stopped? Bug? 



--
View this message in context: http://camel.465427.n5.nabble.com/ERROR-org-apache-camel-component-jms-DefaultJmsMessageListenerContainer-tp5792757p5799343.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: ERROR [org.apache.camel.component.jms.DefaultJmsMessageListenerContainer]

Posted by chandler <pe...@sandia.gov>.
I solved my problem (hang Queue listeners) by using the asyncRequestBody
(see:
http://camel.465427.n5.nabble.com/ProducerTemplate-timeout-td473382.html) 

JEE Container Servlet (HttpSessionTimeout)
   {
   Camel Routes 
      {
	      JMS Request/Reply org.apache.camel.component.jms.JmsConfiguration
(requestTimeout)
		     {
			    ProducerTemplate pt = exchange.getContext().createProducerTemplate();
			    Future future = pt.asyncRequestBody(jmsURL, payload);
			    // wait ...
			    results = pt.extractFutureBody(future, procedureTimeOut,
java.util.concurrent.TimeUnit.MILLISECONDS, String.class);
		     }
      }
   }

Important: HttpSessionTimeout > JMS requestTimeout > procedureTimeOut 




--
View this message in context: http://camel.465427.n5.nabble.com/ERROR-org-apache-camel-component-jms-DefaultJmsMessageListenerContainer-tp5792757p5799257.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: ERROR [org.apache.camel.component.jms.DefaultJmsMessageListenerContainer]

Posted by chandler <pe...@sandia.gov>.
Some more details:

2017-05-09 13:16:11,029 logLevel="ERROR", thread="Camel (p6pmtjsonresponse)
thread #2 -
TemporaryQueueReplyManager[local.q.cee.pm.p6milestone.json.inout.request]",
class="org.apache.camel.component.jms.DefaultJmsMessageListenerContainer",
lineNumber="938", elapsedFromTheConstruction="95661418", message="Could not
refresh JMS Connection for destination 'temporary' - retrying using
FixedBackOff{interval=5000, currentAttempts=210, maxAttempts=unlimited}.
Cause: null" 
java.lang.NullPointerException
	at
org.springframework.jms.listener.AbstractJmsListeningContainer.refreshSharedConnection(AbstractJmsListeningContainer.java:400)
	at
org.springframework.jms.listener.DefaultMessageListenerContainer.refreshConnectionUntilSuccessful(DefaultMessageListenerContainer.java:919)
	at
org.springframework.jms.listener.DefaultMessageListenerContainer.recoverAfterListenerSetupFailure(DefaultMessageListenerContainer.java:893)
	at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1069)
	at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)



--
View this message in context: http://camel.465427.n5.nabble.com/ERROR-org-apache-camel-component-jms-DefaultJmsMessageListenerContainer-tp5792757p5799179.html
Sent from the Camel - Users mailing list archive at Nabble.com.