JMS specifications and message characteristics (two)

Message queue comparison

Insert picture description here

Sign for the message

There are three types of non-transactional receipts

1) Automatically sign for Session.AUTO_ACKNOWLEDGE
2) Manually sign for Session.CLIENT_ACKNOWLEDGE
3) Allow repeated messages Session.DUPS_OK_ACKNOWLEDGE? ? ? I did not verify this.
Insert picture description here
For the producer, if the transaction is opened, the sign-off mechanism can be chosen at will. The priority of the transaction is higher than the sign-off mechanism.
Verification 1: The producer does not open the transaction and sends the message to the server by means of automatic sign-off.
Consumers use manual signing and find that the message can be re-consumed.
The message is sent to the server, the consumer program is run, and the message is not consumed
Insert picture description here

Insert picture description here
After the message signing mechanism is turned on, the message cannot be consumed repeatedly
Insert picture description here

Sign receipt in transaction mode

The producer opens the transaction, the sign-off mode is automatic sign-off, and the message is sent to the server
Insert picture description here

Insert picture description here

The consumer starts the transaction and uses the manual sign-off mode, but the message does not use the ack mechanism.
The message is still consumed
Insert picture description here
Insert picture description hereInsert picture description here

Verification: The
producer opens the transaction, the sign-off mode is automatic sign, and sends the message to the server; the
consumer opens the transaction, uses the manual sign-off mode, and the message uses the ack mechanism. But there is no commit. Messages can be repeatedly consumed Insert picture description here
Insert picture description here
Conclusion:
In a transactional session, when a transaction is successfully submitted, the message is automatically signed. If the transaction rolls back, the message will be sent again.
In a non-transactional conversation, when the message is confirmed depends on the acknowledgement mode when the conversation is created (acknowledgement)

Guess you like

Origin blog.csdn.net/weixin_39472101/article/details/115263978