SonicMQ API

progress.message.jclient
Interface Session

All Superinterfaces:
java.lang.Runnable, Session
All Known Subinterfaces:
QueueSession, QueueSession, Session, TopicSession, TopicSession

public interface Session
extends Session

An Implementation of a JMS Session.

A JMS Session is a single threaded context for producing and consuming messages. Although it may allocate provider resources outside the Java virtual machine, it is considered a light-weight JMS object.

A session serves several purposes:

A session can create and service multiple message producers and consumers.

One typical use is to have a thread block on a synchronous MessageConsumer until a message arrives. The thread may then use one or more of the Session's MessageProducers.

Another typical use is to have one thread set up a Session by creating its producers and one or more asynchronous consumers. Since the JMS provider serializes execution of a Session's asynchronous consumers, they can safely share the resources of their session.

If a client desires to have one thread producing messages while others consume them, the client should use a separate Session for its producing thread.

It should be easy for most clients to partition their work naturally into Sessions. This model allows clients to start simply and incrementally add message processing complexity as their need for concurrency grows.

A session may be optionally specified as transacted. Each transacted session supports a single series of transactions. Each transaction groups a set of message sends and a set of message receives into an atomic unit of work. In effect, transactions organize a session's input message stream and output message stream into series of atomic units. When a transaction commits, its atomic unit of input is acknowledged and its associated atomic unit of output is sent. If a transaction rollback is done, its sent messages are destroyed and the session's input is automatically recovered.

The content of a transaction's input and output units is simply those messages that have been produced and consumed within the session's current transaction.

A transaction is completed using either its session's commit or rollback method. The completion of a session's current transaction automatically begins the next. The result is that a transacted session always has a current transaction within which its work is done.

JTS, or some other transaction monitor may be used to combine a session's transaction with transactions on other resources (databases, other JMS sessions, etc.). Since Java distributed transactions are controlled via JTA, use of the session's commit and rollback methods in this context is prohibited.

JMS does not require support for JTA; however, it does define how a provider supplies this support.

Although it is also possible for a JMS client to handle distributed transactions directly, it is unlikely that many JMS clients will do this. Support for JTA in JMS is targeted at systems vendors who will be integrating JMS into their application server products.

Version:
1.0 - December 1998
Author:
Bill Collins, Giovanni Boschi, Jacques Bargiel
See Also:
Session

Field Summary
static int SINGLE_MESSAGE_ACKNOWLEDGE
          If a session is created with the non-JMS SINGLE_MESSAGE_ACKNOWLEDGE mode, the acknowledge() method only acknowledges the message on which it is called.
 
Fields inherited from interface javax.jms.Session
AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, DUPS_OK_ACKNOWLEDGE, SESSION_TRANSACTED
 
Method Summary
 void commit(java.lang.String transactionId)
          Commit all messages done in this transaction and release any locks currently held.
 void commit(java.lang.String transactionId, long lifespan)
          Commit all messages done in this transaction and release any locks currently held.
 QueueBrowser createBrowser(Queue queue)
          Creates a QueueBrowser object to peek at the messages on the specified queue.
 QueueBrowser createBrowser(Queue queue, java.lang.String messageSelector)
          Creates a QueueBrowser object to peek at the messages on the specified queue using a message selector.
 MessageConsumer createConsumer(Destination destination)
          Creates a MessageConsumer for the specified destination.
 MessageConsumer createConsumer(Destination destination, java.lang.String messageSelector)
          Creates a MessageConsumer for the specified destination, using a message selector.
 MessageConsumer createConsumer(Destination destination, java.lang.String messageSelector, boolean NoLocal)
          Creates MessageConsumer for the specified destination, using a message selector.
 TopicSubscriber createDurableSubscriber(Topic topic, java.lang.String name)
          Creates a durable subscriber to the specified topic.
 TopicSubscriber createDurableSubscriber(Topic topic, java.lang.String name, long timeToLive)
          Create a durable Subscriber to the specified topic.
 TopicSubscriber createDurableSubscriber(Topic topic, java.lang.String name, java.lang.String messageSelector, boolean noLocal)
          Creates a durable subscriber to the specified topic, using a message selector and specifying whether messages published by its own connection should be delivered to it.
 TopicSubscriber createDurableSubscriber(Topic topic, java.lang.String name, java.lang.String messageSelector, boolean noLocal, long timeToLive)
          Create a durable Subscriber to the specified topic.
 MultipartMessage createMultipartMessage()
          Create a MultipartMessage.
 MultiTopic createMultiTopic()
          Create an empty MultiTopic This facility is provided for the case in which a client is not able to retrieve a MultiTopic from an administered object store.
 MessageProducer createProducer(Destination destination)
          Creates a MessageProducer to send messages to the specified destination.
 Queue createQueue(java.lang.String queueName)
          Creates a queue identity given a Queue name.
 TemporaryQueue createTemporaryQueue()
          Creates a TemporaryQueue object.
 TemporaryQueue createTemporaryQueue(java.lang.String customID)
          Creates a TemporaryQueue object whose name contains the customID string.
 TemporaryTopic createTemporaryTopic()
          Creates a TemporaryTopic object.
 Topic createTopic(java.lang.String topicName)
          Creates a topic identity given a Topic name.
 XMLMessage createXMLMessage()
          Create a XMLMessage.
 XMLMessage createXMLMessage(org.w3c.dom.Document aDocument)
          Create an XMLMessage initialized by an XML Document.
 XMLMessage createXMLMessage(java.lang.String str)
          Create an XMLMessage initialized by a String.
 int getAcknowledgeMode()
          Returns the acknowledgement mode of the session.
 boolean getDurableMessageOrder()
          Determines whether the option to preserve message order when reconnecting a durable subscriber has been selected.
 int getFlowToDisk()
          Determines the setting of Flow-To-Disk Publishing property.
 boolean getSplitMultiTopicDelivery()
          Gets whether messages with a MultiTopic destination should be delivered as a single message or split apart and delivered as a copy of the message on each topic in the MultiTopic.
 int getTxnBatchSize()
          Returns the amount of information that will be batched on the client.
 void setAckBatchingEnabled(boolean enabled)
          Specifies whether the batching of acknowledgments will be permitted in the session.
 void setDurableMessageOrder(boolean durableSubscriberMessageOrder)
          Enable or disable preservation of message order for reconnecting durable subscribers.
 void setFlowControlDisabled(boolean disabled)
          Disables or reenables publish flow control.
 void setFlowToDisk(int setting)
          Enable or disable Flow-To-Disk Publishing.
 void setSplitMultiTopicDelivery(boolean value)
          Sets whether messages with a MultiTopic destination should be delivered as a single message or split apart and delivered as a copy of the message on each topic in the MultiTopic.
 void setTxnBatchSize(int size)
          Specifies the amount of information to be batched on the client.
 void unsubscribe(java.lang.String name)
          Unsubscribes a durable subscription that has been created by a client.
 
Methods inherited from interface javax.jms.Session
close, commit, createBytesMessage, createMapMessage, createMessage, createObjectMessage, createObjectMessage, createStreamMessage, createTextMessage, createTextMessage, getMessageListener, getTransacted, recover, rollback, run, setMessageListener
 

Field Detail

SINGLE_MESSAGE_ACKNOWLEDGE

static final int SINGLE_MESSAGE_ACKNOWLEDGE
If a session is created with the non-JMS SINGLE_MESSAGE_ACKNOWLEDGE mode, the acknowledge() method only acknowledges the message on which it is called. This is unlike the JMS standard CLIENT_ACKNOWLEDGE mode, in which a call to acknowledge() acknowledges the message on which it is called, and all messages previously received within that session.

See Also:
Constant Field Values
Method Detail

createXMLMessage

XMLMessage createXMLMessage()
                            throws JMSException
Create a XMLMessage. A XMLMessage is used to send a message containing a String representing the XML tree that can be parsed as a XML document.

Throws:
JMSException - if JMS fails to create this message due to some internal error.

createXMLMessage

XMLMessage createXMLMessage(java.lang.String str)
                            throws JMSException
Create an XMLMessage initialized by a String. A XMLMessage is used to send a message containing a String representing the XML tree that can be parsed as a XML document.

Parameters:
str - the string buffer used to initialize this message.
Throws:
JMSException - if JMS fails to create this message due to some internal error.

createXMLMessage

XMLMessage createXMLMessage(org.w3c.dom.Document aDocument)
                            throws JMSException
Create an XMLMessage initialized by an XML Document. A XMLMessage is used to send a message containing a String representing the XML tree that can be parsed as a XML document.

Parameters:
aDocument - The Document (DOM) used to initialize the message.
Throws:
JMSException - if JMS fails to create this message due to some internal error.

createMultipartMessage

MultipartMessage createMultipartMessage()
                                        throws JMSException
Create a MultipartMessage. A MultipartMessage is used to send a message containing a series of Parts. Each part has a Header and a Content. The MultipartMessage as a whole can be a part in a message.

Throws:
JMSException - if JMS fails to create this message due to some internal error.

commit

void commit(java.lang.String transactionId)
            throws JMSException
Commit all messages done in this transaction and release any locks currently held.

Parameters:
transactionId - UUID for duplicate transaction detection
Throws:
JMSException - if JMS implementation fails to commit the the transaction due to some internal error.
TransactionRolledBackException - if the transaction gets rolled back due to some internal error during commit or duplicate UUID.
java.lang.IllegalStateException - if commit() is called on a non-transacted session

commit

void commit(java.lang.String transactionId,
            long lifespan)
            throws JMSException
Commit all messages done in this transaction and release any locks currently held.

Parameters:
transactionId - UUID for duplicate transaction detection
lifespan - length of life of the UUID (in milliseconds)
Throws:
JMSException - if JMS implementation fails to commit the the transaction due to some internal error.
TransactionRolledBackException - if the transaction gets rolled back due to some internal error during commit or duplicate UUID.
java.lang.IllegalStateException - if commit() is called on a non-transacted session

setTxnBatchSize

void setTxnBatchSize(int size)
                     throws JMSException
Specifies the amount of information to be batched on the client. This is a performance optimization utilized on transacted sessions. The size parameter is a measure of the message payloads only.

Parameters:
size - The number of bytes to batch
Throws:
java.lang.IllegalStateException - if called on a non-transacted session
JMSException - if JMS implementation fails set the batch size due some internal error.

getTxnBatchSize

int getTxnBatchSize()
                    throws JMSException
Returns the amount of information that will be batched on the client. This is a performance optimization utilized on transacted sessions. The amount is a measure of the message payloads only.

Returns:
The amount of information that will be batched on the client.
Throws:
JMSException - if JMS implementation fails to get the batch size due some internal error.

setAckBatchingEnabled

void setAckBatchingEnabled(boolean enabled)
                           throws JMSException
Specifies whether the batching of acknowledgments will be permitted in the session.

Parameters:
enabled -
Throws:
JMSException

getAcknowledgeMode

int getAcknowledgeMode()
                       throws JMSException
Returns the acknowledgement mode of the session. The acknowledgement mode is set at the time that the session is created. If the session is transacted, the acknowledgement mode is ignored.

Specified by:
getAcknowledgeMode in interface Session
Returns:
If the session is not transacted, returns the current acknowledgement mode for the session. If the session is transacted, returns SESSION_TRANSACTED.
Throws:
JMSException - if the JMS provider fails to return the acknowledgment mode due to some internal error.
Since:
1.1
See Also:
Connection.createSession(boolean, int)

createProducer

MessageProducer createProducer(Destination destination)
                               throws JMSException
Creates a MessageProducer to send messages to the specified destination.

A client uses a MessageProducer object to send messages to a destination. Since Queue and Topic both inherit from Destination, they can be used in the destination parameter to create a MessageProducer object.

Specified by:
createProducer in interface Session
Parameters:
destination - the Destination to send to, or null if this is a producer which does not have a specified destination.
Throws:
JMSException - if the session fails to create a MessageProducer due to some internal error.
InvalidDestinationException - if an invalid destination is specified.
Since:
1.1

createConsumer

MessageConsumer createConsumer(Destination destination)
                               throws JMSException
Creates a MessageConsumer for the specified destination. Since Queue and Topic both inherit from Destination, they can be used in the destination parameter to create a MessageConsumer.

Specified by:
createConsumer in interface Session
Parameters:
destination - the Destination to access.
Throws:
JMSException - if the session fails to create a consumer due to some internal error.
InvalidDestinationException - if an invalid destination is specified.
Since:
1.1

createConsumer

MessageConsumer createConsumer(Destination destination,
                               java.lang.String messageSelector)
                               throws JMSException
Creates a MessageConsumer for the specified destination, using a message selector. Since Queue and Topic both inherit from Destination, they can be used in the destination parameter to create a MessageConsumer.

A client uses a MessageConsumer object to receive messages that have been sent to a destination.

Specified by:
createConsumer in interface Session
Parameters:
destination - the Destination to access
messageSelector - only messages with properties matching the message selector expression are delivered. A value of null or an empty string indicates that there is no message selector for the message consumer.
Throws:
JMSException - if the session fails to create a MessageConsumer due to some internal error.
InvalidDestinationException - if an invalid destination is specified.
InvalidSelectorException - if the message selector is invalid.
Since:
1.1

createConsumer

MessageConsumer createConsumer(Destination destination,
                               java.lang.String messageSelector,
                               boolean NoLocal)
                               throws JMSException
Creates MessageConsumer for the specified destination, using a message selector. This method can specify whether messages published by its own connection should be delivered to it, if the destination is a topic.

Since Queue and Topic both inherit from Destination, they can be used in the destination parameter to create a MessageConsumer.

A client uses a MessageConsumer object to receive messages that have been published to a destination.

In some cases, a connection may both publish and subscribe to a topic. The consumer NoLocal attribute allows a consumer to inhibit the delivery of messages published by its own connection. The default value for this attribute is False. The noLocal value must be supported by destinations that are topics.

Specified by:
createConsumer in interface Session
Parameters:
destination - the Destination to access
messageSelector - only messages with properties matching the message selector expression are delivered. A value of null or an empty string indicates that there is no message selector for the message consumer.
NoLocal - - if true, and the destination is a topic, inhibits the delivery of messages published by its own connection. The behavior for NoLocal is not specified if the destination is a queue or a shared topic.
Throws:
JMSException - if the session fails to create a MessageConsumer due to some internal error.
InvalidDestinationException - if an invalid destination is specified.
InvalidSelectorException - if the message selector is invalid.
Since:
1.1

createQueue

Queue createQueue(java.lang.String queueName)
                  throws JMSException
Creates a queue identity given a Queue name.

This facility is provided for the rare cases where clients need to dynamically manipulate queue identity. It allows the creation of a queue identity with a provider-specific name. Clients that depend on this ability are not portable.

Note that this method is not for creating the physical queue. The physical creation of queues is an administrative task and is not to be initiated by the JMS API. The one exception is the creation of temporary queues, which is accomplished with the createTemporaryQueue method.

Specified by:
createQueue in interface Session
Parameters:
queueName - the name of this Queue
Returns:
a Queue with the given name
Throws:
JMSException - if the session fails to create a queue due to some internal error.
Since:
1.1

createTopic

Topic createTopic(java.lang.String topicName)
                  throws JMSException
Creates a topic identity given a Topic name.

This facility is provided for the rare cases where clients need to dynamically manipulate topic identity. This allows the creation of a topic identity with a provider-specific name. Clients that depend on this ability are not portable.

Note that this method is not for creating the physical topic. The physical creation of topics is an administrative task and is not to be initiated by the JMS API. The one exception is the creation of temporary topics, which is accomplished with the createTemporaryTopic method.

Specified by:
createTopic in interface Session
Parameters:
topicName - the name of this Topic
Returns:
a Topic with the given name
Throws:
JMSException - if the session fails to create a topic due to some internal error.
Since:
1.1

createMultiTopic

MultiTopic createMultiTopic()
                            throws JMSException
Create an empty MultiTopic

This facility is provided for the case in which a client is not able to retrieve a MultiTopic from an administered object store. Clients that use MultiTopics are not portable

Returns:
an empty MultiTopic
Throws:
JMSException - if a session fails to create a queue due to some JMS error.

createDurableSubscriber

TopicSubscriber createDurableSubscriber(Topic topic,
                                        java.lang.String name)
                                        throws JMSException
Creates a durable subscriber to the specified topic.

If a client needs to receive all the messages published on a topic, including the ones published while the subscriber is inactive, it uses a durable TopicSubscriber. The JMS provider retains a record of this durable subscription and insures that all messages from the topic's publishers are retained until they are acknowledged by this durable subscriber or they have expired.

Sessions with durable subscribers must always provide the same client identifier. In addition, each client must specify a name that uniquely identifies (within client identifier) each durable subscription it creates. Only one session at a time can have a TopicSubscriber for a particular durable subscription.

A client can change an existing durable subscription by creating a durable TopicSubscriber with the same name and a new topic and/or message selector. Changing a durable subscriber is equivalent to unsubscribing (deleting) the old one and creating a new one.

In some cases, a connection may both publish and subscribe to a topic. The subscriber NoLocal attribute allows a subscriber to inhibit the delivery of messages published by its own connection. The default value for this attribute is false.

Specified by:
createDurableSubscriber in interface Session
Parameters:
topic - the non-temporary Topic to subscribe to
name - the name used to identify this subscription
Throws:
JMSException - if the session fails to create a subscriber due to some internal error.
InvalidDestinationException - if an invalid topic is specified.
Since:
1.1

createDurableSubscriber

TopicSubscriber createDurableSubscriber(Topic topic,
                                        java.lang.String name,
                                        java.lang.String messageSelector,
                                        boolean noLocal)
                                        throws JMSException
Creates a durable subscriber to the specified topic, using a message selector and specifying whether messages published by its own connection should be delivered to it.

If a client needs to receive all the messages published on a topic, including the ones published while the subscriber is inactive, it uses a durable TopicSubscriber. The JMS provider retains a record of this durable subscription and insures that all messages from the topic's publishers are retained until they are acknowledged by this durable subscriber or they have expired.

Sessions with durable subscribers must always provide the same client identifier. In addition, each client must specify a name which uniquely identifies (within client identifier) each durable subscription it creates. Only one session at a time can have a TopicSubscriber for a particular durable subscription. An inactive durable subscriber is one that exists but does not currently have a message consumer associated with it.

A client can change an existing durable subscription by creating a durable TopicSubscriber with the same name and a new topic and/or message selector. Changing a durable subscriber is equivalent to unsubscribing (deleting) the old one and creating a new one.

Specified by:
createDurableSubscriber in interface Session
Parameters:
topic - the non-temporary Topic to subscribe to
name - the name used to identify this subscription
messageSelector - only messages with properties matching the message selector expression are delivered. A value of null or an empty string indicates that there is no message selector for the message consumer.
noLocal - if set, inhibits the delivery of messages published by its own connection. The behavior of noLocal is not specified if the destination is a shared topic.
Throws:
JMSException - if the session fails to create a subscriber due to some internal error.
InvalidDestinationException - if an invalid topic is specified.
InvalidSelectorException - if the message selector is invalid.
Since:
1.1

createDurableSubscriber

TopicSubscriber createDurableSubscriber(Topic topic,
                                        java.lang.String name,
                                        long timeToLive)
                                        throws JMSException
Create a durable Subscriber to the specified topic.

Creates a DurableSubscriber with the added ability to specify the timeToLive parameter describer as described below.

Parameters:
topic - the topic to subscribe to
name - the name used to identify this subscription.
timeToLive - time in milliseconds that a DurableSubscriber will live for after it has disconnected. The maximum value for timeToLive is (315360000000L) 10 years NOTE: A timeToLive value <= 0 will result in NOT setting a disconnected timeToLive.
Throws:
JMSException - if a session fails to create a subscriber due to some JMS error.
InvalidDestinationException - if invalid Topic specified.
See Also:
TopicSession, TopicSubscriber

createDurableSubscriber

TopicSubscriber createDurableSubscriber(Topic topic,
                                        java.lang.String name,
                                        java.lang.String messageSelector,
                                        boolean noLocal,
                                        long timeToLive)
                                        throws JMSException
Create a durable Subscriber to the specified topic.

Creates a DurableSubscriber with the added ability to specify the timeToLive parameter describer as described below.

Parameters:
topic - the topic to subscribe to
name - the name used to identify this subscription.
messageSelector - only messages with properties matching the message selector expression are delivered. This value may be null.
noLocal - if set, inhibits the delivery of messages published by its own connection. The behavior of noLocal is not specified if the destination is a shared topic.
timeToLive - time in milliseconds that a DurableSubscriber will live for after it has disconnected. The maximum value for timeToLive is (315360000000L) 10 years NOTE: A timeToLive value <= 0 will result in NOT setting a disconnected timeToLive.
Throws:
JMSException - if a session fails to create a subscriber due to some JMS error or invalid selector.
InvalidDestinationException - if invalid Topic specified.
InvalidSelectorException - if the message selector is invalid.
See Also:
TopicSession, TopicSubscriber

createBrowser

QueueBrowser createBrowser(Queue queue)
                           throws JMSException
Creates a QueueBrowser object to peek at the messages on the specified queue.

Specified by:
createBrowser in interface Session
Parameters:
queue - the queue to access
Throws:
JMSException - if the session fails to create a browser due to some internal error.
InvalidDestinationException - if an invalid destination is specified
Since:
1.1

createBrowser

QueueBrowser createBrowser(Queue queue,
                           java.lang.String messageSelector)
                           throws JMSException
Creates a QueueBrowser object to peek at the messages on the specified queue using a message selector.

Specified by:
createBrowser in interface Session
Parameters:
queue - the queue to access
messageSelector - only messages with properties matching the message selector expression are delivered. A value of null or an empty string indicates that there is no message selector for the message consumer.
Throws:
JMSException - if the session fails to create a browser due to some internal error.
InvalidDestinationException - if an invalid destination is specified
InvalidSelectorException - if the message selector is invalid.
Since:
1.1

createTemporaryTopic

TemporaryTopic createTemporaryTopic()
                                    throws JMSException
Creates a TemporaryTopic object. Its lifetime will be that of the Connection unless it is deleted earlier.

Specified by:
createTemporaryTopic in interface Session
Returns:
a temporary topic identity
Throws:
JMSException - if the session fails to create a temporary topic due to some internal error.
Since:
1.1

createTemporaryQueue

TemporaryQueue createTemporaryQueue()
                                    throws JMSException
Creates a TemporaryQueue object. Its lifetime will be that of the Connection unless it is deleted earlier.

Specified by:
createTemporaryQueue in interface Session
Returns:
a temporary queue identity
Throws:
JMSException - if the session fails to create a temporary queue due to some internal error.
Since:
1.1

createTemporaryQueue

TemporaryQueue createTemporaryQueue(java.lang.String customID)
                                    throws JMSException
Creates a TemporaryQueue object whose name contains the customID string. The name is otherwise constructed internally.

Parameters:
customID - an application supplied string which will be contained somewhere in the temporary queue name
Returns:
a temporary Queue object
Throws:
JMSException

unsubscribe

void unsubscribe(java.lang.String name)
                 throws JMSException
Unsubscribes a durable subscription that has been created by a client.

This method deletes the state being maintained on behalf of the subscriber by its provider.

It is erroneous for a client to delete a durable subscription while there is an active MessageConsumer or TopicSubscriber for the subscription, or while a consumed message is part of a pending transaction or has not been acknowledged in the session.

Specified by:
unsubscribe in interface Session
Parameters:
name - the name used to identify this subscription
Throws:
JMSException - if the session fails to unsubscribe to the durable subscription due to some internal error.
InvalidDestinationException - if an invalid subscription name is specified.
Since:
1.1

setFlowControlDisabled

void setFlowControlDisabled(boolean disabled)
Disables or reenables publish flow control. Note that in order to disable/reenable flow control for XA transaction, this method may be invoked through the XASession instance or the Session instance get from the XASession. For example, XAQueueSession xaSendSession = xaQcon.createXAQueueSession(); QueueSession sendSession = xaSendSession.getQueueSession(); //Disable flow control may be set through xaSendSession as following ((progress.message.jclient.Session) xaSendSession).setFlowControlDisabled(true); //or disable flow control through sendSession as following ((progress.message.jclient.QueueSession) sendSession).setFlowControlDisabled(true); There is no need to set through both the xaSendSession instance and the sendSession instance. If disable flow control is set on both xaSendSession and sendSession, the set through xaSendSession overrides the set through sendSession. The disable flow control set on the xaSendSession take effect immediately. The disable flow control set on the sendSession must be set before XA transaction start.


setDurableMessageOrder

void setDurableMessageOrder(boolean durableSubscriberMessageOrder)
Enable or disable preservation of message order for reconnecting durable subscribers.

Enables

Parameters:
durableSubscriberMessageOrder - if true, by default reconnecting durable subscribers will preserve message order)
See Also:
getDurableMessageOrder()

getDurableMessageOrder

boolean getDurableMessageOrder()
Determines whether the option to preserve message order when reconnecting a durable subscriber has been selected. NOTE: If the value is set at the TopicSession level it has preference over the value set at the TopicConnectionFactory level.

Returns:
If true, a reconnecting durable subscriber will preserve message order across the cluster. If false, a reconnecting durable subscriber will not attempt to preserve message order across the cluster.
See Also:
setDurableMessageOrder(boolean durableSubscriberMessageOrder)

setFlowToDisk

void setFlowToDisk(int setting)
Enable or disable Flow-To-Disk Publishing. If the setting is on, specifies that when a subscriber's in-memory buffer is full the broker should offload the messages for the subscriber to the database without blocking the publisher(s). This must be called before any subscribers are created from the session.

Parameters:
setting - 0 - use broker-side setting 1 - set the feature "on" for the session 2 - set the feature "off" for the session
See Also:
getFlowToDisk(), Constants.FLOW_TO_DISK_USE_BROKER_SETTING, Constants.FLOW_TO_DISK_ON, Constants.FLOW_TO_DISK_OFF

getFlowToDisk

int getFlowToDisk()
Determines the setting of Flow-To-Disk Publishing property.

Returns:
1 - indicates that the feature is "on" for the session 2 - indicates that the feature is "off" for the session 0 - indicates that there is no setting on the client side, thus, the broker-side setting will be used.
See Also:
setFlowToDisk(int), Constants.FLOW_TO_DISK_USE_BROKER_SETTING, Constants.FLOW_TO_DISK_ON, Constants.FLOW_TO_DISK_OFF

setSplitMultiTopicDelivery

void setSplitMultiTopicDelivery(boolean value)
Sets whether messages with a MultiTopic destination should be delivered as a single message or split apart and delivered as a copy of the message on each topic in the MultiTopic. If split delivery is enabled the subscriber can acknowledge the message on each topic. This value is initialized with the value in the connection.

Parameters:
value - Whether or not to split multi topic delivery.

getSplitMultiTopicDelivery

boolean getSplitMultiTopicDelivery()
Gets whether messages with a MultiTopic destination should be delivered as a single message or split apart and delivered as a copy of the message on each topic in the MultiTopic. If split delivery is enabled the subscriber can acknowledge the message on each topic. This value is initialized with the value in the connection.

Returns:
Whether or not to split multi topic delivery.

SonicMQ API

Copyright © 1999-2010 Progress Software Corporation. All Rights Reserved.
HTML formatted on 15-September-2010.