-
1. Re: How to set message listener in WAR
clebert.suconic Jul 14, 2011 11:47 AM (in response to prasad.deshpande)U can't setup a Listener on a RA connection Factory. Use a regular connection factory (not the RA one)
-
2. Re: How to set message listener in WAR
prasad.deshpande Jul 15, 2011 6:33 AM (in response to clebert.suconic)Thanks a lot, that worked, but just out of curiosity, why can't I setup listener on RA connectionfactory? What is the difference? Could you please point me to any tutorial/ref/documentation for more knowledge?
-
3. Re: How to set message listener in WAR
timfox Jul 15, 2011 7:07 AM (in response to prasad.deshpande)http://community.jboss.org/wiki/ShouldICacheJMSConnectionsAndJMSSessions
Actually, creating a message listener in a WAR, even if you use the regular JCA factory is an anti-pattern.
This is because you will end up creating and closing a listener *for every request* which will give horrible performance.
The correct way of consuming messages using JEE is to use an MDB.
-
4. Re: How to set message listener in WAR
prasad.deshpande Jul 15, 2011 7:27 AM (in response to timfox)That was a good explaination Tim, but I really need a message being sent to WAR from EJB, I've made sure that listner is setup & connection is obtained just once & connection remains open until web-app is running.
I'd love explore any other possibility, all I need is EJB to send message to WAR. I found using JMS was nice idea. If you have any suggestion, please share with us all.