[jboss-user] [JBoss Messaging Users] - Re: message publishing to stopped topic

strzyga do-not-reply at jboss.com
Wed Nov 25 10:35:08 EST 2009


OK, maybe it'll help if I provide more context for what I'm doing. 

In my application remote clients call stateless ejb to send data to specified topic. An ejb calls singleton object which holds a map with entries in the form "topic name"->"TopicPublisher object". If there is no map entry for specified topic, a new connection, session and publisher are created and a new entry is added (in this way we have only one publisher to each topic). If topic specified by remote client does not exist or there is any other kind of error, ejb sends a false value back to the client.

Problem happens when jboss is shutting down. If jboss stops topic before stopping ejb, there are a few milliseconds when ejb sends messages to stopped topic. In this case ejb should send false value back to the client to tell that there was an error and message wasn't persisted. But since there are no exceptions thrown by publisher.publish() method while publishing to stopped topic, it can't do this.

In the above test topic is stopped by invoking manually it's jmx-console stop() method, and this test shows that indeed publisher.publish() returns succesfully when publishing to stopped topic.
If it's normal for publisher, then what can I do with this situation? Should I create new session for each message or recover it?  

Many thanks in advance for any assistance with this issue.

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4267518#4267518

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4267518



More information about the jboss-user mailing list