Posted By:
Ann_Flavin
Posted On:
Monday, March 25, 2002 07:42 AM
Hi, I have a problem with a JMS app that I am writing. A JMSclient runs and sends a mapmessage to a Queue, a MDB listens on the queue and consumes the mapmessage. The MDB then performs some checking on the message and sends it onto a topic. Another JMSclient app subscribes to the topic and has a messageListener to consume messages. Everything seems to work fine up until the subscriber class. It starts and then stops without consuming any messages. try { tc = tcf.createTopicConnection(); ts = tc.createTopicSession(false, Session.AUTO_ACKNOWLEDGE); tSub = ts.createDurableSubscriber(t,"MakeItLast"); //now set up listener topicListener = new
More>>
Hi,
I have a problem with a JMS app that I am writing. A JMSclient runs and sends a mapmessage to a Queue, a MDB listens on the queue and consumes the mapmessage. The MDB then performs some checking on the message and sends it onto a topic. Another JMSclient app subscribes to the topic and has a messageListener to consume messages.
Everything seems to work fine up until the subscriber class. It starts and then stops without consuming any messages.
try {
tc = tcf.createTopicConnection();
ts = tc.createTopicSession(false,
Session.AUTO_ACKNOWLEDGE);
tSub = ts.createDurableSubscriber(t,"MakeItLast");
//now set up listener
topicListener = new myListener();
tSub.setMessageListener(topicListener);
tc.start();
System.out.println("started connection to receive messages from topic");
}
catch (JMSException e) {
System.out.println("Exception occurred: " +
e.toString());
}
finally {
System.out.println("Closing connection");
if (tc != null) {
try {
ts.unsubscribe("MakeItLast");
tc.close();
}
catch (JMSException e) {}
}
}
The system output is :started connection to receive messages from topic
closing connection
with no call to the onMessage() in the myListener
Can anyone help me please?
Thanks,
Ann
<<Less