Sessions
A session is a single threaded context for sending and receiving messages.
An application can use a session to create messages, message producers, message consumers, queue browsers, and temporary destinations. An application can also use a session to run local transactions.
An application can create multiple sessions, where each session produces and consumes messages independently of the other sessions. If two message consumers in separate sessions (or even in the same session) subscribe to the same topic, each receives a copy of any message published on that topic.
Unlike a Connection object, a Session object cannot be used concurrently on different threads. Only the Close Session method of a Session object can be called from a thread other than the one that the Session object is using at the time. The Close Session method ends a session and releases any system resources allocated to the session.
If an application must process messages concurrently on more than one thread, the application must create a session on each thread, and then use that session for any send or receive operation within that thread.
- Transacted sessions
XMS applications can run local transactions. A local transaction is a transaction that involves changes only to the resources of the queue manager or service integration bus to which the application is connected.- Message acknowledgment
Every session that is not transacted has an acknowledgment mode that determines how messages received by the application are acknowledged. Three acknowledgment modes are available, and the choice of acknowledgment mode affects the design of the application.- Message delivery
XMS supports persistent and nonpersistent modes of message delivery, and asynchronous and synchronous delivery of messages.Parent topic: Writing XMS applications