commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <>
Subject Re: [Messenger] Messenger Configuration and JBoss
Date Thu, 06 Mar 2003 11:03:26 GMT
 From: "Rademacher Tobias" <>
> Hi James,
> thanks for your helpfull respone.
> >You can use code (though I've never tried it yet); though one of the
> >of Messenger is that the JMS configuration becomes a deployment option
> >rather than inside your application code. Though I don't see any reason
> >you can't use Java code if you wish.
> >
> >Right now the MessengerManager is a little container of Messenger
> >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.
> Okay. In something JMXish like JBoss wouldn't be a MBean a nice choice for
> configuration? Actually I like the JMX aproach a lot. It's  a shame
> that only a few Appsever's support this great technology....

Funnily enough I was pondering on my way to work about creating a few MBeans
to setup a bunch of connections & subscriptions; which could serve as an
alternative mechanism to using the ManagerServlet.  This could happen quite

> >Putting Messenger.xml anywhere in the classpath will do the trick; or
> >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.
> In EJB this would be a much greater Problem. So the only thing i guess is
> insert
> the complete xml string into a ejb-env entry or access it via JNDI.
> Mhm. But this means that MessengerManager may need a configure(Document
> document)
> method processing a based dom4j document. Again here I would love it load
> the configuration
> from a MBean.

It loads the XML configuration from a URI. So you don't need to put the XML
file inside the ear - it can be anywhere on your intranet.

> So I guess I spent some investigations in that. What do you
> think?

MBeans would be another neat alternative to the Messenger.xml and the
subscriptions.xml - they could just be MLETs etc.

> BTW: I know you a critic of EJB's. After writing an application using CMP
> 2.0 Entity Beans
> and a couple of MDB I follow most of your points. What do you think in
> context about
> MDB? Usefull or painfull? Actually I'm a big fan of JMS, because it offer
> much flexibility.

If you're working with EJBs then MDBs are fine (since you've already gone
with an EJB container anyways). The problem with MDBs (apart from that they
require an EJB container) is that you can't easily send reply messages; MDBs
are designed to invoke EJB operations. The nice thing about MDO's is you get
the Messenger that was used to consume the message so you can efficiently
send a reply back using the same Connection/Session.


Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts

View raw message