I have made
Servlet with Message listener (I do not require MDB for that so no question why i am using servlet).
The code is following:
* in output i get Results
1) When i run servlet firstly then it showed proper output. Then if i will remove following code:
try {
Thread.sleep(Long.MAX_VALUE);
} catch (InterruptedException ex) {
Logger.getLogger(MessageConsumer.class.getName()).log(Level.SEVERE, null, ex);
}
then also it will show output correctly
2) When i change destinationname:
@Resource(mappedName = "jms/tConnectionFactoryTopic")
private ConnectionFactory connectionFactory;
@Resource(mappedName = "jms/MyTopic")
private Topic topic;
t is giving Messages for previous entries.
3) When i redeploy it and add Thread.Sleep then it will show messages for MyTopic
4) When i redeploy the Message Driven Servlet then too it does not show messages which were send during deploying
.
.
.
Kindly tell me how to manage all this properly without any Error.