If- destination is a queue or topic with durable subscriber or using FT connection string- subscriber ack mode is AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, or EXPLICIT_CLIENT_ACKNOWLEDGE The flow of data between EMS Server and Subscribe

If- destination is a queue or topic with durable subscriber or using FT connection string- subscriber ack mode is AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, or EXPLICIT_CLIENT_ACKNOWLEDGE The flow of data between EMS Server and Subscribe

book

Article ID: KB0082012

calendar_today

Updated On:

Products Versions
TIBCO Enterprise Message Service -
Not Applicable -

Description

If
- destination is a queue or topic with durable subscriber or using FT connection string
- subscriber ack mode is AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, or EXPLICIT_CLIENT_ACKNOWLEDGE

The flow of data between EMS Server and Subscriber is:
1) Server sends message to subscriber
2) Subscriber sends an ack to the server
3) Server sends a ack-confirm to the subscriber

If flow 3) above fails or is delayed (perhaps due to a network connection) what would happen internally?
 

Issue/Introduction

If- destination is a queue or topic with durable subscriber or using FT connection string- subscriber ack mode is AUTO_ACKNOWLEDGE, CLIENT_ACKNOWLEDGE, or EXPLICIT_CLIENT_ACKNOWLEDGE The flow of data between EMS Server and Subscriber is:1) Server sends message to subscriber2) Subscriber sends an ack to the server3) Server sends a ack-confirm to the subscriber If flow 3) above fails or is delayed (perhaps due to a network connection) what would happen internally?

Environment

all

Resolution

1. If synchronous message delivery is in use, In the JMS1.1 SPEC, it says:
javax.jms
Interface MessageConsumer
public Message receive()
                throws JMSException

Receives the next message produced for this message consumer.  This call blocks indefinitely until a message is produced or until this message
consumer is closed. If this receive is done within a transaction, the consumer retains the message until the transaction commits.

public Message receive(long timeout)
                throws JMSException

Receives the next message that arrives within the specified timeout interval.  This call blocks until a message arrives, the timeout expires, or this message consumer is closed. A timeout of zero never expires, and the call blocks indefinitely.

Parameters:
timeout - the timeout value (in milliseconds)

If you are not using timeout in your receive(), and receive will not return, until the ack-confirmed is received. If due to network problem, the connection is destroyed, with java/.NET API, an exception will be thrown, and no message is received; with C API, an error status code will be return, and no message is received.


2) If asynchronous message delivery is in use, from the JMS 1.1 SPEC, it says:

javax.jms
Interface MessageListener

public interface MessageListener

A MessageListener object is used to receive asynchronously delivered messages.  Each session must insure that it passes messages serially to
the listener. This means that a listener assigned to one or more consumers of the same session can assume that the onMessage method is
not called with the next message until the session has completed the last call.

If the ack-confirmed is not received, the next onMessage method is not be called. However, client receives the message.