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