You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Marc Binck <mb...@abprodata.com> on 2006/04/20 11:51:21 UTC

Transactions

Hi everybody.
 
Being new to ServiceMix and JBI, I'm still trying to understand how
transactions are used in SM.
 
I can see from the source code that a transaction manager is used, but I
cannot see the boundaries of transactions. No component seems to use a
commit.
 
If, for example, I define a binding that reads a message from Websphere MQ,
sends the content to a service that forwards it to a FileWriter. Is there
only a single transaction spanning the whole flow ? What creates and commits
it ? Can there be individual transactions ?
 
Thanks for your help.
 
 
Marc Binck

RE: Transactions

Posted by Marc Binck <mb...@abprodata.com>.
No worries.

Thanks


Marc

-----Original Message-----
From: Guillaume Nodet [mailto:gnodet@gmail.com] 
Sent: 27 April 2006 14:23
To: servicemix-users@geronimo.apache.org; mbinck@abprodata.com
Subject: Re: Transactions


Sorry about the late response...

It will depend on the flow you use inside ServiceMix.
If you use an in-memory flow (seda, st), the transaction will be conveyed by
the message exchange and all components may be included in the transaction.
If you use a jca flow, the exchange sent by the component will be enlisted
in the transaction, but no other component may be included.  In such a case,
the jbi exchange delivery will occur inside a transaction.  The effects
should be globally the same (aside performances), as soon as all components
involved can enlist their resources inside the current transaction.

Note that if you want JBI exchanges sent by a component to be enlisted in
the current transaction, you should set the
MessageExchange.JTA_TRANSACTION_PROPERTY_NAME property of the exchange to
the current transaction.  This is automatically done by the container if you
set the autoEnlistInTransaction attribute on the ServiceMix container.

If the exchange has been enlisted in a transaction and if you use a seda or
st flow, the exchange will be delivered synchronously.

To rollback a transaction, you just have to call setRollbackOnly on the
current transaction.

I need to fully document all that ...
Feel free to ask any other questions.

Hope this help,
Guillaume Nodet

On 4/24/06, Marc Binck <mb...@abprodata.com> wrote:
> Guillaume,
>
> With the JCA component, will it commit the transaction when the 
> message has been delivered to the flow or only when it passed through 
> the whole sequence of services that act on it ?
>
> In order to evaluate whether ServiceMix could be integrated as the 
> core of our financial messaging product, I would need to find out 
> whether it is possible for the binding component to deliver the 
> message to a queue on a single transaction, then service 1 acts on it 
> with an individual transaction, then the next service. While the 
> components that pick up the messages can control the transactions, it 
> is very difficult for services to do this since transaction would need 
> to be started before the onMessageExchange is delivering them.
>
> This is especially important since some of the messages may be stored 
> in persistent storage.
>
> Thanks for your help
>
>
> Marc
>
> -----Original Message-----
> From: Guillaume Nodet [mailto:gnodet@gmail.com]
> Sent: 20 April 2006 18:03
> To: servicemix-users@geronimo.apache.org; mbinck@abprodata.com
> Subject: Re: Transactions
>
>
> Transactions are highly dependaant of the components used. The file 
> system is in no way transactional, so file pollers won't start any 
> transactions. The JCA component will start one when a jms message 
> arrives and will commit it.  All components should be able to enlist 
> their resources in the transaction.
>
> Cheers,
> Guillaume Nodet
>
> On 4/20/06, Marc Binck <mb...@abprodata.com> wrote:
> > Hi everybody.
> >
> > Being new to ServiceMix and JBI, I'm still trying to understand how 
> > transactions are used in SM.
> >
> > I can see from the source code that a transaction manager is used, 
> > but I cannot see the boundaries of transactions. No component seems 
> > to use a commit.
> >
> > If, for example, I define a binding that reads a message from 
> > Websphere MQ, sends the content to a service that forwards it to a 
> > FileWriter. Is there only a single transaction spanning the whole 
> > flow ? What creates and commits it ? Can there be individual 
> > transactions ?
> >
> > Thanks for your help.
> >
> >
> > Marc Binck
> >
> >
>
>


Re: Transactions

Posted by Guillaume Nodet <gn...@gmail.com>.
Sorry about the late response...

It will depend on the flow you use inside ServiceMix.
If you use an in-memory flow (seda, st), the transaction will be
conveyed by the message exchange and all components may be included in
the transaction.  If you use a jca flow, the exchange sent by the
component will be enlisted in the transaction, but no other component
may be included.  In such a case, the jbi exchange delivery will occur
inside a transaction.  The effects should be globally the same (aside
performances), as soon as all components involved can enlist their
resources inside the current transaction.

Note that if you want JBI exchanges sent by a component to be enlisted
in the current transaction, you should set the
MessageExchange.JTA_TRANSACTION_PROPERTY_NAME property of the exchange
to the current transaction.  This is automatically done by the
container if you set the autoEnlistInTransaction attribute on the
ServiceMix container.

If the exchange has been enlisted in a transaction and if you use a
seda or st flow, the exchange will be delivered synchronously.

To rollback a transaction, you just have to call setRollbackOnly on
the current transaction.

I need to fully document all that ...
Feel free to ask any other questions.

Hope this help,
Guillaume Nodet

On 4/24/06, Marc Binck <mb...@abprodata.com> wrote:
> Guillaume,
>
> With the JCA component, will it commit the transaction when the message has
> been delivered to the flow or only when it passed through the whole sequence
> of services that act on it ?
>
> In order to evaluate whether ServiceMix could be integrated as the core of
> our financial messaging product, I would need to find out whether it is
> possible for the binding component to deliver the message to a queue on a
> single transaction, then service 1 acts on it with an individual
> transaction, then the next service. While the components that pick up the
> messages can control the transactions, it is very difficult for services to
> do this since transaction would need to be started before the
> onMessageExchange is delivering them.
>
> This is especially important since some of the messages may be stored in
> persistent storage.
>
> Thanks for your help
>
>
> Marc
>
> -----Original Message-----
> From: Guillaume Nodet [mailto:gnodet@gmail.com]
> Sent: 20 April 2006 18:03
> To: servicemix-users@geronimo.apache.org; mbinck@abprodata.com
> Subject: Re: Transactions
>
>
> Transactions are highly dependaant of the components used.
> The file system is in no way transactional, so file pollers won't start any
> transactions. The JCA component will start one when a jms message arrives
> and will commit it.  All components should be able to enlist their resources
> in the transaction.
>
> Cheers,
> Guillaume Nodet
>
> On 4/20/06, Marc Binck <mb...@abprodata.com> wrote:
> > Hi everybody.
> >
> > Being new to ServiceMix and JBI, I'm still trying to understand how
> > transactions are used in SM.
> >
> > I can see from the source code that a transaction manager is used, but
> > I cannot see the boundaries of transactions. No component seems to use
> > a commit.
> >
> > If, for example, I define a binding that reads a message from
> > Websphere MQ, sends the content to a service that forwards it to a
> > FileWriter. Is there only a single transaction spanning the whole flow
> > ? What creates and commits it ? Can there be individual transactions ?
> >
> > Thanks for your help.
> >
> >
> > Marc Binck
> >
> >
>
>

RE: Transactions

Posted by Marc Binck <mb...@abprodata.com>.
Guillaume,

With the JCA component, will it commit the transaction when the message has
been delivered to the flow or only when it passed through the whole sequence
of services that act on it ?

In order to evaluate whether ServiceMix could be integrated as the core of
our financial messaging product, I would need to find out whether it is
possible for the binding component to deliver the message to a queue on a
single transaction, then service 1 acts on it with an individual
transaction, then the next service. While the components that pick up the
messages can control the transactions, it is very difficult for services to
do this since transaction would need to be started before the
onMessageExchange is delivering them.

This is especially important since some of the messages may be stored in
persistent storage.

Thanks for your help


Marc

-----Original Message-----
From: Guillaume Nodet [mailto:gnodet@gmail.com] 
Sent: 20 April 2006 18:03
To: servicemix-users@geronimo.apache.org; mbinck@abprodata.com
Subject: Re: Transactions


Transactions are highly dependaant of the components used.
The file system is in no way transactional, so file pollers won't start any
transactions. The JCA component will start one when a jms message arrives
and will commit it.  All components should be able to enlist their resources
in the transaction.

Cheers,
Guillaume Nodet

On 4/20/06, Marc Binck <mb...@abprodata.com> wrote:
> Hi everybody.
>
> Being new to ServiceMix and JBI, I'm still trying to understand how 
> transactions are used in SM.
>
> I can see from the source code that a transaction manager is used, but 
> I cannot see the boundaries of transactions. No component seems to use 
> a commit.
>
> If, for example, I define a binding that reads a message from 
> Websphere MQ, sends the content to a service that forwards it to a 
> FileWriter. Is there only a single transaction spanning the whole flow 
> ? What creates and commits it ? Can there be individual transactions ?
>
> Thanks for your help.
>
>
> Marc Binck
>
>


Re: Transactions

Posted by Guillaume Nodet <gn...@gmail.com>.
Transactions are highly dependaant of the components used.
The file system is in no way transactional, so file pollers won't
start any transactions.
The JCA component will start one when a jms message arrives and will
commit it.  All components should be able to enlist their resources in
the transaction.

Cheers,
Guillaume Nodet

On 4/20/06, Marc Binck <mb...@abprodata.com> wrote:
> Hi everybody.
>
> Being new to ServiceMix and JBI, I'm still trying to understand how
> transactions are used in SM.
>
> I can see from the source code that a transaction manager is used, but I
> cannot see the boundaries of transactions. No component seems to use a
> commit.
>
> If, for example, I define a binding that reads a message from Websphere MQ,
> sends the content to a service that forwards it to a FileWriter. Is there
> only a single transaction spanning the whole flow ? What creates and commits
> it ? Can there be individual transactions ?
>
> Thanks for your help.
>
>
> Marc Binck
>
>