NO_ACKNOWLEDGE

public static final int NO_ACKNOWLEDGE

No acknowledge is required.

Messages sent to a NO_ACKNOWLEDGE session are immediately deleted
from the server. Messages received in this mode are not
recovered, and as a result messages may be lost and/or a duplicate
message may be delivered if an initial attempt to deliver a message fails.

This mode is supported for applications that do not require the
quality of service provided by session acknowledge, and that do not
want to incur the associated overhead.

You should avoid using this mode if your application cannot handle
duplicate messages.

MULTICAST_NO_ACKNOWLEDGE

public static final int MULTICAST_NO_ACKNOWLEDGE

Multicast mode with no acknowledge required.

Messages sent to a MULTICAST_NO_ACKNOWLEDGE session share the same
characteristics as NO_ACKNOWLEDGE mode.

This mode is supported for applications that want to support
multicasting, and that do not require the quality of service
provided by session acknowledge.

You should avoid using this mode if your application is unable to handle
duplicate messages, which can occur if a message fails to be delivered
during the first attempt.

KEEP_OLD

public static final int KEEP_OLD

Multicast overrun policy specifying that the oldest messages should
be saved and the most
recent ones discarded, as needed, so as not to exceed the message maximum.

KEEP_NEW

public static final int KEEP_NEW

Multicast overrun policy specifying that the most recent messages
should be saved and the oldest
ones discarded, as needed, so as not to exceed the message maximum.

setExceptionListener

If a JMS provider detects a serious problem with a session, it
will inform the session's exception listener, if one has been registered.
It informs the exception listener by calling the listener's
onException() method and passing a JMSException describing the problem.

The exception listener allows a client to be asynchronously notified
of a problem. Some sessions only consume messages, so they would have
no other way to learn that the session has failed.

A session serializes execution of its exception listener.

A JMS provider should attempt to resolve session problems
prior to notifying the client.

Parameters:

exceptionListener - The exception listener.

Throws:

javax.jms.JMSException - general exception
if JMS implementation fails to set the exception listener for this session.

getMessagesMaximum

public int getMessagesMaximum()
throws javax.jms.JMSException

Get the maximum number of messages that may exist for
an asynchronous session, which have not yet been passed to the message
listener.

A value of -1 indicates that there is no limit on the number
of messages. In this case, however, the limit is set to the amount
of remaining virtual memory.

setMessagesMaximum

Set the maximum number of messages that may exist for
an asynchronous session, which have not yet been passed to the message
listener.

A value of -1 indicates that there is no limit on the number
of messages. In this case, however, the limit is set to the amount
of remaining virtual memory.

When the number of messages reaches the specified value,
the following occurs:

For multicast sessions, new messages are discarded
according to the specified overrun policy, and
a DataOverrunException is thrown.

For non-multicast sessions, new messages are flow-controlled,
or retained on the server until the application can accomodate the
messages.

For multicast sessions, when a connection is stopped,
messages will continue to be delivered, but only until the
specified maximum value is reached. Once this value is reached,
messages will be discarded based on the overrun policy.

Parameters:

messagesMaximum - The maximum number of messages allowed,
valid values are -1, and 1 through 2^63-1 (default is 10).

getRedeliveryDelay

public long getRedeliveryDelay()
throws javax.jms.JMSException

Get the redelivery delay for this session; this defines
the delay in milliseconds before rolled back or recovered
messages are redelivered.
The default redelivery delay is obtained from
the configuration of the connection
factory used to create this consumer. If the time to
deliver on the session is explicitly set to -1
via WLSession.setRedliveryDelay(), then
this method will return the connection factory setting;
if it is set to any other value, then this method
will return that value.

setRedeliveryDelay

Set the redelivery delay for this consumer; this defines
the delay in milliseconds before rolled back or recovered
messages are redelivered.
The default redeliver delay is 0; this default may be changed
by modifying the configuration of the connection
factory used to create this consumer. Setting the redelivery
delay to -1 forces the use of this default. Setting it
to anything greater than or equal to 0 overrides this
default. If this method is not called, then the connection
factory setting is used.

Performance Note: If any consumers for remote destinations
already exist on this session,
calling this method results in a network call(s) in order to disseminate
the changed delay value to them.

Parameters:

redeliveryDelay - Redelivery delay for this session.

Throws:

javax.jms.JMSException - if a JMS error occurs.

See Also:

#getTimeToDeliver()

acknowledge

public void acknowledge()
throws javax.jms.JMSException

Acknowledge all the messages received by this session. This
is similar to the method Message.acknowledge(), except it can
be called from the session.
This is for users who set their connection factory AcknowledgePolicy
to "Previous" so they may acknowledge "All" messages received by
this session.