jsr343-experts@jms-spec.java.net

[jsr343-experts] Re: [jms-spec users] Re: JMS over CDI or something else?

From: Nigel Deakin <nigel.deakin_at_oracle.com>
Date: Mon, 11 Jul 2011 13:06:16 +0100

John,

On 07/07/2011 20:07, John D. Ament wrote:
>
> 1. The event model is a direct integration between serializables and sending JMS messages. Obviously, the big
> limitation is that a created message needs to be bound to a specific JMS session. For right now, there is no way to
> guarantee that the JMS SEssion used to create a message fired is then actually sent via that session, CDI doesn't have a
> scope that confirms that.
(snip)

> 2. The simplified APIs provided in Seam JMS are really just meant to supplement the fact that an injected
> MessageProducer is completely unusable as you need to guarantee that the JMS session injected for creating messages is
> the same one used to create your producer.

I'm interested in your suggestion that you need to guarantee that the JMS session used for creating messages is the same
one used to create your message producer. Where in the JMS spec or API do you think it says this?

My own interpretation of the spec is that a MessageProducer must be able to send a javax.JMS.Message irrespective of how
it was created. It might have been created using Session.createMessage(), or it may have been received by a
MessageConsumer. It might even have been created by a foreign JMS provider (though the spec states that this might not
be handled as efficiently as a provider's own implementation). Section 3.12 is worth reading.

Anyone else have a view? Perhaps this is something we need to clarify, if it would make building frameworks easier.

Nigel