jsr343-experts@jms-spec.java.net

[jsr343-experts] Re: JMS Support for DI

From: Rüdiger zu Dohna <ruediger.dohna_at_1und1.de>
Date: Thu, 10 Nov 2011 16:50:48 +0100

On 10.11.2011, at 16:31, Clebert Suconic wrote:
> I guess I'm proposing merging connection, session and producer altogether. And connection, session and consumer.

Maybe I'm oversimplifying. The simple case is, as you suggest:

NewConsumer consumer = connectionFactory.createConsumer(...);
NewProducer producer = connectionFactory.createProducer(...);

With two "contexts".

But what should these contexts share? I think only the transaction, isn't it? And that's standard JTA: If you have one around those two calls, they share it (which doesn't necessarily mean it's XA), and if you don't have one, they use separate transactions.

With DI we could just inject those two and annotate everything we need to configure them.

(also just brainstorming)