Since jboss AS7 shipped with Hornetq as JMS implementation (thought AS6 was too, but I didn't try AS6) and hornetq seems to be strict on specs, I have following problem.
I have an application an EAR that has EJB jar & several WAR modules. There are also some standalone clients for this application. So whenever a standalone application updates something, I wanted to proces few things in WAR's so what I was doing I was publishing a message from EJB & WAR's that are interested in message were listening to a topic, now since Hornetq is stricter on spec, the same setup gives me following error:
16:29:33,250 ERROR (http-0.0.0.0-0.0.0.0-8080-1) javax.jms.IllegalStateException: This method is not applicable inside the application server. See the J2EE spec, e.g. J2EE1.4 Section 6.6
16:29:33,250 ERROR (http-0.0.0.0-0.0.0.0-8080-1) at org.hornetq.ra.HornetQRASessionFactoryImpl.setExceptionListener(HornetQRASessionFactoryImpl.java:532)
This used to work with earlier implimentations of JBoss like AS 5.1.
My question to you guys is, how above scenario needs to be taken care? How Ejb module can now notify WAR module about something happening? Any suggestions?
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.
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.