This content has been marked as final.
Show 1 reply
-
1. Re: Best practice to avoid MDB
clebert.suconic Jul 20, 2010 10:27 AM (in response to rezaghp)1 of 1 people found this helpfulA good idea would be you writing a MC Bean
public class MyBean
{
public void start()
{
// instantiate factories (JNDI or direct instantiation),
// instantiate a session... etc
// setup a consumer (Message listener)
}
public void stop()
{
// close the connections, sessions.. etc
}
}
Add it to the server's classpath
And change hornetq-beans.xml to add your bean:
<bean name="MyClient" class="my.package.MyClass/>
You would be on the same VM as the Standalone server. You could even use InVM.
You will probably need a dependency to the HornetQServer, so your bean doesn start before the HornetQServer.