You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by James Strachan <ja...@yahoo.co.uk> on 2003/03/06 08:38:01 UTC

Re: [Messenger] Messenger Configuration and JBoss

 From: "Rademacher Tobias" <To...@grob.de>
> Hi Folks,
>
> I want to use Messener to simpfifying usage of JMS in EJB-Struts
> Application.
> On the project file you mentioned an xml base deployment descriptor.
>
> First question:
>
> Is this decriptor necessary or can I configure the Factory inside the
code?

You can use code (though I've never tried it yet); though one of the points
of Messenger is that the JMS configuration becomes a deployment option
rather than inside your application code. Though I don't see any reason why
you can't use Java code if you wish.

Right now the MessengerManager is a little container of Messenger instances
which are looked up by name. You could manually create a MessengerManager
and register Messenger instances as you wish - or just use your own
Messenger directly and not bother with the MessengerManager class.


> If yes where do I have it to place into my ear file that the appserver
finds
> it in classpath.
> I have a ejb.jar module and a war file? currently both fireing jms message
> (but I'm sure in future only one will).
>
> Any ideas?

Putting Messenger.xml anywhere in the classpath will do the trick; or just
explicitly initialising Messenger in (say) a Servlet my getting the URL from
some location.

e.g. in a servlet you could do

    URL url = getServletContext().getResource("/WEB-INF/Messenger.xml");
    MessengerManager manager = MessengerManager.configure( url.toString() );
    ...

or do something similar in an EJB etc.


If you want to be able to hot deploy the servlet and ear independently, then
they should both have their own JMS connections & MessengerManager instance,
so that you can take down (say) the ear and the war keeps running etc.


> Seconde question:
>
> Will it work in jboss?

Absolutely. There's a sample JBoss configuration file in src/conf

James
-------
http://radio.weblogs.com/0112098/


__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com