A session is a single threaded context for sending and receiving messages.
For a list of the XMS defined properties of a Session, see Properties of Session.
Function | Description |
---|---|
xmsSessClose | Close the session. |
xmsSessCommit | Commit all messages processed in the current transaction. |
xmsSessCreateBrowser | Create a queue browser for the specified queue. |
xmsSessCreateBrowserSelector | Create a queue browser for the specified queue using a message selector. |
xmsSessCreateBytesMessage | Create a bytes message. |
xmsSessCreateConsumer | Create a message consumer for the specified destination. |
xmsSessCreateConsumerSelector | Create a message consumer for the specified destination using a message selector. |
xmsSessCreateConsumerSelectorLocal | Create a message consumer for the specified destination using a message selector and, if the destination is a topic, specifying whether the message consumer receives the messages published by its own connection. |
xmsSessCreateDurableSubscriber | Create a durable subscriber for the specified topic. |
xmsSessCreateDurableSubscriberSelector | Create a durable subscriber for the specified topic using a message selector and specifying whether the durable subscriber receives the messages published by its own connection. |
xmsSessCreateMapMessage | Create a map message. |
xmsSessCreateMessage | Create a message that has no body. |
xmsSessCreateObjectMessage | Create an object message. |
xmsSessCreateProducer | Create a message producer to send messages to the specified destination. |
xmsSessCreateStreamMessage | Create a stream message. |
xmsSessCreateTextMessage | Create a text message with an empty body. |
xmsSessCreateTextMessageInit | Create a text message whose body is initialized with the specified text. |
xmsSessGetAcknowledgeMode | Get the acknowledgement mode for the session. |
xmsSessGetTransacted | Determine whether the session is transacted. |
xmsSessRecover | Recover the session. |
xmsSessRollback | Rollback all messages processed in the current transaction. |
xmsSessUnsubscribe | Delete a durable subscription. |
xmsRC xmsSessClose(xmsHSess *session, xmsHErrorBlock errorBlock);
Close the session. If the session is transacted, any transaction in progress is rolled back.
All objects dependent on the session are deleted. For information about which objects are deleted, see Deleting objects.
If an application tries to close a session that is already closed, the call is ignored.
xmsRC xmsSessCommit(xmsHSess session, xmsHErrorBlock errorBlock);
Commit all messages processed in the current transaction.
xmsRC xmsSessCreateBrowser(xmsHSess session, xmsHDest queue, xmsHQueueBrowser *browser xmsHErrorBlock errorBlock);
Create a queue browser for the specified queue.
xmsRC xmsSessCreateBrowserSelector(xmsHSess session, xmsHDest queue, xmsCHAR *messageSelector, xmsINT length, xmsHQueueBrowser *browser xmsHErrorBlock errorBlock);
Create a queue browser for the specified queue using a message selector.
A value of null or an empty string means that there is no message selector for the queue browser.
xmsRC xmsSessCreateBytesMessage(xmsHSess session, xmsHMsg *message, xmsHErrorBlock errorBlock);
xmsRC xmsSessCreateConsumer(xmsHSess session, xmsHDest destination, xmsHMsgConsumer *consumer, xmsHErrorBlock errorBlock);
Create a message consumer for the specified destination.
xmsRC xmsSessCreateConsumerSelector(xmsHSess session, xmsHDest destination, xmsCHAR *messageSelector, xmsINT length, xmsHMsgConsumer *consumer, xmsHErrorBlock errorBlock);
Create a message consumer for the specified destination using a message selector.
A value of null or an empty string means that there is no message selector for the message consumer.
xmsRC xmsSessCreateConsumerSelectorLocal(xmsHSess session, xmsHDest destination, xmsCHAR *messageSelector, xmsINT length, xmsBOOL noLocal, xmsHMsgConsumer *consumer, xmsHErrorBlock errorBlock);
Create a message consumer for the specified destination using a message selector and, if the destination is a topic, specifying whether the message consumer receives the messages published by its own connection.
A value of null or an empty string means that there is no message selector for the message consumer.
xmsRC xmsSessCreateDurableSubscriber(xmsHSess session, xmsHDest topic, xmsCHAR *subscriptionName xmsHMsgConsumer *subscriber, xmsHErrorBlock errorBlock);
Create a durable subscriber for the specified topic.
This function is not valid for a real-time connection to a broker.
For more information about durable subscribers, see Durable subscribers.
xmsRC xmsSessCreateDurableSubscriberSelector(xmsHSess session, xmsHDest topic, xmsCHAR *subscriptionName xmsCHAR *messageSelector, xmsINT length, xmsBOOL noLocal, xmsHMsgConsumer *subscriber, xmsHErrorBlock errorBlock);
Create a durable subscriber for the specified topic using a message selector and specifying whether the durable subscriber receives the messages published by its own connection.
This function is not valid for a real-time connection to a broker.
For more information about durable subscribers, see Durable subscribers.
A value of null or an empty string means that there is no message selector for the durable subscriber.
xmsRC xmsSessCreateMapMessage(xmsHSess session, xmsHMsg *message, xmsHErrorBlock errorBlock);
xmsRC xmsSessCreateMessage(xmsHSess session, xmsHMsg *message, xmsHErrorBlock errorBlock);
Create a message that has no body.
xmsRC xmsSessCreateObjectMessage(xmsHSess session, xmsHMsg *message, xmsHErrorBlock errorBlock);
xmsRC xmsSessCreateProducer(xmsHSess session, xmsHDest destination, xmsHMsgProducer *producer, xmsHErrorBlock errorBlock);
Create a message producer to send messages to the specified destination.
If you specify a null handle, the message producer is created without a destination. In this case, the application must specify a destination every time it uses the message producer to send a message.
xmsRC xmsSessCreateStreamMessage(xmsHSess session, xmsHMsg *message, xmsHErrorBlock errorBlock);
xmsRC xmsSessCreateTextMessage(xmsHSess session, xmsHMsg *message, xmsHErrorBlock errorBlock);
Create a text message with an empty body.
xmsRC xmsSessCreateTextMessageInit(xmsHSess session, xmsCHAR *text xmsINT length xmsHMsg *message, xmsHErrorBlock errorBlock);
Create a text message whose body is initialized with the specified text.
xmsRC xmsSessGetAcknowledgeMode(xmsHSess session, xmsINT *acknowledgeMode, xmsHErrorBlock errorBlock);
Get the acknowledgement mode for the session. The acknowledgement mode is specified when the session is created.
A session that is transacted has no acknowledgement mode.
For more information about acknowledgement modes, see Acknowledging the receipt of messages in a session.
xmsRC xmsSessGetTransacted(xmsHSess session, xmsBOOL *transacted, xmsHErrorBlock errorBlock);
Determine whether the session is transacted.
For a real-time connection to a broker, the value is always xmsFALSE.
xmsRC xmsSessRecover(xmsHSess session, xmsHErrorBlock errorBlock);
Recover the session. Message delivery is stopped and then restarted with the oldest unacknowledged message.
The session must not be a transacted session.
For more information about recovering a session, see Acknowledging the receipt of messages in a session.
xmsRC xmsSessRollback(xmsHSess session, xmsHErrorBlock errorBlock);
Rollback all messages processed in the current transaction.
xmsRC xmsSessUnsubscribe(xmsHSess session, xmsCHAR *subscriptionName, xmsHErrorBlock errorBlock);
Delete a durable subscription. The messaging server deletes the record of the durable subscription that it is maintaining and does not send any more messages to the durable subscriber.
This function is not valid for a real-time connection to a broker.