[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Re: Client failover redeliveries discussion (Repost)
clebert.suconic@jboss.com
do-not-reply at jboss.com
Tue Oct 17 16:20:35 EDT 2006
"timfox" wrote : "clebert.suconic at jboss.com" wrote : I already have consumers seamlessly reconnecting to a new server during a HA event.
| |
| | Basically what I do on failover is to create a new consumer on the new server, replace IDs and re-register the Callback handler.
| |
|
| Sounds about right. But what do you mean by "replace ids"?
|
Take an example of recreating the connection.
On the HA experiment Branch, look at ConnectionAspect::handleFailoever:
failoever receives a new ClientConnectionDelegate as the parameter. The idea is to get a new connection, but keep the actual delegates we are using.
Creating a new connection on the new server will create a new server Object, consequently a new ServerId.
The method State.failoever and Delegate transferHAState will be both responsible on making the delegates on the old connection assuming new IDs coming from the new server.
| ClientConnectionDelegate otherConnection = (ClientConnectionDelegate)((MethodInvocation)invocation).getArguments()[0];
| ConnectionState newConnectionState = (ConnectionState)((ClientConnectionDelegate)otherConnection).getState();
|
| currentConnectionState.failOver(newConnectionState);
|
| if (currentConnectionState.getClientID()!=null)
| {
| otherConnection.setClientID(currentConnectionState.getClientID());
| }
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3978878#3978878
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3978878
More information about the jboss-dev-forums
mailing list