Dear All,

   I'm facing some challenges with jmstemporarytopic.

   Overview of the system. A web-app (non-camel)  

   publish a JMS with the replyTo set as follows:

   TemoraryTopic replyTopic =
topicSubscriptionSession.createTemporaryTopic();
   .....
   objMsg.setJMSReplyTo(replyTopic );
 

   subscriber = topicSubscrierSession.createSubscriber(replyTopic);
   subscriber.setMessageListener(this);



_____________________________________________________________________________

At the recipient side:
    
    In a class that implements Processor

     A system.out.println of the exchange.getIn().getHeader() returns 
.................................JMSReplyTo=temp://ID:zuff-1931-1344239518234-35:1:1,
...........

   i)  I tried 
   TemporaryTopic topic = (TemporaryTopic)
exchange.getIn().getHeader("JMSReplyTo");
   JmsTemporaryTopicEndPoint jmsTempTopicEndPoint = new
JmsTemporaryTopicEndPoint (topic);
   template.sendBody( jmsTempTopicEndPoint , data );


   This will result in the following:
DefaultErrorHandler    ERROR     Failed Delivery for (MessageId: 
ID:zuff-1931-xx-yy:1:1:1:1 on ExchangeId: ID-zuff-xx-yy-0-2). Exhausted
after delivery attempts: 1 caught: 
org.apache.camel.FailedToCreateProducerException: Failed to create Producer
for endpoint: Endpoint[jms:temp:topic:ID:zuff-xx-yy-z:z].  Reason:
java.lang.NullPointerException 
      at  
org.apache.camel.impl.Proucercache.dogetProducer(ProducerCache.java:389)
[camel-core-2.10.0.jar:2.10.0]
......


   ii)  I also tried

   TemporaryTopic topic = (TemporaryTopic)
exchange.getIn().getHeader("JMSReplyTo");
   String tempUri = "jms:temp:topic:" + topic.getTopicName() );
   template.sendBody( tempUri , data );

    No exception was thrown from this, however, the webapp did not recieve
any messages.


   iii)   I also tried:

      TemporaryTopic topic = (TemporaryTopic)
exchange.getIn().getHeader("JMSReplyTo");      ...
      TopicPublisher publisher =
topicPublisherSession.createPublisher(topic);
      ObjectMessage objMsg = topicPublisherSession.createObjectMessage();
      objMsg .setObject( data ) ;

     publisher.publish( objMsg );

     This works. The webapps recieved the response. 

What am i doing wrong for the other 2 cases?
I read that for temporary topic, the same connection had to be used else the
topic will goes stale, but I do not fully understand what this means.

Thanks and Best Regards,
Zuff
 
  



--
View this message in context: 
http://camel.465427.n5.nabble.com/Issue-with-temporary-topic-tp5716869.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to