You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by Luba Hornung <lh...@choppertrading.com> on 2011/07/15 01:47:57 UTC

messages get resent after broker is restarted, C++

Why after qpid broker is restarted messages which had been received in a previous session get received again?

1)      I launch a broker, my server and a client.

2)      Server sends messages to clients.

3)      I disconnect broker by Ctrl+c

4)      My client and server wait until I restart the broker again.

5)      The messages that the server had sent in 2) are received by clients again.

After a connection gets broken, I re-open the session and create new senders and receivers with the same addresses.
I am using C++ qpid version 0.6, messaging api.

Server code:

_broadcaster = _session.createSender(Address("acctUpdates/account_updates; {create:always, node-properties;{type:topic, durable:True}, link-properties:{reliability:exactly-once}}"));

...

_bradcaster.send(msg);



Client code:



_recevier = _session.createReceiverr(Address("acctUpdates/account_updates; {create:always, node-properties;{type:topic, durable:True}, link-properties:{reliability:exactly-once}}"));

_receiver.fetch(msg, qpid::sys::TIME_SEC);

_session.acknowledge();

_session.sync(); // does not make a difference if it is used or not





Message.setDurability() or .setTTL() are not even in the header files, although the http://qpid.apache.org/apis/0.6/cpp/html/a00119.html says they exist. "link-properties:{reliability:exactly-once}}" also has no effect.



Qpid-config shows exchange as durable and this is what I want. The queue automatically created on this exchange is not durable and disappears after ctrl+c.





Thank you.

Luba







________________________________
CONFIDENTIALITY WARNING: This email including any attachments may contain privileged or confidential information and is for the sole use of the intended recipient(s). Any unauthorized use or disclosure of this communication is prohibited. This e-mail may also be subject to specific non-disclosure and confidentiality provisions. The information contained herein is the property of Chopper Trading, LLC. If you believe that you have received this email in error, please notify the sender immediately and delete it from your system.

Re: messages get resent after broker is restarted, C++

Posted by Gordon Sim <gs...@redhat.com>.
On 07/15/2011 03:16 PM, Luba Hornung wrote:
> So there is no way to set message Durability in the version 0.6 with messaging API?
> Client API has message.getDeliveryProperties().setTtl() but messaging/Message.h does not have getDeliveryProperties() or setDurability() (mentioned in the api help).

I'd suggest upgrading to the 0.10 release.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


RE: messages get resent after broker is restarted, C++

Posted by Luba Hornung <lh...@choppertrading.com>.
So there is no way to set message Durability in the version 0.6 with messaging API?
Client API has message.getDeliveryProperties().setTtl() but messaging/Message.h does not have getDeliveryProperties() or setDurability() (mentioned in the api help).

-----Original Message-----
From: Gordon Sim [mailto:gsim@redhat.com]
Sent: Friday, July 15, 2011 3:58 AM
To: users@qpid.apache.org
Subject: Re: messages get resent after broker is restarted, C++

On 07/15/2011 12:47 AM, Luba Hornung wrote:
> Why after qpid broker is restarted messages which had been received in a previous session get received again?
>
> 1)      I launch a broker, my server and a client.
>
> 2)      Server sends messages to clients.
>
> 3)      I disconnect broker by Ctrl+c
>
> 4)      My client and server wait until I restart the broker again.
>
> 5)      The messages that the server had sent in 2) are received by clients again.
>
> After a connection gets broken, I re-open the session and create new senders and receivers with the same addresses.
> I am using C++ qpid version 0.6, messaging api.

The exactly-once mode is not yet supported; you will get at-least-once
instead which can result in duplicates.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


CONFIDENTIALITY WARNING: This email including any attachments may contain privileged or confidential information and is for the sole use of the intended recipient(s). Any unauthorized use or disclosure of this communication is prohibited. This e-mail may also be subject to specific non-disclosure and confidentiality provisions.  The information contained herein is the property of Chopper Trading, LLC.  If you believe that you have received this email in error, please notify the sender immediately and delete it from your system.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: messages get resent after broker is restarted, C++

Posted by Gordon Sim <gs...@redhat.com>.
On 07/15/2011 12:47 AM, Luba Hornung wrote:
> Why after qpid broker is restarted messages which had been received in a previous session get received again?
>
> 1)      I launch a broker, my server and a client.
>
> 2)      Server sends messages to clients.
>
> 3)      I disconnect broker by Ctrl+c
>
> 4)      My client and server wait until I restart the broker again.
>
> 5)      The messages that the server had sent in 2) are received by clients again.
>
> After a connection gets broken, I re-open the session and create new senders and receivers with the same addresses.
> I am using C++ qpid version 0.6, messaging api.

The exactly-once mode is not yet supported; you will get at-least-once 
instead which can result in duplicates.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org