JMS Session session = Connection.createsession (parama,paramb) two parameters meanings and differences under different combinations

Source: Internet
Author: User

Session session = Connection.createsession (PARAMA,PARAMB);

Parama is set transaction, PARAMB is set acknowledgment mode

Parama values are:

1. True: Support transactions

When true: The value of PARAMB is ignored, acknowledgment mode is set to session_transacted by the JMS server.

2. False: Transaction not supported

When false: The value of Paramb can be one of Session.auto_acknowledge, Session.client_acknowledge, Dups_ok_acknowledge.

Paramb values are:

1, Session.auto_acknowledge: For automatic confirmation, the client sends and receives the message does not need to do the extra work.

2, Session.client_acknowledge: For the client to confirm. After the client receives the message, the Javax.jms.Message's acknowledge method must be called. The JMS server will not delete the message.

3, Dups_ok_acknowledge: Allow the confirmation mode of the replica. Once a method call from the receiving application returns from the processing message, the Session object confirms the receipt of the message and allows duplicate acknowledgments. This mode is very effective when you need to consider the use of resources.

4, session_transacted

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.