ClusterQueue provides reliable point to point transfer of messages.
ClusterQueue runs on the Triad pod to provide clustered, uninterrupted
services. Nodes in the cluster uses
com.caucho.jms.RemoteQueue
to communicate with the ClusterQueue running on the Triad.
Send Message Workflow:
- Client actor invokes
RemoteQueue
's send() API
- RemoteQueue calls
RemoteQueueActor
's send() API.
RemoteQueueActor uses BAM (Brokered Agent Messaging) APIs for
communicating with ClusterQueue
- RemoteQueueActor issues
com.caucho.jms.cluster.TriadSendMessage
to the active server on the triad node
com.caucho.jms.cluster.ClusterMessageService
on the active
server on the triad node picks up the message and passes it to ClusterQueue
- ClusterQueue drops the message to it's local FileQueue
Receive Message Workflow:
- Client Actor invokes
RemoteQueue
's receive() API
- RemoteQueue calls
RemoteQueueActor
's receive() API.
RemoteQueueActor uses BAM (Brokered Agent Messaging) APIs for
communicating with ClusterQueue
- RemoteQueueActor issues
com.caucho.jms.cluster.TriadReceiveQuery
to the active server on the triad node. This call is a blocking (aka
synchronous) call to the active server.
com.caucho.jms.cluster.ClusterMessageService
on the active
server on the triad node picks up the message and checks to see if there
are any messges in the ClusterQueue.
- ClusterQueue checks to see if there are any messages in the internal
FileQueue. If there are any message, then it's sent back to the RemoteQueue
Asynchronous Receive Message Workflow:
- Client Actor registers a JMSListener by invoking
RemoteQueue
's
addListener() API
- RemoteQueue calls
RemoteQueueActor
's readyToreceive() API.
RemoteQueueActor uses BAM (Brokered Agent Messaging) APIs for
communicating with ClusterQueue
- RemoteQueueActor issues
com.caucho.jms.cluster.ReadyToReceiveMessage
to the active server on the triad node.
com.caucho.jms.cluster.ClusterMessageService
on the active
server on the triad node picks up the message and checks to see if there
are any messges in the ClusterQueue.
- ClusterQueue checks to see if there are any messages in the internal
FileQueue. If there are any message, then it's sent back to the RemoteQueue
- RemoteQueue passes the message to JMSListener and once again issues
com.caucho.jms.cluster.ReadyToReceiveMessage
to the active server on the triad node. This process will continue as long
as JMSListener is registered.
It is configured as:
<web-app xmlns="http://caucho.com/ns/resin"
xmlns:jms="urn:java:com.caucho.jms">
<jms:ClusterQueue>
<jms:name>test</jms:name>
</jms:ClusterQueue>
</web-app>