Client side HA design
The point of client HA is to copy the recreate the current message objects on the server.
For each Connection,Session, Browser or Consumer, we will recreate every object on the new connection.
This will happen in some Remoting client event marking the connection as failled and calling ClientConnectionDelegate.faileOver(ClientConnectionDelegate newConnection) method.
The method will navigate on the hierarchy shown at the diagrams specified on this page.
For a connection we will:
- Create a new connection with every single property. (Considering start, clientId...etc)
- Replace the ID for the new connection ID
- Replace the ID generator
- Replace the RemotingConnection object under Connection
- Create a new session
- Replace the ID
For a MessageProducer
- Create a new MessageProducer delegate (using the same properties existent prior to the fail even... including transactionState... etc)
- Replace the IDs
For a MessageConsumer
- Create a new MessageConsumer delegate (using the same properties as before)
For durable subscriptions this should trigger redeliveries of messages sent on the old node. We should ignore messages already sent
- Take care of ACK. (We have to decide if we really need to send them to the server side, or always clean the list)
- Replace the IDs
- Unregister the CallbackManager using the old ID
- Register back the CallbackManager using the new generated ID.
This will be probably very similar to Consumers, however this stil TBD after we have finished MessageConsumers
Relationship on connections
The following figure shows the current relationships between Connection Objects on the client.
JBossConnection is responsible of creating Sessions.
Session is responsible of creating Consumers and Producers.
JBossConnectionHA will be responsible for capturing creation events, storing then in a list and recreate its delegates when a Connection (RemotingConnection) is failed.
We will use the Hierarchy described on the following diagram to discover connected objects.