Hi Adrian - thanks for your reply.

I've managed to knock together a (very) rudimentary and incomplete 
implementation of transacted sessions which appears to work ok.

So far I've only transacted message sends, and haven't done the acks.

Basically I've implemented a very simple ResourceManager which just handles 
local tx for now demarcated by commit() and rollback() on the Session object. 
This could be extended to handle the XAResource stuff later.

If the session is transacted then I'm storing the message in a LocalTx object 
which is stored in a map in the resource manager keyed on Xid.

The resource manager is on the client side.

On commit of the session. A "transactionrequest" object containing the messages 
to send are sent to the server delegate, which then iterates through them and 
sends them to the messaging core class to deliver.

So far the logic that adds the message to the resource manager when the session 
is transacted is done in the JBossMessageProducer class which would normally 
delegate to the MessageProducerDelegate class causing the invocation of the 
client side interceptor stack to be executed.

I think I need to move this to a client side interceptor 
(TransactionInterceptor) but just wanted to clarify with you the advantages of 
implementing it in an interceptor as opposed to the just using the 
JBossMessageProducer class itself.

So far I can see a few advantages of implementing this as an interceptor:

It allows the interceptor to moved to the server side if a "thin client" 
approach is required, as opposed to the "fat client" I have done so far.

It allows other interceptors e.g. LogInterceptor or ExceptionInterceptor to be 
placed before it in the interceptor chain. Although I guess the same effect 
could be achieved by using JbossAOP to advise before calls to 
JBossMessageProducer methods.

Are there other reasons for implementing this as an interceptor that I'm 
missing?

-Tim

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3874016#3874016

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3874016


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
JBoss-Development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to