Return-Path: X-Original-To: apmail-qpid-users-archive@www.apache.org Delivered-To: apmail-qpid-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4704A10D5F for ; Wed, 8 Jan 2014 18:57:30 +0000 (UTC) Received: (qmail 7989 invoked by uid 500); 8 Jan 2014 18:56:08 -0000 Delivered-To: apmail-qpid-users-archive@qpid.apache.org Received: (qmail 7884 invoked by uid 500); 8 Jan 2014 18:56:04 -0000 Mailing-List: contact users-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@qpid.apache.org Delivered-To: mailing list users@qpid.apache.org Received: (qmail 7758 invoked by uid 99); 8 Jan 2014 18:55:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Jan 2014 18:55:55 +0000 X-ASF-Spam-Status: No, hits=2.8 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of rob.j.godfrey@gmail.com designates 209.85.216.51 as permitted sender) Received: from [209.85.216.51] (HELO mail-qa0-f51.google.com) (209.85.216.51) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Jan 2014 18:55:49 +0000 Received: by mail-qa0-f51.google.com with SMTP id i13so2099563qae.24 for ; Wed, 08 Jan 2014 10:55:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=9sVKlSYWer1r5+KoCfG1zYHo2MeMrlusxR++Gd1wExA=; b=lchlGIzCnQputfS0YBrHWpOaCe+tKVmapd1xUfHmoFcSFQeZbFgrt9I452svEduywN +ivq2c/yeFqHwL3AAZy0aJQiFsXN4aGfWbU/vfpRgU3vBJ5QWOUL1ycHbitefThs5Qxb ySc60tsZ02saZipxBa+1/G+XFClV0wd6RhTrq/iAVJ2Cp2JjPxcrCoBC5iBqWf3QFAMD rb8RPJz78p9vMf8AhiLJsIY5ZQG0822M7MhX3zFwuUVkoyJfHO0U/JePpRT3KrutRswS jS5AbNWXTeshDW8Y6iqVOc4YpA9WywMl+D9rfjGqqWE4tfO9gM2M74NTe+YkCs64vBiq EYKA== MIME-Version: 1.0 X-Received: by 10.49.70.131 with SMTP id m3mr24015733qeu.59.1389207328430; Wed, 08 Jan 2014 10:55:28 -0800 (PST) Received: by 10.140.85.5 with HTTP; Wed, 8 Jan 2014 10:55:28 -0800 (PST) In-Reply-To: <1389206288382-7602408.post@n2.nabble.com> References: <1389206288382-7602408.post@n2.nabble.com> Date: Wed, 8 Jan 2014 19:55:28 +0100 Message-ID: Subject: Re: Serious Bug in AMQP 1.0 JMS Client with persistent messages From: Rob Godfrey To: "users@qpid.apache.org" Content-Type: multipart/alternative; boundary=047d7b2e54be54babf04ef7a090e X-Virus-Checked: Checked by ClamAV on apache.org --047d7b2e54be54babf04ef7a090e Content-Type: text/plain; charset=ISO-8859-1 Hi Uli, To enable synchronous publishing you need to either set the Java system property "qpid.sync_publish" to true, or have sync-publish=true as one of the URL options in your connection URL. I agree it should be the default, and we can look to change this in a future release. -- Rob On 8 January 2014 19:38, uromahn wrote: > I believe I found a serious bug in the current (latest version from source) > qpid-amqp-1-0-client-jms library. > > 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 ) 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, as you can see, nothing special here. > > 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. > > I already created a JIRA to report this potential bug: > https://issues.apache.org/jira/browse/QPID-5455 > > > > > -- > View this message in context: > http://qpid.2158936.n2.nabble.com/Serious-Bug-in-AMQP-1-0-JMS-Client-with-persistent-messages-tp7602408.html > Sent from the Apache Qpid users mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org > For additional commands, e-mail: users-help@qpid.apache.org > > --047d7b2e54be54babf04ef7a090e--