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#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...