[TIBCO.EMS .NET client library 6.0 documentation]

Acknowledges all consumed messages of the session of this consumed message.

Namespace:  TIBCO.EMS
Assembly:  TIBCO.EMS (in TIBCO.EMS.dll)

Syntax

public virtual void Acknowledge()
Public Overridable Sub Acknowledge
public:
virtual void Acknowledge()

Remarks

The behavior of this call depends on the acknowledgement mode of the Session.

All consumed messages support the acknowledge method for use when a client has specified that its session's consumed messages are to be explicitly acknowledged. By invoking acknowledge on a consumed message, a client acknowledges all messages consumed by the session to which the message was delivered.

Calls to acknowledge are ignored for both transacted sessions and sessions specified to use implicit acknowledgement modes.

A client may individually acknowledge each message as it is consumed, or it may choose to acknowledge messages as an application-defined group (which is done by calling acknowledge on the last received message of the group, thereby acknowledging all messages consumed by the session.)

Specifically:
  • In ClientAcknowledge mode, this call acknowledges all messages that the program has consumed within the session. (This behavior complies with the JMS specification.)
  • In ExplicitClientAcknowledge mode, this call acknowledges only the individual message. (This mode and behavior are proprietary extensions, specific to TIBCO EMS.)
  • In ExplicitClientDupsOkAcknowledge mode, this call lazily acknowledges only the individual message. Lazy means that the provider client library can delay transferring the acknowledgement to the server until a convenient time; meanwhile the server might redeliver the message. (This mode and behavior are proprietary extensions, specific to TIBCO EMS.)
  • In all other modes, this call has no effect. In particular, modes that specify transactions or implicit acknowledgement do not require the consuming program to call this method. However, calling it does not produce an exception. (This behavior complies with the JMS specification.)

Consumed

Three events mark a message as consumed—that is, eligible for acknowledgment using this method:

  • Just before the provider raises an EMSMessageHandler event, it marks the message argument as consumed.
  • Just before the provider calls an IMessageListener.OnMessage callback, it marks the message argument as consumed.
  • Just before a receive call returns a message, it marks that message as consumed.

Redelivery

Messages that have been received but not acknowledged may be redelivered.

Exceptions

ExceptionCondition
TIBCO.EMS..::.IllegalStateExceptionif this method is called on a closed session

See Also