[ 
https://issues.apache.org/jira/browse/QPID-1677?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12676330#action_12676330
 ] 

Rajith Attapattu commented on QPID-1677:
----------------------------------------

I realized my argument about exactly-once semantics are wrong here (Thanks 
Gordon for pointing it out).
There is always the possibility of the last message being duplicated as the 
broker could crash  before us sending the ack for the last message.
Unless we build an idempotency barrier on the JMS client it is not possible to 
provide exactly-once semantics.

In fact the JMS spec is fine with the last message being redelivered.
"When a client uses the AUTO_ACKNOWLEDGE mode, it is not in direct
control of message acknowledgment. Since such clients cannot know for
certain if a particular message has been acknowledged, they must be prepared
for redelivery of the last consumed message. This can be caused by the client
completing its work just prior to a failure that prevents the message
acknowledgment from occurring. Only a session's last consumed message is
subject to this ambiguity."

Also the spec does not say anything about the publish side.
The sync on publish could also duplicate the last message as the broker could 
receive the message replicate it across the cluster and then crash before 
acknowleding.
So while syc_publish will reduce the duplicate messages to 1 for a publisher it 
doesn't eliminate it.

> Provide the ability to publish synchronously
> --------------------------------------------
>
>                 Key: QPID-1677
>                 URL: https://issues.apache.org/jira/browse/QPID-1677
>             Project: Qpid
>          Issue Type: Improvement
>          Components: Java Client
>    Affects Versions: M4
>            Reporter: Rajith Attapattu
>            Assignee: Rajith Attapattu
>             Fix For: M5
>
>
> In order for the producer to not replay the messages again (during failover) 
> and prevent duplicates,we need a way for the JMS client to sync on every 
> publish. 
> To faciliate this, I have propose a System/Connection URLproperty called 
> sync_publish={persistent|all} which supercedes sync_persistent.
> (sync_persistent is deprecated but supported for a few releases with a 
> warning printed if used).
> In order to provide exactly-once semantics between a single JMS 
> publisher-consumer pair (when using AUTO_ACK on the consumer) we need to 
> publish synchronously and ack synchronously (QPID-1106).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to