Does ActiveMQ provide message delivery?

When we use ActiveMQ

how much we can trust the reliability of the server ActiveMQ

. For example, in non-real-time software development (no need to send data instantly, but it needs to be sent). Can we be trusted ActiveMQ

as a reliable source that confirms the delivery of messages. For example, I am sending an xml file from the manufacturer. submit this file to your ActiveMQ

verified ActiveMQ shipment. Then can I trust ActiveMQ

and delete the local copy of the xml?

edits

When the message reaches the ActiveMQ server, it is reliable. How can we make sure that the link to the manufacturer's server is reliable. In case the manufacturer is a Java Java application. how the ActiveMQ client handles these scripts

  • force termination of the application while preparing data for submission.
  • network failure while sending message.

enter image description here

+3


source to share


3 answers


If you are submitting a transaction and persistent delivery to ActiveMQ (pretty much the default if you are migrating to JMS) and the transaction completed successfully - yes. ActiveMQ then provisioned the message to persistent storage (usually disk).



Then, of course, the disk might crash and human errors and earthquakes might hit you, but otherwise the message is fine.

+3


source


ActiveMQ is tied to the JMS specification, which requires the default JMS provider to guarantee the delivery of "persistent" messages. This guarantee is indeed very efficient because the broker must securely store the message in its message store before confirming the message to the manufacturer. This guarantee does not require a local JMS transaction, but it can be used to send messages to the broker, which is one way to overcome high performance.



+2


source


I would suggest that the Producer cannot refuse the XML message until the Client confirms that he received the message. It is not sufficient to simply confirm that it was received by the ActiveMQ Server, as the message does not matter until the Client has received it.

So for that purpose, I would find some sort of confirmation of getting a good approach. A simplified system might work like this:

Initial setup

First, create two topics: Messages and Receipt Messages.

Then set up Producer to publish to the post subject and subscribe to the "receipt messages" topic. The producer should also be able to maintain a list of all messages sent, but not yet confirmed.

In addition, your client will subscribe to the topic "messages" and publish in the topic "messages-receipts".

Posting messages

To publish a message, the Producer will first generate an XML message and provide it with a unique identifier that can identify the message. He will then post it to the post subject.

The client will then see the message in the message subject. Then it should unfold and post a "receipt-messages" response, which will contain the identifier of the received message.

Finally, the Producer will see the "Receipt Messages" message and can confirm that the message has been sent by comparing the Message Receipt ID with a list of unacknowledged messages. After confirmation, the message is removed from the "sent but not yet verified" list.

Processing of not received messages

The producer can send a message if no receipt has been received for a period of time.

0


source







All Articles