geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aaron Mulder" <>
Subject Re: How do I set up JMS connections in a GBean?
Date Tue, 06 Feb 2007 14:30:42 GMT
The first thing to consider is that when you're writing a GBean, you
find it most convenient to deal with other GBeans.  So the recommended
path would be for your GBean to locate the GBeans representing the JMS
connection factory and destination you need, and then once you have
those you can easily get the underlying JMS objects.

Normally, you would create the GBean with properties on it like the
JMS ConnectionFactory and JMS destination.  Then in your GBean
metadata, you'd declare those properties as references to the
appropriate type of GBean.  Finally, in the plan for the GBean, you'd
map those references to the specific connection factory or topic/queue
that you want to use.  That will result in the JMS properties being
injected into your GBean, and it can just use them.  The tricky part
will be figuring out exactly what to put in your plan to identify the
resources in question -- it turns out to be not entirely
straightforward, but once you get this far, I think we can help you
through the mapping.

It would also be possible to do some kind of lookup to locate the JMS
resources at runtime, e..g if you won't know the name of the topic or
queue until runtime.  One option for that is to have a multi-valued
reference that has *all* topics or queues in it, and then you flip
through that until you find the one you want.  Another option would be
to use a kernel query to find the specific GBean you want (e.g. by
saying something like "find GBeans where type is topic and name is

Finally, note that GBeans do not have any kind of automatic
transaction handling, so if you need transactions when dealing with
JMS in your GBean, you'll have some manual work to do.


On 2/4/07, Fredrik Jonson <> wrote:
> Hello all,
> I'm new to J2EE and Geronimo, and hope you can help me with a bit of
> application design advice.
> I have a legacy network component that I plan to to deploy as a GBean.
> The gbean stuff seems rather straight forward, no problem there as far
> as I can see from my first attempts.
> Now, to make the component communicate with a regular EJB application I
> would like to connect to geronimo's JMS provider and set up message
> producers for network originated data, and register a message listener
> for network bound data.
> Do I need to make any special considerations due to it being deployed in
> geronimo and the jms provider being managed by geronimo? Do I need some
> sort of jms resource plan? Or is it something you configures in the
> deployment plan? Or is plain old jndi lookups enough?
> TIA & regards,
> --
> Fredrik Jonson

View raw message