You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Rob Godfrey (JIRA)" <ji...@apache.org> on 2014/01/08 23:04:50 UTC

[jira] [Comment Edited] (QPID-5455) [AMQP 1.0 JMS client] Client looses persistent messages violating JMS delivery guarantee

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

Rob Godfrey edited comment on QPID-5455 at 1/8/14 10:02 PM:
------------------------------------------------------------

The patch as supplied didn't actually cause the client to wait for the outcome to come back from the broker, so it would still be async - need to also change the other use of _syncPublish about 20 lines further down.

I've attached a revised patch which addresses this issue.

Ha... and I see while I was tping this up Timothy also published a revised patch for the same issue :-)


was (Author: rgodfrey):
The patch as supplied didn't actually cause the client to wait for the outcome to come back from the broker, so it would still be async - need to also change the other use of _syncPublish about 20 lines further down.

I've attached a revised patch which addresses this issue.

> [AMQP 1.0 JMS client] Client looses persistent messages violating JMS delivery guarantee
> ----------------------------------------------------------------------------------------
>
>                 Key: QPID-5455
>                 URL: https://issues.apache.org/jira/browse/QPID-5455
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Client
>    Affects Versions: 0.26
>         Environment: Java
>            Reporter: Ulrich Romahn
>            Priority: Minor
>         Attachments: QPID-5455_v2.patch, QPID5455-patch.txt, QPID5455-patch.txt
>
>
> I think the client violates the delivery guarantee of JMS with persistent messages.
> Here is my test:
> 1. Start a qpid-cpp broker. Create a persistent queue on that broker
> 2. Start a test Java application using the amqp 1.0 JMS client. The application will write 10,000 persistent messages into the just created queue.
> 3. After some time while the client is still writing messages into the queue, I kill the broker (kill -9 <pid>) simulating the worst disaster scenario
> 4. My client code throws an exception and reports 4,963 messages sent
> 5. After re-starting qpidd, the queue statistics reports only 4,816 messages in the queue!
> Here are some of the relevant code snippets from the client:
> // Creating a Session
> Session session = brokerConn.getConnection().createSession(false, Session.AUTO_ACKNOWLEDGE); // NOTE AUTO_ACKNOWLEGE does not have any effect with nessage producer
> // Create a destination
> Destination dest = session.createQueue(queueName);
> // Creating a MessageProducer
> MessageProducer msgProducer = session.createProducer(dest);
> msgProducer.setDeliveryMode(2); // 2 == persistent
> And then in a loop 1000 times with a random TextMessage I call:
> msgProducer.send(msg);
> So, it looks like the client is sending the message to the broker and the "send(msg)" method returns *before* either the broker acknowledged receiving and persisting the message, or the client does some internal caching.
> By the way, I see the exact same issue when using ActiveMQ 5.9.0 as the broker using the AMQP connector.
> However, it is also possible that the bug is within the proton library on the server side which is being used in both the qpid-cpp broker (proton-c) and ActiveMQ 5.9.0 (proton-j) to support AMQP 1-0.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org