Dedicated ActiveMQ pooled ConnectionFactory with XA / JCA support

View: New views
6 Messages — Rating Filter:   Alert me  

Dedicated ActiveMQ pooled ConnectionFactory with XA / JCA support

by gnodet :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have committed in jencks some work I have done the past weeks
on a pooled ConnectionFactory for ActiveMQ.
This add the following features:
   * multiple connections are used to improve throughput (until the
AMQ broker is multithreaded)
   * support for XA transactions: when creating a session, if an XA
transaction is active,
     the session will be enlisted in this transaction
   * support for JCA : if used with JCA inbound support, there is a
need to wrap the
      XAResource so that the TM knows that both XA resources belongs to the same
      ResourceManager

Support for XA / JCA is much faster than the JCA outbound support
because the AMQ resource adapter reverts the connection in a fully clean state
after use.  This may be needed when dealing with container managed security,
but when this feature is not used, I would recommend using this pooled
connection factories, which performs much better.

--
Cheers,
Guillaume Nodet

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


Re: Dedicated ActiveMQ pooled ConnectionFactory with XA / JCA support

by gnodet :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Btw, I've blogged about that at http://gnodet.blogspot.com/

On 12/19/06, Guillaume Nodet <gnodet@...> wrote:

> I have committed in jencks some work I have done the past weeks
> on a pooled ConnectionFactory for ActiveMQ.
> This add the following features:
>    * multiple connections are used to improve throughput (until the
> AMQ broker is multithreaded)
>    * support for XA transactions: when creating a session, if an XA
> transaction is active,
>      the session will be enlisted in this transaction
>    * support for JCA : if used with JCA inbound support, there is a
> need to wrap the
>       XAResource so that the TM knows that both XA resources belongs to the same
>       ResourceManager
>
> Support for XA / JCA is much faster than the JCA outbound support
> because the AMQ resource adapter reverts the connection in a fully clean state
> after use.  This may be needed when dealing with container managed security,
> but when this feature is not used, I would recommend using this pooled
> connection factories, which performs much better.
>
> --
> Cheers,
> Guillaume Nodet
>


--
Cheers,
Guillaume Nodet

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


Re: Dedicated ActiveMQ pooled ConnectionFactory with XA / JCA support

by Christopher G. Stach II :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Guillaume Nodet wrote:

> Btw, I've blogged about that at http://gnodet.blogspot.com/
>
> On 12/19/06, Guillaume Nodet <gnodet@...> wrote:
>> I have committed in jencks some work I have done the past weeks
>> on a pooled ConnectionFactory for ActiveMQ.
>> This add the following features:
>>    * multiple connections are used to improve throughput (until the
>> AMQ broker is multithreaded)
>>    * support for XA transactions: when creating a session, if an XA
>> transaction is active,
>>      the session will be enlisted in this transaction
>>    * support for JCA : if used with JCA inbound support, there is a
>> need to wrap the
>>       XAResource so that the TM knows that both XA resources belongs
>> to the same
>>       ResourceManager
>>
>> Support for XA / JCA is much faster than the JCA outbound support
>> because the AMQ resource adapter reverts the connection in a fully
>> clean state
>> after use.  This may be needed when dealing with container managed
>> security,
>> but when this feature is not used, I would recommend using this pooled
>> connection factories, which performs much better.
>>
>> --
>> Cheers,
>> Guillaume Nodet
>>

Could you put up some configuration examples, perhaps amqpool outbound
in combination with JCA inbound using AMQ's RA with XA JTA transactions
in Spring? :)

--
Christopher G. Stach II


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


Re: Re: Dedicated ActiveMQ pooled ConnectionFactory with XA / JCA support

by adepue :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I would love to see this as well. :)
Another thing I'm curious about is if the JcaConnectionPool (possibly)
grabs a new session from the pool every time I createSession(...) within
the same transaction?  I have code that needs to send out several
messages within the same transaction, and it follows the
"createSesssion(), createProducer(), send(), producer.close(),
session.close()" pattern.  It would be nice if there was an option for
"createSession()" to return a sticky session within the same
transaction.  I believe Spring's JmsTemplate provides this transaction
"stickiness", but I may not be able to use JmsTemplate in this case.

Thanks,
  Andy

Christopher G. Stach II wrote:

> Guillaume Nodet wrote:
>  
>> Btw, I've blogged about that at http://gnodet.blogspot.com/
>>
>> On 12/19/06, Guillaume Nodet <gnodet@...> wrote:
>>    
>>> I have committed in jencks some work I have done the past weeks
>>> on a pooled ConnectionFactory for ActiveMQ.
>>> This add the following features:
>>>    * multiple connections are used to improve throughput (until the
>>> AMQ broker is multithreaded)
>>>    * support for XA transactions: when creating a session, if an XA
>>> transaction is active,
>>>      the session will be enlisted in this transaction
>>>    * support for JCA : if used with JCA inbound support, there is a
>>> need to wrap the
>>>       XAResource so that the TM knows that both XA resources belongs
>>> to the same
>>>       ResourceManager
>>>
>>> Support for XA / JCA is much faster than the JCA outbound support
>>> because the AMQ resource adapter reverts the connection in a fully
>>> clean state
>>> after use.  This may be needed when dealing with container managed
>>> security,
>>> but when this feature is not used, I would recommend using this pooled
>>> connection factories, which performs much better.
>>>
>>> --
>>> Cheers,
>>> Guillaume Nodet
>>>
>>>      
>
> Could you put up some configuration examples, perhaps amqpool outbound
> in combination with JCA inbound using AMQ's RA with XA JTA transactions
> in Spring? :)
>
>  

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


Re: Re: Dedicated ActiveMQ pooled ConnectionFactory with XA / JCA support

by gnodet :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

IIRC, it doesn't matter at all.  Using two different sessions
has the same effect, because they use a single resource
manager and so does not have any overhead of using two
phase commit.  As sessions are pooled, i don't really
see any optimization to do there.

On 4/6/07, Andy DePue <andy@...> wrote:
I would love to see this as well. :)
Another thing I'm curious about is if the JcaConnectionPool (possibly)
grabs a new session from the pool every time I createSession(...) within
the same transaction?  I have code that needs to send out several
messages within the same transaction, and it follows the
"createSesssion(), createProducer(), send(), producer.close(),
session.close()" pattern.  It would be nice if there was an option for
"createSession()" to return a sticky session within the same
transaction.  I believe Spring's JmsTemplate provides this transaction
"stickiness", but I may not be able to use JmsTemplate in this case.

Thanks,
  Andy

Christopher G. Stach II wrote:

> Guillaume Nodet wrote:
>
>> Btw, I've blogged about that at http://gnodet.blogspot.com/
>>
>> On 12/19/06, Guillaume Nodet <gnodet@...> wrote:
>>
>>> I have committed in jencks some work I have done the past weeks
>>> on a pooled ConnectionFactory for ActiveMQ.
>>> This add the following features:
>>>    * multiple connections are used to improve throughput (until the
>>> AMQ broker is multithreaded)
>>>    * support for XA transactions: when creating a session, if an XA
>>> transaction is active,
>>>      the session will be enlisted in this transaction
>>>    * support for JCA : if used with JCA inbound support, there is a
>>> need to wrap the
>>>       XAResource so that the TM knows that both XA resources belongs
>>> to the same
>>>       ResourceManager
>>>
>>> Support for XA / JCA is much faster than the JCA outbound support
>>> because the AMQ resource adapter reverts the connection in a fully
>>> clean state
>>> after use.  This may be needed when dealing with container managed
>>> security,
>>> but when this feature is not used, I would recommend using this pooled
>>> connection factories, which performs much better.
>>>
>>> --
>>> Cheers,
>>> Guillaume Nodet
>>>
>>>
>
> Could you put up some configuration examples, perhaps amqpool outbound
> in combination with JCA inbound using AMQ's RA with XA JTA transactions
> in Spring? :)
>
>

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email




--
Cheers,
Guillaume Nodet
------------------------
Architect, LogicBlaze (http://www.logicblaze.com/)
Blog: http://gnodet.blogspot.com/

Re: Re: Dedicated ActiveMQ pooled ConnectionFactory with XA / JCA support

by adepue :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm not real familiar with JCA or Jencks yet, so maybe you can tell me
if these concerns are addressed:
1. Since the Session gets registered with the XA transaction, doesn't
that remove the Session from the pool until transaction commit?  What
happens if I send out 10 messages using the "createSession(),
createProducer(), producer.send(), producer.close(), session.close()"
pattern all in the same transaction?  Do I end up taking 10 Sessions out
of the pool, possibly exhausting the pool, and possibly blocking other
threads waiting for a Session from the pool until I commit my transaction?
2. If I send three messages (A, B, C) to the same queue via three
different Sessions (because of pooling) in the same (XA) transaction,
are there any guarantees that they will be received in the same order I
sent them?  It wouldn't surprise me if such an arrangement weakens the
"guarantee".

  - Andy

Guillaume Nodet wrote:

> IIRC, it doesn't matter at all.  Using two different sessions
> has the same effect, because they use a single resource
> manager and so does not have any overhead of using two
> phase commit.  As sessions are pooled, i don't really
> see any optimization to do there.
>
> On 4/6/07, *Andy DePue* <andy@...
> <mailto:andy@...>> wrote:
>
>     I would love to see this as well. :)
>     Another thing I'm curious about is if the JcaConnectionPool (possibly)
>     grabs a new session from the pool every time I createSession(...)
>     within
>     the same transaction?  I have code that needs to send out several
>     messages within the same transaction, and it follows the
>     "createSesssion(), createProducer(), send(), producer.close(),
>     session.close()" pattern.  It would be nice if there was an option for
>     "createSession()" to return a sticky session within the same
>     transaction.  I believe Spring's JmsTemplate provides this transaction
>     "stickiness", but I may not be able to use JmsTemplate in this case.
>
>     Thanks,
>       Andy
>
>     Christopher G. Stach II wrote:
>     > Guillaume Nodet wrote:
>     >
>     >> Btw, I've blogged about that at http://gnodet.blogspot.com/
>     >>
>     >> On 12/19/06, Guillaume Nodet < gnodet@...
>     <mailto:gnodet@...>> wrote:
>     >>
>     >>> I have committed in jencks some work I have done the past weeks
>     >>> on a pooled ConnectionFactory for ActiveMQ.
>     >>> This add the following features:
>     >>>    * multiple connections are used to improve throughput
>     (until the
>     >>> AMQ broker is multithreaded)
>     >>>    * support for XA transactions: when creating a session, if
>     an XA
>     >>> transaction is active,
>     >>>      the session will be enlisted in this transaction
>     >>>    * support for JCA : if used with JCA inbound support, there
>     is a
>     >>> need to wrap the
>     >>>       XAResource so that the TM knows that both XA resources
>     belongs
>     >>> to the same
>     >>>       ResourceManager
>     >>>
>     >>> Support for XA / JCA is much faster than the JCA outbound support
>     >>> because the AMQ resource adapter reverts the connection in a
>     fully
>     >>> clean state
>     >>> after use.  This may be needed when dealing with container managed
>     >>> security,
>     >>> but when this feature is not used, I would recommend using
>     this pooled
>     >>> connection factories, which performs much better.
>     >>>
>     >>> --
>     >>> Cheers,
>     >>> Guillaume Nodet
>     >>>
>     >>>
>     >
>     > Could you put up some configuration examples, perhaps amqpool
>     outbound
>     > in combination with JCA inbound using AMQ's RA with XA JTA
>     transactions
>     > in Spring? :)
>     >
>     >
>
>     ---------------------------------------------------------------------
>     To unsubscribe from this list please visit:
>
>         http://xircles.codehaus.org/manage_email
>
>
>
>
> --
> Cheers,
> Guillaume Nodet
> ------------------------
> Architect, LogicBlaze (http://www.logicblaze.com/)
> Blog: http://gnodet.blogspot.com/ 

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email