Highly Available MDB in HornetQ Cluster

Solution Verified - Updated -

Issue

  • Need to send messages between Java programs on several different machines at two different sites. For discussion, say there is machine A, at one site, sending messages to the other site. Either machine C or machine D, at that site, will be consuming messages. It would be nice to not require A to know who is consuming the messages, so it can just send them out and know they will get to the right destination.

  • Producer (A) is sending messages and one consumer (C or D) will be looking up to the same queue. (A) can just throw the messages into a queue on its local server and they will automatically go to whichever other server has a consumer for that queue at the moment. Let's say that C is the consumer. After it has consumed some messages, it goes offline and D forms a consumer connection to the queue on the cluster. Then any leftover messages already in the queue and any future messages generated by A will be consumed by D. C and D will coordinate by means outside the cluster to decide which one should have a consumer connection open at any given moment.

  • Can the below behaviour be expected from HornetQ:

    1. Automatically move messages from the queue on the server where they are produced to the queue on the server where there is a consumer at the moment.
    2. After one consumer closes its connection and another consumer connects, migrate any leftover messages to the new consumer.
    3. Guarantee once-and-only-once delivery of the messages. That is, each produced message will eventually be consumed exactly once, by one consumer, and not by any others.

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 5.1.2
    • 5.2

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.