"[EMAIL PROTECTED]" wrote : P.S. I consider this an anti-pattern. | | It is better practice for the session bean to initiate the request, | but to actually receive the reply in the client. | | That way you are not blocking threads in the server waiting for asynchronous | responses.
Hmmm...thanks. I'll need to think about the ramifications of this for my use case. The fact that JMS messages are being sent as a result of the EJB call is an implementation detail that I am deliberately hiding from the session bean client. For the session bean to do it's work I need to know that a) the messages were received and b) whether the receiver was able to do what it is supposed to. I've considered making the messages truly asynchronous (fire and forget from the SLSB, no reply topic at all), but I would need to do a lot of bookeeping to gather the ack/nack information and react to it. Anyway, you probably don't care about any of that. I appreciate the advice, though. anonymous wrote : | It also doesn't work in a transaction. | The send/publish really happens at the transaction commit | so the receive would always fail. Right. That's why I have the session bean method that sends these messages marked NotSupported and am using ConnectionFactory for this particualr bean, as opposed to java:/JmsXA (which we use in other beans that don't require an ack/nack over temporary destinations). As I said before, maybe I shouldn't even use JMS for this at all; perhaps an RMI or JMX call would be more suitable, as the ack/nack really makes the operation synchronous. But I guess these would both still block the server threads, as you point out, and could never be in a transaction either... View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3867011#3867011 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3867011 ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ JBoss-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jboss-user
