You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Gordon Sim <gs...@redhat.com> on 2007/03/26 15:42:06 UTC

[c++] Re: dtx API

Alan Conway wrote:
> One note here - in the C++ broker, I'd like to pass a more restricted 
> interface to Queue and Message to the messagestore. 

I agree; I'm going to be continuing with the dtx implementation on c++ 
and will do some refactoring as part of that, including the point you 
mention here (e.g. some sort of PersistableQueue and PersistableMessage 
interface).


Re: [c++] Re: dtx API

Posted by Arnaud Simon <as...@redhat.com>.
On Mon, 2007-03-26 at 17:46 +0100, Rupert Smith wrote:
> Are you planning on using the interfaces already provided in
> javax.transaction.xa? I noticed that your TransactionManager interface
> is very close to XAResource and your Xid interface is identical to the
> one in that package. Is this stuff working at a lower level or is it
> intended to be a JTA implementation that works in the standard way
> with java transaction managers? 

The plan is to provide XA support i.e. we will implement an XA Resource
on the client side and most certainly a JMS XAConnection and
corresponding XASession. AMPQ defines the dtx classes for providing XA
support this is why on the server, the TM API is similar to the XA one
you are familiar with.

> The reason I ask, is I'm trying to imagine writing a JCA resource
> adapter to plug Qpid into an app server. To do this you have to
> implement XAResource in javax.transaction.xa.

We will need to implement JMS XAConnection, XASession and XAResource and
ConnectionConsumer for plugging our JMS implementation in an App server.
This is the case when we want to use JMS but I don't think we should try
to plug Qpid within an App server using a resource adapter. 

> Also, what about the case for non-XA (local only) transactions. The
> transactional enqueue and dequeue methods must take Xid parameters. In
> the local case would you just generate some suitable values to use for
> these or would the local transaction methods on MessageStore be
> different or just like they currently are? 

We will use the same methods, the only difference would be that the API
caller would need to create an Xid for referencing a local tx. So, there
isn't a real difference between a local tx and a distributed one. The
only thing is that local transactions always use one phase commit. So
you would do something like: 
xid = Xid.create()
TM.begin(xid)
PS.enqueue(xid, M)
TM.commit-one-phase(xid)




Re: [c++] Re: dtx API

Posted by Rupert Smith <ru...@googlemail.com>.
Are you planning on using the interfaces already provided in
javax.transaction.xa? I noticed that your TransactionManager interface is
very close to XAResource and your Xid interface is identical to the one in
that package. Is this stuff working at a lower level or is it intended to be
a JTA implementation that works in the standard way with java transaction
managers?

The reason I ask, is I'm trying to imagine writing a JCA resource adapter to
plug Qpid into an app server. To do this you have to implement XAResource in
javax.transaction.xa.

Also, what about the case for non-XA (local only) transactions. The
transactional enqueue and dequeue methods must take Xid parameters. In the
local case would you just generate some suitable values to use for these or
would the local transaction methods on MessageStore be different or just
like they currently are?

Rupert

On 26/03/07, Arnaud Simon <as...@redhat.com> wrote:
>
> +1
>
> I first though about only sending bytes arrays and Uids around but it
> was too restrictive so we went for what we currently have.
> I´ll synchronize with Gordon for defining PersistableQueue and
> PersistableMessage interfaces.
>
> Cheers
>
> Arnaud
>
>
> On Mon, 2007-03-26 at 14:42 +0100, Gordon Sim wrote:
> > Alan Conway wrote:
> > > One note here - in the C++ broker, I'd like to pass a more restricted
> > > interface to Queue and Message to the messagestore.
> >
> > I agree; I'm going to be continuing with the dtx implementation on c++
> > and will do some refactoring as part of that, including the point you
> > mention here (e.g. some sort of PersistableQueue and PersistableMessage
> > interface).
> >
>
>

Re: [c++] Re: dtx API

Posted by Arnaud Simon <as...@redhat.com>.
+1

I first though about only sending bytes arrays and Uids around but it
was too restrictive so we went for what we currently have. 
I´ll synchronize with Gordon for defining PersistableQueue and
PersistableMessage interfaces.

Cheers

Arnaud


On Mon, 2007-03-26 at 14:42 +0100, Gordon Sim wrote:
> Alan Conway wrote:
> > One note here - in the C++ broker, I'd like to pass a more restricted 
> > interface to Queue and Message to the messagestore. 
> 
> I agree; I'm going to be continuing with the dtx implementation on c++ 
> and will do some refactoring as part of that, including the point you 
> mention here (e.g. some sort of PersistableQueue and PersistableMessage 
> interface).
>