[jboss-user] [JBoss Messaging] - Opening a new JMS session for an already existing transactio

olimo do-not-reply at jboss.com
Wed Mar 4 12:01:57 EST 2009


Hi, 

Is it possible to open a new JMS session for an existing transaction with JBM 1.4? 

I imagine that it is what happens when a connection generated by a ClusteredConnectionFactory manages the failover of a JBM cluster node, does it?

Let me introduce the context of my question: 

We have a cluster of JBossMessaging instances. For technical limitations of our legacy system, we need to transmit some messages to our cluster via http. In this case, a client sends a message via http, a web application based on each node of our cluster retrieves the messages coming from http, transforms it in jms and send it to JBM. (JBM and the web app are on the same JBOSS instance and both are replicated on each node of our cluster).

We want to manage transactions in http as we do in jms. In order to enable that feature, when a transaction is done via http, the web app stores all the messages of the transaction in Session. When the transaction finishes (commit), the stored messages are sent in a jms transaction on JBM and the stored messages are removed from the Session.
The Session content of the web app is replicated in the cluster (sticky Session is used on the loadBalancer). When a node fails, all the messages of the transaction are still available: we’ve done the failover.

However, this solution is not safe since we cannot ensure (functionally) that the number of messages of the transactions will not overflow the cluster node memory.

An alternative solution consists in keeping in the content of the replicated http-session a jms- session created for the transaction. Then the messages received in the transaction via http are sent on-the-fly to JBM (in jms). The jms-transaction is committed or rolled-back when one of these operations is received via http. With this solution, the memory problem is delegated to JBM. Nevertheless, it is no more possible to make the failover: the jms-session replicated in the http-session cannot be reused by other threads (and thus cluster nodes) than its creator. 

Since it is not possible to use the replicated jms-session object if the creator node fails, is it possible to open a new JMS session on a living cluster node for the already started transaction? 


Thanks for your help !

olivier



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

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




More information about the jboss-user mailing list