[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Re: JBMESSAGING-519 - Failover(HA) design discussion

clebert.suconic@jboss.com do-not-reply at jboss.com
Wed Oct 11 16:32:01 EDT 2006


I'm creating a method called failoever(ConnectionDelegate newDelegate) into ConnectionDelegate.

I could already have a simple producer failing over another node after the method failoever was called.


Looking at this testcase you will have an idea how this is supposed to work. Onc the method failoever(connection2.getDelegate()) is called the producer is now connected to the new node.

    public void testSimpleWithOneProducer() throws Exception
  |     {
  |         JBossConnection  conn = (JBossConnection)this.factoryServer1.createConnection();
  |         Session session = conn.createSession(false,Session.AUTO_ACKNOWLEDGE);
  |         Destination destination = (Destination)getCtx1().lookup("queue/testQueue");
  |         MessageProducer producer = session.createProducer(destination);
  | 
  |         Message message = session.createTextMessage("Hello Before");
  |         producer.send(message);
  | 
  |         ClientConnectionDelegate delegate = (ClientConnectionDelegate)conn.getDelegate();
  |         ConnectionState state = (ConnectionState)delegate.getState();
  | 
  |         JBossConnection conn2 = (JBossConnection)this.factoryServer2.createConnection();
  |         conn.getDelegate().failOver(conn2.getDelegate());
  | 
  |         message = session.createTextMessage("Hello After");
  |         producer.send(message);
  |     }
  | 
  | 

I have a question about what would happen with Producers when dealing with transactions, as when the producer is failedOver the new connection, All the ObjectIDS (referenced on the current TransactionContext) won't exist on the new node.

Should we throw an exception next sendMessage or commit is called?

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

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



More information about the jboss-dev-forums mailing list