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 <[email protected]> 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 <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, 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: [email protected] > For additional commands, e-mail: [email protected] > >
