You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by "Rahul.Singh5@morganstanley.com" <Ra...@morganstanley.com> on 2022/03/31 08:29:59 UTC

QPID C++ Queue handling

Hel
We are using C++ API - qpid-cpp-1.39.0 and qpid-proton-0.34.0 and seems to have an issue handling multiple instances of application (using different implementations).
The broker supplies all messages to our entity in 1 Response Queue and there are uniqueAPPId to identify the messages received in Response Queue.

However, at times, only 1 instance seems to get these messages. We suspect it's the way we retrieve the messages from the queue. Our current logic is
Using namespace qpid::messaging;
Message msg;
If(Receiver::fetch (msg, Duration(0)))
{
        //process the message if unqiueAppId is ours

        //Acknowledge the message
       Session::acknowledge(msg);
}

Is this the correct way of handling the messages form Response Queue?


  1.  We had a look at description for Receiver::get() and it indicates that the message is retrieved from the Receiver's local Queue.
For Receiver::fetch(), the description says "Retrieves the message from Receiver's Subscription. Unlike get(), this message will check with the server that there is no message for the subscription this
Receiver is serving before returning false. Is the Receiver::fetch method popping the message off the Response Queue as opposed to Receiver::get () method.

  1.  Whats the purpose of Session::acknowledge(msg) ? Does it pop the message off the Response Queue.

We want to only pull the message off the queue which are destined to our instance. Otherwise, we don't want to remove them since this might affect other instances.

Please can you help in throwing some light on how to get this logic right.

Best Regards,
Rahul

________________________________
NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent required and/or permitted under applicable law, to monitor electronic communications, including telephone calls with Morgan Stanley personnel. This message is subject to the Morgan Stanley General Disclaimers available at the following link: http://www.morganstanley.com/disclaimers.  If you cannot access the links, please notify us by reply message and we will send the contents to you. By communicating with Morgan Stanley you acknowledge that you have read, understand and consent, (where applicable), to the foregoing and the Morgan Stanley General Disclaimers.

You may have certain rights regarding the information that Morgan Stanley collects about you. Please see our Privacy Pledge https://www.morganstanley.com/privacy-pledge for more information about your rights.

Re: QPID C++ Queue handling

Posted by Robbie Gemmell <ro...@gmail.com>.
If the consumers aren't sharing a subscription then other consumers
wont be affected, as they would each get their own copies of all the
messages on the topic.

On Thu, 31 Mar 2022 at 16:43, Rahul.Singh5@morganstanley.com
<Ra...@morganstanley.com> wrote:
>
> OK, I will have a look.
> Out of curiosity, does the same behavior apply to Topics as well. We now know that on queues, we need to either ack or release it. Topics are used to provide broadcasts and I was wondering if the same applies to it. Broadcasts never come with uniqueAppID since these are unsolicited.  Hence, selector logic wont apply to it anyways. So, if I ack the message, will that mean other instances might not receive them?
> I noticed that (as you rightly pointed), releasing them brings it back to out receiver many times which is not ideal.
>
> Best Regards,
> Rahul
>
> -----Original Message-----
> From: Robbie Gemmell <ro...@gmail.com>
> Sent: 31 March 2022 16:33
> To: users <us...@qpid.apache.org>
> Subject: Re: QPID C++ Queue handling
>
>  Its hard to say much without knowing exactly what you did, the linked thread has a few different things in it.
>
> The error suggests you are using Artemis and it is trying (and failing due to permissions) to create an Address, which I wouldnt really expect if you are consuming from an already known response queue, one that I would assume already existed.
>
> You might need to ensure the broker actually treats the things as being an 'anycast' queue and treats the consumer as a regular queue consumer, as I know Artemis typically defaults to treating things as 'multicast' for more topic-like behaviour, which might be a problematic if you have different consumers with different selectors.
> You can do that either by ensuring the address+queue definition is anycat, or changing the broker side address settings [1][2] so anything auto-created is considered 'anycast', or you could alternatively add a 'queue' type hint into the consumer by setting the type option into the consumer address string when creating the receiver (from other threads I think "my-queue; { node:{ type: queue }}" is the format of that).
>
> [1] https://activemq.apache.org/components/artemis/documentation/latest/address-model.html
> [2] https://activemq.apache.org/components/artemis/documentation/latest/address-settings.html
>
>
>
> On Thu, 31 Mar 2022 at 13:47, Rahul.Singh5@morganstanley.com <Ra...@morganstanley.com> wrote:
> >
> > Many thanks Gordon. I tried using the selector while creating the
> > Receiver for response queue (as per the example given
> > https://lists.apache.org/thread/95ozl3hxf0cqzt0nxgbvwroddx39kq1w)
> > However, I get below exception -
> > std::exception Link detached by peer with amqp:unauthorized-access: AMQ119015: not authorized to create consumer, AMQ229032: User: FOOBAR does not have permission='CREATE_ADDRESS' on address 'XXXXX.ResQueue_L'
> >
> > Best Regards,
> > Rahul
> >
> > -----Original Message-----
> > From: Gordon Sim <gs...@redhat.com>
> > Sent: 31 March 2022 12:06
> > To: users@qpid.apache.org
> > Subject: Re: QPID C++ Queue handling
> >
> > On Thu, Mar 31, 2022 at 11:30 AM Rahul.Singh5@morganstanley.com <Ra...@morganstanley.com> wrote:
> > > 2) For the longer term/better solution, I will start looking into selector. Is this within qpid C++ or proton layer. Any quick pointer will be highly appreciated.
> >
> > For proton C++:
> > https://github.com/apache/qpid-proton/blob/main/cpp/examples/selected_
> > recv.cpp
> >
> > For example with the old qpid::messaging API see e.g.
> > https://lists.apache.org/thread/95ozl3hxf0cqzt0nxgbvwroddx39kq1w
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For
> > additional commands, e-mail: users-help@qpid.apache.org
> >
> >
> > ----------------------------------------------------------------------
> > ----------
> > NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers  If you cannot access these links, please notify us by reply message and we will send the contents to you. By communicating with Morgan Stanley you consent to the foregoing and to the voice recording of conversations with personnel of Morgan Stanley.
> >
> > You may have certain rights regarding the information that Morgan Stanley collects about you.  Please see our Privacy Pledge https://www.morganstanley.com/privacy-pledge for more information about your rights.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For additional commands, e-mail: users-help@qpid.apache.org
>
>
> --------------------------------------------------------------------------------
> NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers  If you cannot access these links, please notify us by reply message and we will send the contents to you. By communicating with Morgan Stanley you consent to the foregoing and to the voice recording of conversations with personnel of Morgan Stanley.
>
> You may have certain rights regarding the information that Morgan Stanley collects about you.  Please see our Privacy Pledge https://www.morganstanley.com/privacy-pledge for more information about your rights.

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


RE: QPID C++ Queue handling

Posted by "Rahul.Singh5@morganstanley.com" <Ra...@morganstanley.com>.
OK, I will have a look.
Out of curiosity, does the same behavior apply to Topics as well. We now know that on queues, we need to either ack or release it. Topics are used to provide broadcasts and I was wondering if the same applies to it. Broadcasts never come with uniqueAppID since these are unsolicited.  Hence, selector logic wont apply to it anyways. So, if I ack the message, will that mean other instances might not receive them?
I noticed that (as you rightly pointed), releasing them brings it back to out receiver many times which is not ideal.

Best Regards,
Rahul

-----Original Message-----
From: Robbie Gemmell <ro...@gmail.com> 
Sent: 31 March 2022 16:33
To: users <us...@qpid.apache.org>
Subject: Re: QPID C++ Queue handling

 Its hard to say much without knowing exactly what you did, the linked thread has a few different things in it.

The error suggests you are using Artemis and it is trying (and failing due to permissions) to create an Address, which I wouldnt really expect if you are consuming from an already known response queue, one that I would assume already existed.

You might need to ensure the broker actually treats the things as being an 'anycast' queue and treats the consumer as a regular queue consumer, as I know Artemis typically defaults to treating things as 'multicast' for more topic-like behaviour, which might be a problematic if you have different consumers with different selectors.
You can do that either by ensuring the address+queue definition is anycat, or changing the broker side address settings [1][2] so anything auto-created is considered 'anycast', or you could alternatively add a 'queue' type hint into the consumer by setting the type option into the consumer address string when creating the receiver (from other threads I think "my-queue; { node:{ type: queue }}" is the format of that).

[1] https://activemq.apache.org/components/artemis/documentation/latest/address-model.html
[2] https://activemq.apache.org/components/artemis/documentation/latest/address-settings.html



On Thu, 31 Mar 2022 at 13:47, Rahul.Singh5@morganstanley.com <Ra...@morganstanley.com> wrote:
>
> Many thanks Gordon. I tried using the selector while creating the 
> Receiver for response queue (as per the example given 
> https://lists.apache.org/thread/95ozl3hxf0cqzt0nxgbvwroddx39kq1w)
> However, I get below exception -
> std::exception Link detached by peer with amqp:unauthorized-access: AMQ119015: not authorized to create consumer, AMQ229032: User: FOOBAR does not have permission='CREATE_ADDRESS' on address 'XXXXX.ResQueue_L'
>
> Best Regards,
> Rahul
>
> -----Original Message-----
> From: Gordon Sim <gs...@redhat.com>
> Sent: 31 March 2022 12:06
> To: users@qpid.apache.org
> Subject: Re: QPID C++ Queue handling
>
> On Thu, Mar 31, 2022 at 11:30 AM Rahul.Singh5@morganstanley.com <Ra...@morganstanley.com> wrote:
> > 2) For the longer term/better solution, I will start looking into selector. Is this within qpid C++ or proton layer. Any quick pointer will be highly appreciated.
>
> For proton C++:
> https://github.com/apache/qpid-proton/blob/main/cpp/examples/selected_
> recv.cpp
>
> For example with the old qpid::messaging API see e.g.
> https://lists.apache.org/thread/95ozl3hxf0cqzt0nxgbvwroddx39kq1w
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For 
> additional commands, e-mail: users-help@qpid.apache.org
>
>
> ----------------------------------------------------------------------
> ----------
> NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers  If you cannot access these links, please notify us by reply message and we will send the contents to you. By communicating with Morgan Stanley you consent to the foregoing and to the voice recording of conversations with personnel of Morgan Stanley.
>
> You may have certain rights regarding the information that Morgan Stanley collects about you.  Please see our Privacy Pledge https://www.morganstanley.com/privacy-pledge for more information about your rights.

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


--------------------------------------------------------------------------------
NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers  If you cannot access these links, please notify us by reply message and we will send the contents to you. By communicating with Morgan Stanley you consent to the foregoing and to the voice recording of conversations with personnel of Morgan Stanley.

You may have certain rights regarding the information that Morgan Stanley collects about you.  Please see our Privacy Pledge https://www.morganstanley.com/privacy-pledge for more information about your rights.

Re: RE: QPID C++ Queue handling

Posted by Robbie Gemmell <ro...@gmail.com>.
I dont know about the code, which is why I have been suggesting
address string options, but the trace seems reasonable. You can/should
of course just verify the behaviour against a broker matches what you
actually want.

On Mon, 4 Apr 2022 at 17:03, Rahul.Singh5@morganstanley.com
<Ra...@morganstanley.com> wrote:
>
> Thanks Robbie. I indeed need it to topics only. I tried the suggestion through the QPID C++ API by using the below code and when looking at QPID messages exchnages, durable is set as 2 (durable=2). Please can you confirm the source code below and the resulting AMQP messages imply that we have correctly set the durability option for topics.
>
>     std::string exampleTopic = "XXXXX.topic";
>     MapT selector;
>     selector["name"] = exampleTopic;
>     selector["durable"] = true;
>     MapT options;
>     options["link"] = selector;
>     AddressT address(exampleTopic, "", options, "topic");
>     _recv = _session.createReceiver(address);
>
> [Protocol] trace [XXXXX_APP_ID]: FRAME: 0 -> @attach(18) [name="XXXXX.topic", handle=2, role=true, snd-settle-mode=2, rcv-settle-mode=0, source=@source(40) [address="XXXXX.topic", durable=2, timeout=120, dynamic=false, capabilities=:topic], target=@target(41) [address="XXXXX.topic", durable=0, timeout=0, dynamic=false], initial-delivery-count=0, max-message-size=0]
> 2022-04-04 16:56:52 [Protocol] trace [XXXXX_APP_ID]: FRAME: 0 <- @attach(18) [name="XXXXX.topic", handle=2, role=false, snd-settle-mode=2, rcv-settle-mode=0, source=@source(40) [address="XXXXX.topic", durable=2, expiry-policy=:"session-end", timeout=120, dynamic=false, capabilities=@PN_SYMBOL[:topic]], target=@target(41) [address="XXXXX.topic"], incomplete-unsettled=false, initial-delivery-count=0]
>
> Best Regards,
> Rahul
> -----Original Message-----
> From: Robbie Gemmell <ro...@gmail.com>
> Sent: 04 April 2022 11:45
> To: users <us...@qpid.apache.org>
> Subject: Re: <Unverified Sender>RE: QPID C++ Queue handling
>
> That is the 'link terminus' durability. It won't have any influence for queues. If you are using 'topics' / multicast the broker will look at that when deciding if it is a durable subscription or not, to determine if its a durable or volatile subscription and utilising the link name as the subscription name.
>
> If you want a durable topic subscription you would need to specify a repeatable link name and set the terminus durability. This isnt something I have tried, but it looks like you can set the link name (used as subscription name) and link durability within the 'address string' given to the client, by specifying 'link options' in style:
> myTopic; {link: {name: <link-name>, durable: True | False }
>
> On Fri, 1 Apr 2022 at 15:41, Rahul.Singh5@morganstanley.com <Ra...@morganstanley.com> wrote:
> >
> > Thanks Robbie.
> >
> > 1 more question. We notice that durable=0 in our AMQP frames going out. I assume this indicates to the broker whether the subscription is durable or not. Please kindly help in suggesting how we can enforce this is set rightly. When I looked into qpid::messaging APIs, I could not find an obvious way.
> >
> >  [Protocol] trace [XXXXX_UNIQUE_APP_ID]: FRAME: 0 -> @attach(18)
> > > [name="'XXXXX.ResQueue_L'_c2928ec1-0937-4f84-a61f-90712c837f1a",
> > > handle=1, role=true, snd-settle-mode=2, rcv-settle-mode=0,
> > > source=@source(40) [address="'XXXXX.ResQueue_L'", durable=0,
> > > timeout=0, dynamic=false, filter={:selector=@77567109365764
> > > ""uniqueAppID"= 'XXXXX_UNIQUE_APP_ID'"}, capabilities=:"'queue'"],
> > > target=@target(41) [address="'XXXXX.ResQueue_L'", durable=0,
> > > timeout=0, dynamic=false], initial-delivery-count=0,
> > > max-message-size=0]
> >
> > Best Regards,
> > Rahul
> > -----Original Message-----
> > From: Robbie Gemmell <ro...@gmail.com>
> > Sent: 01 April 2022 14:57
> > To: users <us...@qpid.apache.org>
> > Subject: Re: <Unverified Sender>RE: QPID C++ Queue handling
> >
> > Neither the queue name or the type capability (which given you found the problem, you may not need) should have ' ' in the actual value, per the various [address string] examples that lack that.
> >
> > The selector will have ' ' around values that happen to be a string literal, since that is the syntax for string literals within selectors, essentially like the JMS selector syntax. It is the server that does the selection.
> >
> > The server will provide a copy of every message sent to the topic to each subscription on the topic (i.e each subscriber if they aren't shared subs), that is how pub/sub topics work. The client does nothing special.
> >
> > On Fri, 1 Apr 2022 at 13:31, Rahul.Singh5@morganstanley.com <Ra...@morganstanley.com> wrote:
> > >
> > > Hello,
> > > I managed to get this message selection working. Basically, the queue address need not be enclosed in ' '. So, hopefully the filtering for queue is working now. I will get a chance to test this on Monday with the other instance.
> > >
> > > However, we might still need to solve the problem for topics where messages are broadcast and we would like all subscribers to receive them. In case of broadcasts, we do not receive any uniqueAppID. They are available in specific topic address. Different instances would need these broadcasts. So, we would want qpid to put them in all receivers which subscribed to that topic. Please can you help how this can be achieved or in case of topic, does the qpid by default copies the message in all the subscribed receivers.
> > >
> > > Best Regards,
> > > Rahul
> > >
> > > -----Original Message-----
> > > From: Rahul.Singh5@morganstanley.com
> > > <Ra...@morganstanley.com>
> > > Sent: 01 April 2022 11:03
> > > To: users@qpid.apache.org
> > > Subject: <Unverified Sender>RE: QPID C++ Queue handling
> > >
> > >
> > > I tired various combination to pass the information to selector however I keep on getting same error. Please see below code and Protocol traces in case there is something you can quickly spot.
> > >
> > > Code -
> > > Map selector;
> > > std::string uniqueAppIdSelector = "\"uniqueAppID\"='" + _appId +
> > > "'"; selector["selector"] = uniqueAppIdSelector; Map options;
> > > options["link"] = selector; Address address(resp_queue, "", options,
> > > "'queue'"); //Address address(resp_queue, "", options, "'queue'");
> > > //Address address(resp_queue, "", options); _receiver =
> > > _session.createReceiver(address);
> > >
> > > In the PROTOCCOL TRACE, I see - filter={:selector=@77567109365764
> > > ""uniqueAppID"= 'XXXXX_UNIQUE_APP_ID'"}, capabilities=:"'queue'"]. I
> > > tried other combinations like
> > >
> > > Where I pass queue as "queue" without ' '. //Address
> > > address(resp_queue, "", options, "queue"); PROTOCOL TRACE -
> > > filter={:selector=@77567109365764 ""uniqueAppID"=
> > > 'XXXXX_UNIQUE_APP_ID'"}, capabilities=:queue]
> > >
> > > OR without passing type argument to address. //Address
> > > address(resp_queue, "", options);
> > > filter={:selector=@77567109365764
> > > ""uniqueAppID"='XXXXX_UNIQUE_APP_ID'"}]
> > >
> > > [Protocol] trace [XXXXX_UNIQUE_APP_ID]: FRAME: 0 -> @attach(18)
> > > [name="'XXXXX.ResQueue_L'_c2928ec1-0937-4f84-a61f-90712c837f1a",
> > > handle=1, role=true, snd-settle-mode=2, rcv-settle-mode=0,
> > > source=@source(40) [address="'XXXXX.ResQueue_L'", durable=0,
> > > timeout=0, dynamic=false, filter={:selector=@77567109365764
> > > ""uniqueAppID"= 'XXXXX_UNIQUE_APP_ID'"}, capabilities=:"'queue'"],
> > > target=@target(41) [address="'XXXXX.ResQueue_L'", durable=0,
> > > timeout=0, dynamic=false], initial-delivery-count=0,
> > > max-message-size=0]
> > >
> > > 2022-04-01 10:18:16 [Protocol] trace [XXXXX_UNIQUE_APP_ID]: FRAME: 0
> > > <- @detach(22) [handle=1, closed=true, error=@error(29)
> > > [condition=:"amqp:unauthorized-access", description="AMQ119015: not
> > > authorized to create consumer, AMQ229032: User: XXXXX_USER does not
> > > have permission='CREATE_ADDRESS' on address 'XXXXX.ResQueue_L'"]]
> > >
> > > Best Regards,
> > > Rahul
> > >
> > > -----Original Message-----
> > > From: Robbie Gemmell <ro...@gmail.com>
> > > Sent: 31 March 2022 16:33
> > > To: users <us...@qpid.apache.org>
> > > Subject: Re: QPID C++ Queue handling
> > >
> > >  Its hard to say much without knowing exactly what you did, the linked thread has a few different things in it.
> > >
> > > The error suggests you are using Artemis and it is trying (and failing due to permissions) to create an Address, which I wouldnt really expect if you are consuming from an already known response queue, one that I would assume already existed.
> > >
> > > You might need to ensure the broker actually treats the things as being an 'anycast' queue and treats the consumer as a regular queue consumer, as I know Artemis typically defaults to treating things as 'multicast' for more topic-like behaviour, which might be a problematic if you have different consumers with different selectors.
> > > You can do that either by ensuring the address+queue definition is anycat, or changing the broker side address settings [1][2] so anything auto-created is considered 'anycast', or you could alternatively add a 'queue' type hint into the consumer by setting the type option into the consumer address string when creating the receiver (from other threads I think "my-queue; { node:{ type: queue }}" is the format of that).
> > >
> > > [1]
> > > https://activemq.apache.org/components/artemis/documentation/latest/
> > > ad
> > > dress-model.html [2]
> > > https://activemq.apache.org/components/artemis/documentation/latest/
> > > ad
> > > dress-settings.html
> > >
> > >
> > >
> > > On Thu, 31 Mar 2022 at 13:47, Rahul.Singh5@morganstanley.com <Ra...@morganstanley.com> wrote:
> > > >
> > > > Many thanks Gordon. I tried using the selector while creating the
> > > > Receiver for response queue (as per the example given
> > > > https://lists.apache.org/thread/95ozl3hxf0cqzt0nxgbvwroddx39kq1w)
> > > > However, I get below exception -
> > > > std::exception Link detached by peer with amqp:unauthorized-access: AMQ119015: not authorized to create consumer, AMQ229032: User: FOOBAR does not have permission='CREATE_ADDRESS' on address 'XXXXX.ResQueue_L'
> > > >
> > > > Best Regards,
> > > > Rahul
> > > >
> > > > -----Original Message-----
> > > > From: Gordon Sim <gs...@redhat.com>
> > > > Sent: 31 March 2022 12:06
> > > > To: users@qpid.apache.org
> > > > Subject: Re: QPID C++ Queue handling
> > > >
> > > > On Thu, Mar 31, 2022 at 11:30 AM Rahul.Singh5@morganstanley.com <Ra...@morganstanley.com> wrote:
> > > > > 2) For the longer term/better solution, I will start looking into selector. Is this within qpid C++ or proton layer. Any quick pointer will be highly appreciated.
> > > >
> > > > For proton C++:
> > > > https://github.com/apache/qpid-proton/blob/main/cpp/examples/selec
> > > > te
> > > > d_
> > > > recv.cpp
> > > >
> > > > For example with the old qpid::messaging API see e.g.
> > > > https://lists.apache.org/thread/95ozl3hxf0cqzt0nxgbvwroddx39kq1w
> > > >
> > > >
> > > > ------------------------------------------------------------------
> > > > --
> > > > - To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For
> > > > additional commands, e-mail: users-help@qpid.apache.org
> > > >
> > > >
> > > > ------------------------------------------------------------------
> > > > --
> > > > --
> > > > ----------
> > > > NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers  If you cannot access these links, please notify us by reply message and we will send the contents to you. By communicating with Morgan Stanley you consent to the foregoing and to the voice recording of conversations with personnel of Morgan Stanley.
> > > >
> > > > You may have certain rights regarding the information that Morgan Stanley collects about you.  Please see our Privacy Pledge https://www.morganstanley.com/privacy-pledge for more information about your rights.
> > >
> > > --------------------------------------------------------------------
> > > - To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For
> > > additional commands, e-mail: users-help@qpid.apache.org
> > >
> > >
> > > --------------------------------------------------------------------
> > > --
> > > ----------
> > > NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers  If you cannot access these links, please notify us by reply message and we will send the contents to you. By communicating with Morgan Stanley you consent to the foregoing and to the voice recording of conversations with personnel of Morgan Stanley.
> > >
> > > You may have certain rights regarding the information that Morgan Stanley collects about you.  Please see our Privacy Pledge https://www.morganstanley.com/privacy-pledge for more information about your rights.
> > > --------------------------------------------------------------------
> > > - To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For
> > > additional commands, e-mail: users-help@qpid.apache.org
> > >
> > >
> > > --------------------------------------------------------------------
> > > --
> > > ----------
> > > NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers  If you cannot access these links, please notify us by reply message and we will send the contents to you. By communicating with Morgan Stanley you consent to the foregoing and to the voice recording of conversations with personnel of Morgan Stanley.
> > >
> > > You may have certain rights regarding the information that Morgan Stanley collects about you.  Please see our Privacy Pledge https://www.morganstanley.com/privacy-pledge for more information about your rights.
> > > --------------------------------------------------------------------
> > > - To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For
> > > additional commands, e-mail: users-help@qpid.apache.org
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For
> > additional commands, e-mail: users-help@qpid.apache.org
> >
> >
> > ----------------------------------------------------------------------
> > ----------
> > NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers  If you cannot access these links, please notify us by reply message and we will send the contents to you. By communicating with Morgan Stanley you consent to the foregoing and to the voice recording of conversations with personnel of Morgan Stanley.
> >
> > You may have certain rights regarding the information that Morgan Stanley collects about you.  Please see our Privacy Pledge https://www.morganstanley.com/privacy-pledge for more information about your rights.
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For
> > additional commands, e-mail: users-help@qpid.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For additional commands, e-mail: users-help@qpid.apache.org
>
>
> --------------------------------------------------------------------------------
> NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers  If you cannot access these links, please notify us by reply message and we will send the contents to you. By communicating with Morgan Stanley you consent to the foregoing and to the voice recording of conversations with personnel of Morgan Stanley.
>
> You may have certain rights regarding the information that Morgan Stanley collects about you.  Please see our Privacy Pledge https://www.morganstanley.com/privacy-pledge for more information about your rights.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>

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


RE: RE: QPID C++ Queue handling

Posted by "Rahul.Singh5@morganstanley.com" <Ra...@morganstanley.com>.
Thanks Robbie. I indeed need it to topics only. I tried the suggestion through the QPID C++ API by using the below code and when looking at QPID messages exchnages, durable is set as 2 (durable=2). Please can you confirm the source code below and the resulting AMQP messages imply that we have correctly set the durability option for topics.

    std::string exampleTopic = "XXXXX.topic";
    MapT selector;
    selector["name"] = exampleTopic;
    selector["durable"] = true;
    MapT options;
    options["link"] = selector;
    AddressT address(exampleTopic, "", options, "topic");
    _recv = _session.createReceiver(address);

[Protocol] trace [XXXXX_APP_ID]: FRAME: 0 -> @attach(18) [name="XXXXX.topic", handle=2, role=true, snd-settle-mode=2, rcv-settle-mode=0, source=@source(40) [address="XXXXX.topic", durable=2, timeout=120, dynamic=false, capabilities=:topic], target=@target(41) [address="XXXXX.topic", durable=0, timeout=0, dynamic=false], initial-delivery-count=0, max-message-size=0]
2022-04-04 16:56:52 [Protocol] trace [XXXXX_APP_ID]: FRAME: 0 <- @attach(18) [name="XXXXX.topic", handle=2, role=false, snd-settle-mode=2, rcv-settle-mode=0, source=@source(40) [address="XXXXX.topic", durable=2, expiry-policy=:"session-end", timeout=120, dynamic=false, capabilities=@PN_SYMBOL[:topic]], target=@target(41) [address="XXXXX.topic"], incomplete-unsettled=false, initial-delivery-count=0]

Best Regards,
Rahul
-----Original Message-----
From: Robbie Gemmell <ro...@gmail.com> 
Sent: 04 April 2022 11:45
To: users <us...@qpid.apache.org>
Subject: Re: <Unverified Sender>RE: QPID C++ Queue handling

That is the 'link terminus' durability. It won't have any influence for queues. If you are using 'topics' / multicast the broker will look at that when deciding if it is a durable subscription or not, to determine if its a durable or volatile subscription and utilising the link name as the subscription name.

If you want a durable topic subscription you would need to specify a repeatable link name and set the terminus durability. This isnt something I have tried, but it looks like you can set the link name (used as subscription name) and link durability within the 'address string' given to the client, by specifying 'link options' in style:
myTopic; {link: {name: <link-name>, durable: True | False }

On Fri, 1 Apr 2022 at 15:41, Rahul.Singh5@morganstanley.com <Ra...@morganstanley.com> wrote:
>
> Thanks Robbie.
>
> 1 more question. We notice that durable=0 in our AMQP frames going out. I assume this indicates to the broker whether the subscription is durable or not. Please kindly help in suggesting how we can enforce this is set rightly. When I looked into qpid::messaging APIs, I could not find an obvious way.
>
>  [Protocol] trace [XXXXX_UNIQUE_APP_ID]: FRAME: 0 -> @attach(18)
> > [name="'XXXXX.ResQueue_L'_c2928ec1-0937-4f84-a61f-90712c837f1a",  
> > handle=1, role=true, snd-settle-mode=2, rcv-settle-mode=0,  
> > source=@source(40) [address="'XXXXX.ResQueue_L'", durable=0, 
> > timeout=0, dynamic=false, filter={:selector=@77567109365764 
> > ""uniqueAppID"= 'XXXXX_UNIQUE_APP_ID'"}, capabilities=:"'queue'"], 
> > target=@target(41) [address="'XXXXX.ResQueue_L'", durable=0, 
> > timeout=0, dynamic=false], initial-delivery-count=0, 
> > max-message-size=0]
>
> Best Regards,
> Rahul
> -----Original Message-----
> From: Robbie Gemmell <ro...@gmail.com>
> Sent: 01 April 2022 14:57
> To: users <us...@qpid.apache.org>
> Subject: Re: <Unverified Sender>RE: QPID C++ Queue handling
>
> Neither the queue name or the type capability (which given you found the problem, you may not need) should have ' ' in the actual value, per the various [address string] examples that lack that.
>
> The selector will have ' ' around values that happen to be a string literal, since that is the syntax for string literals within selectors, essentially like the JMS selector syntax. It is the server that does the selection.
>
> The server will provide a copy of every message sent to the topic to each subscription on the topic (i.e each subscriber if they aren't shared subs), that is how pub/sub topics work. The client does nothing special.
>
> On Fri, 1 Apr 2022 at 13:31, Rahul.Singh5@morganstanley.com <Ra...@morganstanley.com> wrote:
> >
> > Hello,
> > I managed to get this message selection working. Basically, the queue address need not be enclosed in ' '. So, hopefully the filtering for queue is working now. I will get a chance to test this on Monday with the other instance.
> >
> > However, we might still need to solve the problem for topics where messages are broadcast and we would like all subscribers to receive them. In case of broadcasts, we do not receive any uniqueAppID. They are available in specific topic address. Different instances would need these broadcasts. So, we would want qpid to put them in all receivers which subscribed to that topic. Please can you help how this can be achieved or in case of topic, does the qpid by default copies the message in all the subscribed receivers.
> >
> > Best Regards,
> > Rahul
> >
> > -----Original Message-----
> > From: Rahul.Singh5@morganstanley.com 
> > <Ra...@morganstanley.com>
> > Sent: 01 April 2022 11:03
> > To: users@qpid.apache.org
> > Subject: <Unverified Sender>RE: QPID C++ Queue handling
> >
> >
> > I tired various combination to pass the information to selector however I keep on getting same error. Please see below code and Protocol traces in case there is something you can quickly spot.
> >
> > Code -
> > Map selector;
> > std::string uniqueAppIdSelector = "\"uniqueAppID\"='" + _appId + 
> > "'"; selector["selector"] = uniqueAppIdSelector; Map options; 
> > options["link"] = selector; Address address(resp_queue, "", options, 
> > "'queue'"); //Address address(resp_queue, "", options, "'queue'"); 
> > //Address address(resp_queue, "", options); _receiver = 
> > _session.createReceiver(address);
> >
> > In the PROTOCCOL TRACE, I see - filter={:selector=@77567109365764 
> > ""uniqueAppID"= 'XXXXX_UNIQUE_APP_ID'"}, capabilities=:"'queue'"]. I 
> > tried other combinations like
> >
> > Where I pass queue as "queue" without ' '. //Address 
> > address(resp_queue, "", options, "queue"); PROTOCOL TRACE -
> > filter={:selector=@77567109365764 ""uniqueAppID"= 
> > 'XXXXX_UNIQUE_APP_ID'"}, capabilities=:queue]
> >
> > OR without passing type argument to address. //Address 
> > address(resp_queue, "", options);
> > filter={:selector=@77567109365764
> > ""uniqueAppID"='XXXXX_UNIQUE_APP_ID'"}]
> >
> > [Protocol] trace [XXXXX_UNIQUE_APP_ID]: FRAME: 0 -> @attach(18) 
> > [name="'XXXXX.ResQueue_L'_c2928ec1-0937-4f84-a61f-90712c837f1a",
> > handle=1, role=true, snd-settle-mode=2, rcv-settle-mode=0,
> > source=@source(40) [address="'XXXXX.ResQueue_L'", durable=0, 
> > timeout=0, dynamic=false, filter={:selector=@77567109365764 
> > ""uniqueAppID"= 'XXXXX_UNIQUE_APP_ID'"}, capabilities=:"'queue'"],
> > target=@target(41) [address="'XXXXX.ResQueue_L'", durable=0, 
> > timeout=0, dynamic=false], initial-delivery-count=0, 
> > max-message-size=0]
> >
> > 2022-04-01 10:18:16 [Protocol] trace [XXXXX_UNIQUE_APP_ID]: FRAME: 0
> > <- @detach(22) [handle=1, closed=true, error=@error(29) 
> > [condition=:"amqp:unauthorized-access", description="AMQ119015: not 
> > authorized to create consumer, AMQ229032: User: XXXXX_USER does not 
> > have permission='CREATE_ADDRESS' on address 'XXXXX.ResQueue_L'"]]
> >
> > Best Regards,
> > Rahul
> >
> > -----Original Message-----
> > From: Robbie Gemmell <ro...@gmail.com>
> > Sent: 31 March 2022 16:33
> > To: users <us...@qpid.apache.org>
> > Subject: Re: QPID C++ Queue handling
> >
> >  Its hard to say much without knowing exactly what you did, the linked thread has a few different things in it.
> >
> > The error suggests you are using Artemis and it is trying (and failing due to permissions) to create an Address, which I wouldnt really expect if you are consuming from an already known response queue, one that I would assume already existed.
> >
> > You might need to ensure the broker actually treats the things as being an 'anycast' queue and treats the consumer as a regular queue consumer, as I know Artemis typically defaults to treating things as 'multicast' for more topic-like behaviour, which might be a problematic if you have different consumers with different selectors.
> > You can do that either by ensuring the address+queue definition is anycat, or changing the broker side address settings [1][2] so anything auto-created is considered 'anycast', or you could alternatively add a 'queue' type hint into the consumer by setting the type option into the consumer address string when creating the receiver (from other threads I think "my-queue; { node:{ type: queue }}" is the format of that).
> >
> > [1]
> > https://activemq.apache.org/components/artemis/documentation/latest/
> > ad
> > dress-model.html [2]
> > https://activemq.apache.org/components/artemis/documentation/latest/
> > ad
> > dress-settings.html
> >
> >
> >
> > On Thu, 31 Mar 2022 at 13:47, Rahul.Singh5@morganstanley.com <Ra...@morganstanley.com> wrote:
> > >
> > > Many thanks Gordon. I tried using the selector while creating the 
> > > Receiver for response queue (as per the example given
> > > https://lists.apache.org/thread/95ozl3hxf0cqzt0nxgbvwroddx39kq1w)
> > > However, I get below exception -
> > > std::exception Link detached by peer with amqp:unauthorized-access: AMQ119015: not authorized to create consumer, AMQ229032: User: FOOBAR does not have permission='CREATE_ADDRESS' on address 'XXXXX.ResQueue_L'
> > >
> > > Best Regards,
> > > Rahul
> > >
> > > -----Original Message-----
> > > From: Gordon Sim <gs...@redhat.com>
> > > Sent: 31 March 2022 12:06
> > > To: users@qpid.apache.org
> > > Subject: Re: QPID C++ Queue handling
> > >
> > > On Thu, Mar 31, 2022 at 11:30 AM Rahul.Singh5@morganstanley.com <Ra...@morganstanley.com> wrote:
> > > > 2) For the longer term/better solution, I will start looking into selector. Is this within qpid C++ or proton layer. Any quick pointer will be highly appreciated.
> > >
> > > For proton C++:
> > > https://github.com/apache/qpid-proton/blob/main/cpp/examples/selec
> > > te
> > > d_
> > > recv.cpp
> > >
> > > For example with the old qpid::messaging API see e.g.
> > > https://lists.apache.org/thread/95ozl3hxf0cqzt0nxgbvwroddx39kq1w
> > >
> > >
> > > ------------------------------------------------------------------
> > > --
> > > - To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For 
> > > additional commands, e-mail: users-help@qpid.apache.org
> > >
> > >
> > > ------------------------------------------------------------------
> > > --
> > > --
> > > ----------
> > > NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers  If you cannot access these links, please notify us by reply message and we will send the contents to you. By communicating with Morgan Stanley you consent to the foregoing and to the voice recording of conversations with personnel of Morgan Stanley.
> > >
> > > You may have certain rights regarding the information that Morgan Stanley collects about you.  Please see our Privacy Pledge https://www.morganstanley.com/privacy-pledge for more information about your rights.
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For 
> > additional commands, e-mail: users-help@qpid.apache.org
> >
> >
> > --------------------------------------------------------------------
> > --
> > ----------
> > NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers  If you cannot access these links, please notify us by reply message and we will send the contents to you. By communicating with Morgan Stanley you consent to the foregoing and to the voice recording of conversations with personnel of Morgan Stanley.
> >
> > You may have certain rights regarding the information that Morgan Stanley collects about you.  Please see our Privacy Pledge https://www.morganstanley.com/privacy-pledge for more information about your rights.
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For 
> > additional commands, e-mail: users-help@qpid.apache.org
> >
> >
> > --------------------------------------------------------------------
> > --
> > ----------
> > NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers  If you cannot access these links, please notify us by reply message and we will send the contents to you. By communicating with Morgan Stanley you consent to the foregoing and to the voice recording of conversations with personnel of Morgan Stanley.
> >
> > You may have certain rights regarding the information that Morgan Stanley collects about you.  Please see our Privacy Pledge https://www.morganstanley.com/privacy-pledge for more information about your rights.
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For 
> > additional commands, e-mail: users-help@qpid.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For 
> additional commands, e-mail: users-help@qpid.apache.org
>
>
> ----------------------------------------------------------------------
> ----------
> NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers  If you cannot access these links, please notify us by reply message and we will send the contents to you. By communicating with Morgan Stanley you consent to the foregoing and to the voice recording of conversations with personnel of Morgan Stanley.
>
> You may have certain rights regarding the information that Morgan Stanley collects about you.  Please see our Privacy Pledge https://www.morganstanley.com/privacy-pledge for more information about your rights.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For 
> additional commands, e-mail: users-help@qpid.apache.org
>

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


--------------------------------------------------------------------------------
NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers  If you cannot access these links, please notify us by reply message and we will send the contents to you. By communicating with Morgan Stanley you consent to the foregoing and to the voice recording of conversations with personnel of Morgan Stanley.

You may have certain rights regarding the information that Morgan Stanley collects about you.  Please see our Privacy Pledge https://www.morganstanley.com/privacy-pledge for more information about your rights.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: RE: QPID C++ Queue handling

Posted by Robbie Gemmell <ro...@gmail.com>.
That is the 'link terminus' durability. It won't have any influence
for queues. If you are using 'topics' / multicast the broker will look
at that when deciding if it is a durable subscription or not, to
determine if its a durable or volatile subscription and utilising the
link name as the subscription name.

If you want a durable topic subscription you would need to specify a
repeatable link name and set the terminus durability. This isnt
something I have tried, but it looks like you can set the link name
(used as subscription name) and link durability within the 'address
string' given to the client, by specifying 'link options' in style:
myTopic; {link: {name: <link-name>, durable: True | False }

On Fri, 1 Apr 2022 at 15:41, Rahul.Singh5@morganstanley.com
<Ra...@morganstanley.com> wrote:
>
> Thanks Robbie.
>
> 1 more question. We notice that durable=0 in our AMQP frames going out. I assume this indicates to the broker whether the subscription is durable or not. Please kindly help in suggesting how we can enforce this is set rightly. When I looked into qpid::messaging APIs, I could not find an obvious way.
>
>  [Protocol] trace [XXXXX_UNIQUE_APP_ID]: FRAME: 0 -> @attach(18)
> > [name="'XXXXX.ResQueue_L'_c2928ec1-0937-4f84-a61f-90712c837f1a",  handle=1, role=true, snd-settle-mode=2, rcv-settle-mode=0,  source=@source(40) [address="'XXXXX.ResQueue_L'", durable=0,
> > timeout=0, dynamic=false, filter={:selector=@77567109365764 ""uniqueAppID"= 'XXXXX_UNIQUE_APP_ID'"}, capabilities=:"'queue'"], target=@target(41) [address="'XXXXX.ResQueue_L'", durable=0, timeout=0, dynamic=false], initial-delivery-count=0, max-message-size=0]
>
> Best Regards,
> Rahul
> -----Original Message-----
> From: Robbie Gemmell <ro...@gmail.com>
> Sent: 01 April 2022 14:57
> To: users <us...@qpid.apache.org>
> Subject: Re: <Unverified Sender>RE: QPID C++ Queue handling
>
> Neither the queue name or the type capability (which given you found the problem, you may not need) should have ' ' in the actual value, per the various [address string] examples that lack that.
>
> The selector will have ' ' around values that happen to be a string literal, since that is the syntax for string literals within selectors, essentially like the JMS selector syntax. It is the server that does the selection.
>
> The server will provide a copy of every message sent to the topic to each subscription on the topic (i.e each subscriber if they aren't shared subs), that is how pub/sub topics work. The client does nothing special.
>
> On Fri, 1 Apr 2022 at 13:31, Rahul.Singh5@morganstanley.com <Ra...@morganstanley.com> wrote:
> >
> > Hello,
> > I managed to get this message selection working. Basically, the queue address need not be enclosed in ' '. So, hopefully the filtering for queue is working now. I will get a chance to test this on Monday with the other instance.
> >
> > However, we might still need to solve the problem for topics where messages are broadcast and we would like all subscribers to receive them. In case of broadcasts, we do not receive any uniqueAppID. They are available in specific topic address. Different instances would need these broadcasts. So, we would want qpid to put them in all receivers which subscribed to that topic. Please can you help how this can be achieved or in case of topic, does the qpid by default copies the message in all the subscribed receivers.
> >
> > Best Regards,
> > Rahul
> >
> > -----Original Message-----
> > From: Rahul.Singh5@morganstanley.com <Ra...@morganstanley.com>
> > Sent: 01 April 2022 11:03
> > To: users@qpid.apache.org
> > Subject: <Unverified Sender>RE: QPID C++ Queue handling
> >
> >
> > I tired various combination to pass the information to selector however I keep on getting same error. Please see below code and Protocol traces in case there is something you can quickly spot.
> >
> > Code -
> > Map selector;
> > std::string uniqueAppIdSelector = "\"uniqueAppID\"='" + _appId + "'";
> > selector["selector"] = uniqueAppIdSelector; Map options;
> > options["link"] = selector; Address address(resp_queue, "", options,
> > "'queue'"); //Address address(resp_queue, "", options, "'queue'");
> > //Address address(resp_queue, "", options); _receiver =
> > _session.createReceiver(address);
> >
> > In the PROTOCCOL TRACE, I see - filter={:selector=@77567109365764
> > ""uniqueAppID"= 'XXXXX_UNIQUE_APP_ID'"}, capabilities=:"'queue'"]. I
> > tried other combinations like
> >
> > Where I pass queue as "queue" without ' '. //Address
> > address(resp_queue, "", options, "queue"); PROTOCOL TRACE -
> > filter={:selector=@77567109365764 ""uniqueAppID"=
> > 'XXXXX_UNIQUE_APP_ID'"}, capabilities=:queue]
> >
> > OR without passing type argument to address. //Address
> > address(resp_queue, "", options);
> > filter={:selector=@77567109365764
> > ""uniqueAppID"='XXXXX_UNIQUE_APP_ID'"}]
> >
> > [Protocol] trace [XXXXX_UNIQUE_APP_ID]: FRAME: 0 -> @attach(18)
> > [name="'XXXXX.ResQueue_L'_c2928ec1-0937-4f84-a61f-90712c837f1a",
> > handle=1, role=true, snd-settle-mode=2, rcv-settle-mode=0,
> > source=@source(40) [address="'XXXXX.ResQueue_L'", durable=0,
> > timeout=0, dynamic=false, filter={:selector=@77567109365764
> > ""uniqueAppID"= 'XXXXX_UNIQUE_APP_ID'"}, capabilities=:"'queue'"],
> > target=@target(41) [address="'XXXXX.ResQueue_L'", durable=0,
> > timeout=0, dynamic=false], initial-delivery-count=0,
> > max-message-size=0]
> >
> > 2022-04-01 10:18:16 [Protocol] trace [XXXXX_UNIQUE_APP_ID]: FRAME: 0
> > <- @detach(22) [handle=1, closed=true, error=@error(29)
> > [condition=:"amqp:unauthorized-access", description="AMQ119015: not
> > authorized to create consumer, AMQ229032: User: XXXXX_USER does not
> > have permission='CREATE_ADDRESS' on address 'XXXXX.ResQueue_L'"]]
> >
> > Best Regards,
> > Rahul
> >
> > -----Original Message-----
> > From: Robbie Gemmell <ro...@gmail.com>
> > Sent: 31 March 2022 16:33
> > To: users <us...@qpid.apache.org>
> > Subject: Re: QPID C++ Queue handling
> >
> >  Its hard to say much without knowing exactly what you did, the linked thread has a few different things in it.
> >
> > The error suggests you are using Artemis and it is trying (and failing due to permissions) to create an Address, which I wouldnt really expect if you are consuming from an already known response queue, one that I would assume already existed.
> >
> > You might need to ensure the broker actually treats the things as being an 'anycast' queue and treats the consumer as a regular queue consumer, as I know Artemis typically defaults to treating things as 'multicast' for more topic-like behaviour, which might be a problematic if you have different consumers with different selectors.
> > You can do that either by ensuring the address+queue definition is anycat, or changing the broker side address settings [1][2] so anything auto-created is considered 'anycast', or you could alternatively add a 'queue' type hint into the consumer by setting the type option into the consumer address string when creating the receiver (from other threads I think "my-queue; { node:{ type: queue }}" is the format of that).
> >
> > [1]
> > https://activemq.apache.org/components/artemis/documentation/latest/ad
> > dress-model.html [2]
> > https://activemq.apache.org/components/artemis/documentation/latest/ad
> > dress-settings.html
> >
> >
> >
> > On Thu, 31 Mar 2022 at 13:47, Rahul.Singh5@morganstanley.com <Ra...@morganstanley.com> wrote:
> > >
> > > Many thanks Gordon. I tried using the selector while creating the
> > > Receiver for response queue (as per the example given
> > > https://lists.apache.org/thread/95ozl3hxf0cqzt0nxgbvwroddx39kq1w)
> > > However, I get below exception -
> > > std::exception Link detached by peer with amqp:unauthorized-access: AMQ119015: not authorized to create consumer, AMQ229032: User: FOOBAR does not have permission='CREATE_ADDRESS' on address 'XXXXX.ResQueue_L'
> > >
> > > Best Regards,
> > > Rahul
> > >
> > > -----Original Message-----
> > > From: Gordon Sim <gs...@redhat.com>
> > > Sent: 31 March 2022 12:06
> > > To: users@qpid.apache.org
> > > Subject: Re: QPID C++ Queue handling
> > >
> > > On Thu, Mar 31, 2022 at 11:30 AM Rahul.Singh5@morganstanley.com <Ra...@morganstanley.com> wrote:
> > > > 2) For the longer term/better solution, I will start looking into selector. Is this within qpid C++ or proton layer. Any quick pointer will be highly appreciated.
> > >
> > > For proton C++:
> > > https://github.com/apache/qpid-proton/blob/main/cpp/examples/selecte
> > > d_
> > > recv.cpp
> > >
> > > For example with the old qpid::messaging API see e.g.
> > > https://lists.apache.org/thread/95ozl3hxf0cqzt0nxgbvwroddx39kq1w
> > >
> > >
> > > --------------------------------------------------------------------
> > > - To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For
> > > additional commands, e-mail: users-help@qpid.apache.org
> > >
> > >
> > > --------------------------------------------------------------------
> > > --
> > > ----------
> > > NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers  If you cannot access these links, please notify us by reply message and we will send the contents to you. By communicating with Morgan Stanley you consent to the foregoing and to the voice recording of conversations with personnel of Morgan Stanley.
> > >
> > > You may have certain rights regarding the information that Morgan Stanley collects about you.  Please see our Privacy Pledge https://www.morganstanley.com/privacy-pledge for more information about your rights.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For
> > additional commands, e-mail: users-help@qpid.apache.org
> >
> >
> > ----------------------------------------------------------------------
> > ----------
> > NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers  If you cannot access these links, please notify us by reply message and we will send the contents to you. By communicating with Morgan Stanley you consent to the foregoing and to the voice recording of conversations with personnel of Morgan Stanley.
> >
> > You may have certain rights regarding the information that Morgan Stanley collects about you.  Please see our Privacy Pledge https://www.morganstanley.com/privacy-pledge for more information about your rights.
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For
> > additional commands, e-mail: users-help@qpid.apache.org
> >
> >
> > ----------------------------------------------------------------------
> > ----------
> > NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers  If you cannot access these links, please notify us by reply message and we will send the contents to you. By communicating with Morgan Stanley you consent to the foregoing and to the voice recording of conversations with personnel of Morgan Stanley.
> >
> > You may have certain rights regarding the information that Morgan Stanley collects about you.  Please see our Privacy Pledge https://www.morganstanley.com/privacy-pledge for more information about your rights.
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For
> > additional commands, e-mail: users-help@qpid.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For additional commands, e-mail: users-help@qpid.apache.org
>
>
> --------------------------------------------------------------------------------
> NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers  If you cannot access these links, please notify us by reply message and we will send the contents to you. By communicating with Morgan Stanley you consent to the foregoing and to the voice recording of conversations with personnel of Morgan Stanley.
>
> You may have certain rights regarding the information that Morgan Stanley collects about you.  Please see our Privacy Pledge https://www.morganstanley.com/privacy-pledge for more information about your rights.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>

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


RE: RE: QPID C++ Queue handling

Posted by "Rahul.Singh5@morganstanley.com" <Ra...@morganstanley.com>.
Thanks Robbie.

1 more question. We notice that durable=0 in our AMQP frames going out. I assume this indicates to the broker whether the subscription is durable or not. Please kindly help in suggesting how we can enforce this is set rightly. When I looked into qpid::messaging APIs, I could not find an obvious way.

 [Protocol] trace [XXXXX_UNIQUE_APP_ID]: FRAME: 0 -> @attach(18) 
> [name="'XXXXX.ResQueue_L'_c2928ec1-0937-4f84-a61f-90712c837f1a",  handle=1, role=true, snd-settle-mode=2, rcv-settle-mode=0,  source=@source(40) [address="'XXXXX.ResQueue_L'", durable=0, 
> timeout=0, dynamic=false, filter={:selector=@77567109365764 ""uniqueAppID"= 'XXXXX_UNIQUE_APP_ID'"}, capabilities=:"'queue'"], target=@target(41) [address="'XXXXX.ResQueue_L'", durable=0, timeout=0, dynamic=false], initial-delivery-count=0, max-message-size=0]

Best Regards,
Rahul
-----Original Message-----
From: Robbie Gemmell <ro...@gmail.com> 
Sent: 01 April 2022 14:57
To: users <us...@qpid.apache.org>
Subject: Re: <Unverified Sender>RE: QPID C++ Queue handling

Neither the queue name or the type capability (which given you found the problem, you may not need) should have ' ' in the actual value, per the various [address string] examples that lack that.

The selector will have ' ' around values that happen to be a string literal, since that is the syntax for string literals within selectors, essentially like the JMS selector syntax. It is the server that does the selection.

The server will provide a copy of every message sent to the topic to each subscription on the topic (i.e each subscriber if they aren't shared subs), that is how pub/sub topics work. The client does nothing special.

On Fri, 1 Apr 2022 at 13:31, Rahul.Singh5@morganstanley.com <Ra...@morganstanley.com> wrote:
>
> Hello,
> I managed to get this message selection working. Basically, the queue address need not be enclosed in ' '. So, hopefully the filtering for queue is working now. I will get a chance to test this on Monday with the other instance.
>
> However, we might still need to solve the problem for topics where messages are broadcast and we would like all subscribers to receive them. In case of broadcasts, we do not receive any uniqueAppID. They are available in specific topic address. Different instances would need these broadcasts. So, we would want qpid to put them in all receivers which subscribed to that topic. Please can you help how this can be achieved or in case of topic, does the qpid by default copies the message in all the subscribed receivers.
>
> Best Regards,
> Rahul
>
> -----Original Message-----
> From: Rahul.Singh5@morganstanley.com <Ra...@morganstanley.com>
> Sent: 01 April 2022 11:03
> To: users@qpid.apache.org
> Subject: <Unverified Sender>RE: QPID C++ Queue handling
>
>
> I tired various combination to pass the information to selector however I keep on getting same error. Please see below code and Protocol traces in case there is something you can quickly spot.
>
> Code -
> Map selector;
> std::string uniqueAppIdSelector = "\"uniqueAppID\"='" + _appId + "'"; 
> selector["selector"] = uniqueAppIdSelector; Map options; 
> options["link"] = selector; Address address(resp_queue, "", options, 
> "'queue'"); //Address address(resp_queue, "", options, "'queue'"); 
> //Address address(resp_queue, "", options); _receiver = 
> _session.createReceiver(address);
>
> In the PROTOCCOL TRACE, I see - filter={:selector=@77567109365764 
> ""uniqueAppID"= 'XXXXX_UNIQUE_APP_ID'"}, capabilities=:"'queue'"]. I 
> tried other combinations like
>
> Where I pass queue as "queue" without ' '. //Address 
> address(resp_queue, "", options, "queue"); PROTOCOL TRACE -
> filter={:selector=@77567109365764 ""uniqueAppID"= 
> 'XXXXX_UNIQUE_APP_ID'"}, capabilities=:queue]
>
> OR without passing type argument to address. //Address 
> address(resp_queue, "", options);
> filter={:selector=@77567109365764 
> ""uniqueAppID"='XXXXX_UNIQUE_APP_ID'"}]
>
> [Protocol] trace [XXXXX_UNIQUE_APP_ID]: FRAME: 0 -> @attach(18) 
> [name="'XXXXX.ResQueue_L'_c2928ec1-0937-4f84-a61f-90712c837f1a", 
> handle=1, role=true, snd-settle-mode=2, rcv-settle-mode=0, 
> source=@source(40) [address="'XXXXX.ResQueue_L'", durable=0, 
> timeout=0, dynamic=false, filter={:selector=@77567109365764 
> ""uniqueAppID"= 'XXXXX_UNIQUE_APP_ID'"}, capabilities=:"'queue'"], 
> target=@target(41) [address="'XXXXX.ResQueue_L'", durable=0, 
> timeout=0, dynamic=false], initial-delivery-count=0, 
> max-message-size=0]
>
> 2022-04-01 10:18:16 [Protocol] trace [XXXXX_UNIQUE_APP_ID]: FRAME: 0 
> <- @detach(22) [handle=1, closed=true, error=@error(29) 
> [condition=:"amqp:unauthorized-access", description="AMQ119015: not 
> authorized to create consumer, AMQ229032: User: XXXXX_USER does not 
> have permission='CREATE_ADDRESS' on address 'XXXXX.ResQueue_L'"]]
>
> Best Regards,
> Rahul
>
> -----Original Message-----
> From: Robbie Gemmell <ro...@gmail.com>
> Sent: 31 March 2022 16:33
> To: users <us...@qpid.apache.org>
> Subject: Re: QPID C++ Queue handling
>
>  Its hard to say much without knowing exactly what you did, the linked thread has a few different things in it.
>
> The error suggests you are using Artemis and it is trying (and failing due to permissions) to create an Address, which I wouldnt really expect if you are consuming from an already known response queue, one that I would assume already existed.
>
> You might need to ensure the broker actually treats the things as being an 'anycast' queue and treats the consumer as a regular queue consumer, as I know Artemis typically defaults to treating things as 'multicast' for more topic-like behaviour, which might be a problematic if you have different consumers with different selectors.
> You can do that either by ensuring the address+queue definition is anycat, or changing the broker side address settings [1][2] so anything auto-created is considered 'anycast', or you could alternatively add a 'queue' type hint into the consumer by setting the type option into the consumer address string when creating the receiver (from other threads I think "my-queue; { node:{ type: queue }}" is the format of that).
>
> [1] 
> https://activemq.apache.org/components/artemis/documentation/latest/ad
> dress-model.html [2] 
> https://activemq.apache.org/components/artemis/documentation/latest/ad
> dress-settings.html
>
>
>
> On Thu, 31 Mar 2022 at 13:47, Rahul.Singh5@morganstanley.com <Ra...@morganstanley.com> wrote:
> >
> > Many thanks Gordon. I tried using the selector while creating the 
> > Receiver for response queue (as per the example given
> > https://lists.apache.org/thread/95ozl3hxf0cqzt0nxgbvwroddx39kq1w)
> > However, I get below exception -
> > std::exception Link detached by peer with amqp:unauthorized-access: AMQ119015: not authorized to create consumer, AMQ229032: User: FOOBAR does not have permission='CREATE_ADDRESS' on address 'XXXXX.ResQueue_L'
> >
> > Best Regards,
> > Rahul
> >
> > -----Original Message-----
> > From: Gordon Sim <gs...@redhat.com>
> > Sent: 31 March 2022 12:06
> > To: users@qpid.apache.org
> > Subject: Re: QPID C++ Queue handling
> >
> > On Thu, Mar 31, 2022 at 11:30 AM Rahul.Singh5@morganstanley.com <Ra...@morganstanley.com> wrote:
> > > 2) For the longer term/better solution, I will start looking into selector. Is this within qpid C++ or proton layer. Any quick pointer will be highly appreciated.
> >
> > For proton C++:
> > https://github.com/apache/qpid-proton/blob/main/cpp/examples/selecte
> > d_
> > recv.cpp
> >
> > For example with the old qpid::messaging API see e.g.
> > https://lists.apache.org/thread/95ozl3hxf0cqzt0nxgbvwroddx39kq1w
> >
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For 
> > additional commands, e-mail: users-help@qpid.apache.org
> >
> >
> > --------------------------------------------------------------------
> > --
> > ----------
> > NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers  If you cannot access these links, please notify us by reply message and we will send the contents to you. By communicating with Morgan Stanley you consent to the foregoing and to the voice recording of conversations with personnel of Morgan Stanley.
> >
> > You may have certain rights regarding the information that Morgan Stanley collects about you.  Please see our Privacy Pledge https://www.morganstanley.com/privacy-pledge for more information about your rights.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For 
> additional commands, e-mail: users-help@qpid.apache.org
>
>
> ----------------------------------------------------------------------
> ----------
> NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers  If you cannot access these links, please notify us by reply message and we will send the contents to you. By communicating with Morgan Stanley you consent to the foregoing and to the voice recording of conversations with personnel of Morgan Stanley.
>
> You may have certain rights regarding the information that Morgan Stanley collects about you.  Please see our Privacy Pledge https://www.morganstanley.com/privacy-pledge for more information about your rights.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For 
> additional commands, e-mail: users-help@qpid.apache.org
>
>
> ----------------------------------------------------------------------
> ----------
> NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers  If you cannot access these links, please notify us by reply message and we will send the contents to you. By communicating with Morgan Stanley you consent to the foregoing and to the voice recording of conversations with personnel of Morgan Stanley.
>
> You may have certain rights regarding the information that Morgan Stanley collects about you.  Please see our Privacy Pledge https://www.morganstanley.com/privacy-pledge for more information about your rights.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For 
> additional commands, e-mail: users-help@qpid.apache.org
>

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


--------------------------------------------------------------------------------
NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers  If you cannot access these links, please notify us by reply message and we will send the contents to you. By communicating with Morgan Stanley you consent to the foregoing and to the voice recording of conversations with personnel of Morgan Stanley.

You may have certain rights regarding the information that Morgan Stanley collects about you.  Please see our Privacy Pledge https://www.morganstanley.com/privacy-pledge for more information about your rights.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: RE: QPID C++ Queue handling

Posted by Robbie Gemmell <ro...@gmail.com>.
Neither the queue name or the type capability (which given you found
the problem, you may not need) should have ' ' in the actual value,
per the various [address string] examples that lack that.

The selector will have ' ' around values that happen to be a string
literal, since that is the syntax for string literals within
selectors, essentially like the JMS selector syntax. It is the server
that does the selection.

The server will provide a copy of every message sent to the topic to
each subscription on the topic (i.e each subscriber if they aren't
shared subs), that is how pub/sub topics work. The client does nothing
special.

On Fri, 1 Apr 2022 at 13:31, Rahul.Singh5@morganstanley.com
<Ra...@morganstanley.com> wrote:
>
> Hello,
> I managed to get this message selection working. Basically, the queue address need not be enclosed in ' '. So, hopefully the filtering for queue is working now. I will get a chance to test this on Monday with the other instance.
>
> However, we might still need to solve the problem for topics where messages are broadcast and we would like all subscribers to receive them. In case of broadcasts, we do not receive any uniqueAppID. They are available in specific topic address. Different instances would need these broadcasts. So, we would want qpid to put them in all receivers which subscribed to that topic. Please can you help how this can be achieved or in case of topic, does the qpid by default copies the message in all the subscribed receivers.
>
> Best Regards,
> Rahul
>
> -----Original Message-----
> From: Rahul.Singh5@morganstanley.com <Ra...@morganstanley.com>
> Sent: 01 April 2022 11:03
> To: users@qpid.apache.org
> Subject: <Unverified Sender>RE: QPID C++ Queue handling
>
>
> I tired various combination to pass the information to selector however I keep on getting same error. Please see below code and Protocol traces in case there is something you can quickly spot.
>
> Code -
> Map selector;
> std::string uniqueAppIdSelector = "\"uniqueAppID\"='" + _appId + "'"; selector["selector"] = uniqueAppIdSelector; Map options; options["link"] = selector; Address address(resp_queue, "", options, "'queue'"); //Address address(resp_queue, "", options, "'queue'"); //Address address(resp_queue, "", options); _receiver = _session.createReceiver(address);
>
> In the PROTOCCOL TRACE, I see - filter={:selector=@77567109365764 ""uniqueAppID"= 'XXXXX_UNIQUE_APP_ID'"}, capabilities=:"'queue'"]. I tried other combinations like
>
> Where I pass queue as "queue" without ' '. //Address address(resp_queue, "", options, "queue"); PROTOCOL TRACE -
> filter={:selector=@77567109365764 ""uniqueAppID"= 'XXXXX_UNIQUE_APP_ID'"}, capabilities=:queue]
>
> OR without passing type argument to address. //Address address(resp_queue, "", options);
> filter={:selector=@77567109365764 ""uniqueAppID"='XXXXX_UNIQUE_APP_ID'"}]
>
> [Protocol] trace [XXXXX_UNIQUE_APP_ID]: FRAME: 0 -> @attach(18) [name="'XXXXX.ResQueue_L'_c2928ec1-0937-4f84-a61f-90712c837f1a", handle=1, role=true, snd-settle-mode=2, rcv-settle-mode=0, source=@source(40) [address="'XXXXX.ResQueue_L'", durable=0, timeout=0, dynamic=false, filter={:selector=@77567109365764 ""uniqueAppID"= 'XXXXX_UNIQUE_APP_ID'"}, capabilities=:"'queue'"], target=@target(41) [address="'XXXXX.ResQueue_L'", durable=0, timeout=0, dynamic=false], initial-delivery-count=0, max-message-size=0]
>
> 2022-04-01 10:18:16 [Protocol] trace [XXXXX_UNIQUE_APP_ID]: FRAME: 0 <- @detach(22) [handle=1, closed=true, error=@error(29) [condition=:"amqp:unauthorized-access", description="AMQ119015: not authorized to create consumer, AMQ229032: User: XXXXX_USER does not have permission='CREATE_ADDRESS' on address 'XXXXX.ResQueue_L'"]]
>
> Best Regards,
> Rahul
>
> -----Original Message-----
> From: Robbie Gemmell <ro...@gmail.com>
> Sent: 31 March 2022 16:33
> To: users <us...@qpid.apache.org>
> Subject: Re: QPID C++ Queue handling
>
>  Its hard to say much without knowing exactly what you did, the linked thread has a few different things in it.
>
> The error suggests you are using Artemis and it is trying (and failing due to permissions) to create an Address, which I wouldnt really expect if you are consuming from an already known response queue, one that I would assume already existed.
>
> You might need to ensure the broker actually treats the things as being an 'anycast' queue and treats the consumer as a regular queue consumer, as I know Artemis typically defaults to treating things as 'multicast' for more topic-like behaviour, which might be a problematic if you have different consumers with different selectors.
> You can do that either by ensuring the address+queue definition is anycat, or changing the broker side address settings [1][2] so anything auto-created is considered 'anycast', or you could alternatively add a 'queue' type hint into the consumer by setting the type option into the consumer address string when creating the receiver (from other threads I think "my-queue; { node:{ type: queue }}" is the format of that).
>
> [1] https://activemq.apache.org/components/artemis/documentation/latest/address-model.html
> [2] https://activemq.apache.org/components/artemis/documentation/latest/address-settings.html
>
>
>
> On Thu, 31 Mar 2022 at 13:47, Rahul.Singh5@morganstanley.com <Ra...@morganstanley.com> wrote:
> >
> > Many thanks Gordon. I tried using the selector while creating the
> > Receiver for response queue (as per the example given
> > https://lists.apache.org/thread/95ozl3hxf0cqzt0nxgbvwroddx39kq1w)
> > However, I get below exception -
> > std::exception Link detached by peer with amqp:unauthorized-access: AMQ119015: not authorized to create consumer, AMQ229032: User: FOOBAR does not have permission='CREATE_ADDRESS' on address 'XXXXX.ResQueue_L'
> >
> > Best Regards,
> > Rahul
> >
> > -----Original Message-----
> > From: Gordon Sim <gs...@redhat.com>
> > Sent: 31 March 2022 12:06
> > To: users@qpid.apache.org
> > Subject: Re: QPID C++ Queue handling
> >
> > On Thu, Mar 31, 2022 at 11:30 AM Rahul.Singh5@morganstanley.com <Ra...@morganstanley.com> wrote:
> > > 2) For the longer term/better solution, I will start looking into selector. Is this within qpid C++ or proton layer. Any quick pointer will be highly appreciated.
> >
> > For proton C++:
> > https://github.com/apache/qpid-proton/blob/main/cpp/examples/selected_
> > recv.cpp
> >
> > For example with the old qpid::messaging API see e.g.
> > https://lists.apache.org/thread/95ozl3hxf0cqzt0nxgbvwroddx39kq1w
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For
> > additional commands, e-mail: users-help@qpid.apache.org
> >
> >
> > ----------------------------------------------------------------------
> > ----------
> > NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers  If you cannot access these links, please notify us by reply message and we will send the contents to you. By communicating with Morgan Stanley you consent to the foregoing and to the voice recording of conversations with personnel of Morgan Stanley.
> >
> > You may have certain rights regarding the information that Morgan Stanley collects about you.  Please see our Privacy Pledge https://www.morganstanley.com/privacy-pledge for more information about your rights.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For additional commands, e-mail: users-help@qpid.apache.org
>
>
> --------------------------------------------------------------------------------
> NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers  If you cannot access these links, please notify us by reply message and we will send the contents to you. By communicating with Morgan Stanley you consent to the foregoing and to the voice recording of conversations with personnel of Morgan Stanley.
>
> You may have certain rights regarding the information that Morgan Stanley collects about you.  Please see our Privacy Pledge https://www.morganstanley.com/privacy-pledge for more information about your rights.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For additional commands, e-mail: users-help@qpid.apache.org
>
>
> --------------------------------------------------------------------------------
> NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers  If you cannot access these links, please notify us by reply message and we will send the contents to you. By communicating with Morgan Stanley you consent to the foregoing and to the voice recording of conversations with personnel of Morgan Stanley.
>
> You may have certain rights regarding the information that Morgan Stanley collects about you.  Please see our Privacy Pledge https://www.morganstanley.com/privacy-pledge for more information about your rights.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>

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


RE: RE: QPID C++ Queue handling

Posted by "Rahul.Singh5@morganstanley.com" <Ra...@morganstanley.com>.
Hello, 
I managed to get this message selection working. Basically, the queue address need not be enclosed in ' '. So, hopefully the filtering for queue is working now. I will get a chance to test this on Monday with the other instance.

However, we might still need to solve the problem for topics where messages are broadcast and we would like all subscribers to receive them. In case of broadcasts, we do not receive any uniqueAppID. They are available in specific topic address. Different instances would need these broadcasts. So, we would want qpid to put them in all receivers which subscribed to that topic. Please can you help how this can be achieved or in case of topic, does the qpid by default copies the message in all the subscribed receivers. 

Best Regards,
Rahul

-----Original Message-----
From: Rahul.Singh5@morganstanley.com <Ra...@morganstanley.com> 
Sent: 01 April 2022 11:03
To: users@qpid.apache.org
Subject: <Unverified Sender>RE: QPID C++ Queue handling


I tired various combination to pass the information to selector however I keep on getting same error. Please see below code and Protocol traces in case there is something you can quickly spot.

Code -
Map selector;
std::string uniqueAppIdSelector = "\"uniqueAppID\"='" + _appId + "'"; selector["selector"] = uniqueAppIdSelector; Map options; options["link"] = selector; Address address(resp_queue, "", options, "'queue'"); //Address address(resp_queue, "", options, "'queue'"); //Address address(resp_queue, "", options); _receiver = _session.createReceiver(address);

In the PROTOCCOL TRACE, I see - filter={:selector=@77567109365764 ""uniqueAppID"= 'XXXXX_UNIQUE_APP_ID'"}, capabilities=:"'queue'"]. I tried other combinations like

Where I pass queue as "queue" without ' '. //Address address(resp_queue, "", options, "queue"); PROTOCOL TRACE -
filter={:selector=@77567109365764 ""uniqueAppID"= 'XXXXX_UNIQUE_APP_ID'"}, capabilities=:queue]

OR without passing type argument to address. //Address address(resp_queue, "", options);
filter={:selector=@77567109365764 ""uniqueAppID"='XXXXX_UNIQUE_APP_ID'"}]

[Protocol] trace [XXXXX_UNIQUE_APP_ID]: FRAME: 0 -> @attach(18) [name="'XXXXX.ResQueue_L'_c2928ec1-0937-4f84-a61f-90712c837f1a", handle=1, role=true, snd-settle-mode=2, rcv-settle-mode=0, source=@source(40) [address="'XXXXX.ResQueue_L'", durable=0, timeout=0, dynamic=false, filter={:selector=@77567109365764 ""uniqueAppID"= 'XXXXX_UNIQUE_APP_ID'"}, capabilities=:"'queue'"], target=@target(41) [address="'XXXXX.ResQueue_L'", durable=0, timeout=0, dynamic=false], initial-delivery-count=0, max-message-size=0]

2022-04-01 10:18:16 [Protocol] trace [XXXXX_UNIQUE_APP_ID]: FRAME: 0 <- @detach(22) [handle=1, closed=true, error=@error(29) [condition=:"amqp:unauthorized-access", description="AMQ119015: not authorized to create consumer, AMQ229032: User: XXXXX_USER does not have permission='CREATE_ADDRESS' on address 'XXXXX.ResQueue_L'"]]

Best Regards,
Rahul

-----Original Message-----
From: Robbie Gemmell <ro...@gmail.com>
Sent: 31 March 2022 16:33
To: users <us...@qpid.apache.org>
Subject: Re: QPID C++ Queue handling

 Its hard to say much without knowing exactly what you did, the linked thread has a few different things in it.

The error suggests you are using Artemis and it is trying (and failing due to permissions) to create an Address, which I wouldnt really expect if you are consuming from an already known response queue, one that I would assume already existed.

You might need to ensure the broker actually treats the things as being an 'anycast' queue and treats the consumer as a regular queue consumer, as I know Artemis typically defaults to treating things as 'multicast' for more topic-like behaviour, which might be a problematic if you have different consumers with different selectors.
You can do that either by ensuring the address+queue definition is anycat, or changing the broker side address settings [1][2] so anything auto-created is considered 'anycast', or you could alternatively add a 'queue' type hint into the consumer by setting the type option into the consumer address string when creating the receiver (from other threads I think "my-queue; { node:{ type: queue }}" is the format of that).

[1] https://activemq.apache.org/components/artemis/documentation/latest/address-model.html
[2] https://activemq.apache.org/components/artemis/documentation/latest/address-settings.html



On Thu, 31 Mar 2022 at 13:47, Rahul.Singh5@morganstanley.com <Ra...@morganstanley.com> wrote:
>
> Many thanks Gordon. I tried using the selector while creating the 
> Receiver for response queue (as per the example given
> https://lists.apache.org/thread/95ozl3hxf0cqzt0nxgbvwroddx39kq1w)
> However, I get below exception -
> std::exception Link detached by peer with amqp:unauthorized-access: AMQ119015: not authorized to create consumer, AMQ229032: User: FOOBAR does not have permission='CREATE_ADDRESS' on address 'XXXXX.ResQueue_L'
>
> Best Regards,
> Rahul
>
> -----Original Message-----
> From: Gordon Sim <gs...@redhat.com>
> Sent: 31 March 2022 12:06
> To: users@qpid.apache.org
> Subject: Re: QPID C++ Queue handling
>
> On Thu, Mar 31, 2022 at 11:30 AM Rahul.Singh5@morganstanley.com <Ra...@morganstanley.com> wrote:
> > 2) For the longer term/better solution, I will start looking into selector. Is this within qpid C++ or proton layer. Any quick pointer will be highly appreciated.
>
> For proton C++:
> https://github.com/apache/qpid-proton/blob/main/cpp/examples/selected_
> recv.cpp
>
> For example with the old qpid::messaging API see e.g.
> https://lists.apache.org/thread/95ozl3hxf0cqzt0nxgbvwroddx39kq1w
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For 
> additional commands, e-mail: users-help@qpid.apache.org
>
>
> ----------------------------------------------------------------------
> ----------
> NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers  If you cannot access these links, please notify us by reply message and we will send the contents to you. By communicating with Morgan Stanley you consent to the foregoing and to the voice recording of conversations with personnel of Morgan Stanley.
>
> You may have certain rights regarding the information that Morgan Stanley collects about you.  Please see our Privacy Pledge https://www.morganstanley.com/privacy-pledge for more information about your rights.

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


--------------------------------------------------------------------------------
NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers  If you cannot access these links, please notify us by reply message and we will send the contents to you. By communicating with Morgan Stanley you consent to the foregoing and to the voice recording of conversations with personnel of Morgan Stanley.

You may have certain rights regarding the information that Morgan Stanley collects about you.  Please see our Privacy Pledge https://www.morganstanley.com/privacy-pledge for more information about your rights.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For additional commands, e-mail: users-help@qpid.apache.org


--------------------------------------------------------------------------------
NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers  If you cannot access these links, please notify us by reply message and we will send the contents to you. By communicating with Morgan Stanley you consent to the foregoing and to the voice recording of conversations with personnel of Morgan Stanley.

You may have certain rights regarding the information that Morgan Stanley collects about you.  Please see our Privacy Pledge https://www.morganstanley.com/privacy-pledge for more information about your rights.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


RE: QPID C++ Queue handling

Posted by "Rahul.Singh5@morganstanley.com" <Ra...@morganstanley.com>.
I tired various combination to pass the information to selector however I keep on getting same error. Please see below code and Protocol traces in case there is something you can quickly spot.

Code - 
Map selector;
std::string uniqueAppIdSelector = "\"uniqueAppID\"='" + _appId + "'";
selector["selector"] = uniqueAppIdSelector;
Map options;
options["link"] = selector;
Address address(resp_queue, "", options, "'queue'");
//Address address(resp_queue, "", options, "'queue'");    
//Address address(resp_queue, "", options);    
_receiver = _session.createReceiver(address);

In the PROTOCCOL TRACE, I see - filter={:selector=@77567109365764 ""uniqueAppID"= 'XXXXX_UNIQUE_APP_ID'"}, capabilities=:"'queue'"]. I tried other combinations like 

Where I pass queue as "queue" without ' '. //Address address(resp_queue, "", options, "queue");    
PROTOCOL TRACE -
filter={:selector=@77567109365764 ""uniqueAppID"= 'XXXXX_UNIQUE_APP_ID'"}, capabilities=:queue] 

OR without passing type argument to address. //Address address(resp_queue, "", options);    
filter={:selector=@77567109365764 ""uniqueAppID"='XXXXX_UNIQUE_APP_ID'"}]

[Protocol] trace [XXXXX_UNIQUE_APP_ID]: FRAME: 0 -> @attach(18) [name="'XXXXX.ResQueue_L'_c2928ec1-0937-4f84-a61f-90712c837f1a", handle=1, role=true, snd-settle-mode=2, rcv-settle-mode=0, source=@source(40) [address="'XXXXX.ResQueue_L'", durable=0, timeout=0, dynamic=false, filter={:selector=@77567109365764 ""uniqueAppID"= 'XXXXX_UNIQUE_APP_ID'"}, capabilities=:"'queue'"], target=@target(41) [address="'XXXXX.ResQueue_L'", durable=0, timeout=0, dynamic=false], initial-delivery-count=0, max-message-size=0]

2022-04-01 10:18:16 [Protocol] trace [XXXXX_UNIQUE_APP_ID]: FRAME: 0 <- @detach(22) [handle=1, closed=true, error=@error(29) [condition=:"amqp:unauthorized-access", description="AMQ119015: not authorized to create consumer, AMQ229032: User: XXXXX_USER does not have permission='CREATE_ADDRESS' on address 'XXXXX.ResQueue_L'"]]

Best Regards,
Rahul

-----Original Message-----
From: Robbie Gemmell <ro...@gmail.com> 
Sent: 31 March 2022 16:33
To: users <us...@qpid.apache.org>
Subject: Re: QPID C++ Queue handling

 Its hard to say much without knowing exactly what you did, the linked thread has a few different things in it.

The error suggests you are using Artemis and it is trying (and failing due to permissions) to create an Address, which I wouldnt really expect if you are consuming from an already known response queue, one that I would assume already existed.

You might need to ensure the broker actually treats the things as being an 'anycast' queue and treats the consumer as a regular queue consumer, as I know Artemis typically defaults to treating things as 'multicast' for more topic-like behaviour, which might be a problematic if you have different consumers with different selectors.
You can do that either by ensuring the address+queue definition is anycat, or changing the broker side address settings [1][2] so anything auto-created is considered 'anycast', or you could alternatively add a 'queue' type hint into the consumer by setting the type option into the consumer address string when creating the receiver (from other threads I think "my-queue; { node:{ type: queue }}" is the format of that).

[1] https://activemq.apache.org/components/artemis/documentation/latest/address-model.html
[2] https://activemq.apache.org/components/artemis/documentation/latest/address-settings.html



On Thu, 31 Mar 2022 at 13:47, Rahul.Singh5@morganstanley.com <Ra...@morganstanley.com> wrote:
>
> Many thanks Gordon. I tried using the selector while creating the 
> Receiver for response queue (as per the example given 
> https://lists.apache.org/thread/95ozl3hxf0cqzt0nxgbvwroddx39kq1w)
> However, I get below exception -
> std::exception Link detached by peer with amqp:unauthorized-access: AMQ119015: not authorized to create consumer, AMQ229032: User: FOOBAR does not have permission='CREATE_ADDRESS' on address 'XXXXX.ResQueue_L'
>
> Best Regards,
> Rahul
>
> -----Original Message-----
> From: Gordon Sim <gs...@redhat.com>
> Sent: 31 March 2022 12:06
> To: users@qpid.apache.org
> Subject: Re: QPID C++ Queue handling
>
> On Thu, Mar 31, 2022 at 11:30 AM Rahul.Singh5@morganstanley.com <Ra...@morganstanley.com> wrote:
> > 2) For the longer term/better solution, I will start looking into selector. Is this within qpid C++ or proton layer. Any quick pointer will be highly appreciated.
>
> For proton C++:
> https://github.com/apache/qpid-proton/blob/main/cpp/examples/selected_
> recv.cpp
>
> For example with the old qpid::messaging API see e.g.
> https://lists.apache.org/thread/95ozl3hxf0cqzt0nxgbvwroddx39kq1w
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For 
> additional commands, e-mail: users-help@qpid.apache.org
>
>
> ----------------------------------------------------------------------
> ----------
> NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers  If you cannot access these links, please notify us by reply message and we will send the contents to you. By communicating with Morgan Stanley you consent to the foregoing and to the voice recording of conversations with personnel of Morgan Stanley.
>
> You may have certain rights regarding the information that Morgan Stanley collects about you.  Please see our Privacy Pledge https://www.morganstanley.com/privacy-pledge for more information about your rights.

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


--------------------------------------------------------------------------------
NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers  If you cannot access these links, please notify us by reply message and we will send the contents to you. By communicating with Morgan Stanley you consent to the foregoing and to the voice recording of conversations with personnel of Morgan Stanley.

You may have certain rights regarding the information that Morgan Stanley collects about you.  Please see our Privacy Pledge https://www.morganstanley.com/privacy-pledge for more information about your rights.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: QPID C++ Queue handling

Posted by Robbie Gemmell <ro...@gmail.com>.
 Its hard to say much without knowing exactly what you did, the linked
thread has a few different things in it.

The error suggests you are using Artemis and it is trying (and failing
due to permissions) to create an Address, which I wouldnt really
expect if you are consuming from an already known response queue, one
that I would assume already existed.

You might need to ensure the broker actually treats the things as
being an 'anycast' queue and treats the consumer as a regular queue
consumer, as I know Artemis typically defaults to treating things as
'multicast' for more topic-like behaviour, which might be a
problematic if you have different consumers with different selectors.
You can do that either by ensuring the address+queue definition is
anycat, or changing the broker side address settings [1][2] so
anything auto-created is considered 'anycast', or you could
alternatively add a 'queue' type hint into the consumer by setting the
type option into the consumer address string when creating the
receiver (from other threads I think "my-queue; { node:{ type: queue
}}" is the format of that).

[1] https://activemq.apache.org/components/artemis/documentation/latest/address-model.html
[2] https://activemq.apache.org/components/artemis/documentation/latest/address-settings.html



On Thu, 31 Mar 2022 at 13:47, Rahul.Singh5@morganstanley.com
<Ra...@morganstanley.com> wrote:
>
> Many thanks Gordon. I tried using the selector while creating the Receiver for response queue (as per the example given https://lists.apache.org/thread/95ozl3hxf0cqzt0nxgbvwroddx39kq1w)
> However, I get below exception -
> std::exception Link detached by peer with amqp:unauthorized-access: AMQ119015: not authorized to create consumer, AMQ229032: User: FOOBAR does not have permission='CREATE_ADDRESS' on address 'XXXXX.ResQueue_L'
>
> Best Regards,
> Rahul
>
> -----Original Message-----
> From: Gordon Sim <gs...@redhat.com>
> Sent: 31 March 2022 12:06
> To: users@qpid.apache.org
> Subject: Re: QPID C++ Queue handling
>
> On Thu, Mar 31, 2022 at 11:30 AM Rahul.Singh5@morganstanley.com <Ra...@morganstanley.com> wrote:
> > 2) For the longer term/better solution, I will start looking into selector. Is this within qpid C++ or proton layer. Any quick pointer will be highly appreciated.
>
> For proton C++:
> https://github.com/apache/qpid-proton/blob/main/cpp/examples/selected_recv.cpp
>
> For example with the old qpid::messaging API see e.g.
> https://lists.apache.org/thread/95ozl3hxf0cqzt0nxgbvwroddx39kq1w
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org For additional commands, e-mail: users-help@qpid.apache.org
>
>
> --------------------------------------------------------------------------------
> NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers  If you cannot access these links, please notify us by reply message and we will send the contents to you. By communicating with Morgan Stanley you consent to the foregoing and to the voice recording of conversations with personnel of Morgan Stanley.
>
> You may have certain rights regarding the information that Morgan Stanley collects about you.  Please see our Privacy Pledge https://www.morganstanley.com/privacy-pledge for more information about your rights.

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


Re: QPID C++ Queue handling

Posted by Gordon Sim <gs...@redhat.com>.
On Thu, Mar 31, 2022 at 1:55 PM Rahul.Singh5@morganstanley.com
<Ra...@morganstanley.com> wrote:
>
> Many thanks Gordon. I tried using the selector while creating the Receiver for response queue (as per the example given https://lists.apache.org/thread/95ozl3hxf0cqzt0nxgbvwroddx39kq1w)
> However, I get below exception -
> std::exception Link detached by peer with amqp:unauthorized-access: AMQ119015: not authorized to create consumer, AMQ229032: User: FOOBAR does not have permission='CREATE_ADDRESS' on address 'XXXXX.ResQueue_L'


That sounds like a question for your broker support group. (If they
need it, you can see the protocol trace from the client by setting env
var QPID_LOG_ENABLE="trace+:Protocol")


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


RE: QPID C++ Queue handling

Posted by "Rahul.Singh5@morganstanley.com" <Ra...@morganstanley.com>.
Many thanks Gordon. I tried using the selector while creating the Receiver for response queue (as per the example given https://lists.apache.org/thread/95ozl3hxf0cqzt0nxgbvwroddx39kq1w)
However, I get below exception -
std::exception Link detached by peer with amqp:unauthorized-access: AMQ119015: not authorized to create consumer, AMQ229032: User: FOOBAR does not have permission='CREATE_ADDRESS' on address 'XXXXX.ResQueue_L'

Best Regards,
Rahul

-----Original Message-----
From: Gordon Sim <gs...@redhat.com> 
Sent: 31 March 2022 12:06
To: users@qpid.apache.org
Subject: Re: QPID C++ Queue handling

On Thu, Mar 31, 2022 at 11:30 AM Rahul.Singh5@morganstanley.com <Ra...@morganstanley.com> wrote:
> 2) For the longer term/better solution, I will start looking into selector. Is this within qpid C++ or proton layer. Any quick pointer will be highly appreciated.

For proton C++:
https://github.com/apache/qpid-proton/blob/main/cpp/examples/selected_recv.cpp

For example with the old qpid::messaging API see e.g.
https://lists.apache.org/thread/95ozl3hxf0cqzt0nxgbvwroddx39kq1w


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


--------------------------------------------------------------------------------
NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers  If you cannot access these links, please notify us by reply message and we will send the contents to you. By communicating with Morgan Stanley you consent to the foregoing and to the voice recording of conversations with personnel of Morgan Stanley.

You may have certain rights regarding the information that Morgan Stanley collects about you.  Please see our Privacy Pledge https://www.morganstanley.com/privacy-pledge for more information about your rights.

Re: QPID C++ Queue handling

Posted by Gordon Sim <gs...@redhat.com>.
On Thu, Mar 31, 2022 at 11:30 AM Rahul.Singh5@morganstanley.com
<Ra...@morganstanley.com> wrote:
> 2) For the longer term/better solution, I will start looking into selector. Is this within qpid C++ or proton layer. Any quick pointer will be highly appreciated.

For proton C++:
https://github.com/apache/qpid-proton/blob/main/cpp/examples/selected_recv.cpp

For example with the old qpid::messaging API see e.g.
https://lists.apache.org/thread/95ozl3hxf0cqzt0nxgbvwroddx39kq1w


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


RE: QPID C++ Queue handling

Posted by "Rahul.Singh5@morganstanley.com" <Ra...@morganstanley.com>.
Many thanks Gordon and Robbie for your suggestions. 
1) For the quick turnaround, I am going to use the logic of acknowledge vs release depending whether the message belongs to my instance or not.
2) For the longer term/better solution, I will start looking into selector. Is this within qpid C++ or proton layer. Any quick pointer will be highly appreciated.

Best regards,
Rahul 

-----Original Message-----
From: Gordon Sim <gs...@redhat.com> 
Sent: 31 March 2022 11:15
To: users@qpid.apache.org
Subject: Re: QPID C++ Queue handling

On Thu, Mar 31, 2022 at 11:06 AM Rahul.Singh5@morganstanley.com <Ra...@morganstanley.com> wrote:
> How do we ensure the first receiver has released it? Is it invocation of Session::acknowledge(msg) which makes it available to other receivers?

No, acknowledging the message will remove it permanently from the queue. To release you need to use Session::relese(msg). However it is always possible that the broker will allocate the same message to you again, so there can be some inefficiency involved.

Are you able to use a selector? That way your receivers could select only those messages with the appropriate value(s) for APPId.

> What difference will it make if we use Receiver::get() instead of Receiver::fetch() ?

In this context none at all. The difference there is simply how the client handles the case where it has no prefetched message available.


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


--------------------------------------------------------------------------------
NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers  If you cannot access these links, please notify us by reply message and we will send the contents to you. By communicating with Morgan Stanley you consent to the foregoing and to the voice recording of conversations with personnel of Morgan Stanley.

You may have certain rights regarding the information that Morgan Stanley collects about you.  Please see our Privacy Pledge https://www.morganstanley.com/privacy-pledge for more information about your rights.

Re: QPID C++ Queue handling

Posted by Gordon Sim <gs...@redhat.com>.
On Thu, Mar 31, 2022 at 11:06 AM Rahul.Singh5@morganstanley.com
<Ra...@morganstanley.com> wrote:
> How do we ensure the first receiver has released it? Is it invocation of Session::acknowledge(msg) which makes it available to other receivers?

No, acknowledging the message will remove it permanently from the
queue. To release you need to use Session::relese(msg). However it is
always possible that the broker will allocate the same message to you
again, so there can be some inefficiency involved.

Are you able to use a selector? That way your receivers could select
only those messages with the appropriate value(s) for APPId.

> What difference will it make if we use Receiver::get() instead of Receiver::fetch() ?

In this context none at all. The difference there is simply how the
client handles the case where it has no prefetched message available.


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


RE: QPID C++ Queue handling

Posted by "Rahul.Singh5@morganstanley.com" <Ra...@morganstanley.com>.
Hello Gordon,
We cannot control the broker behaviour unfortunately.

Regarding your point -
>>>>There is the concept of a delivery mode, but no way to 'acquire' a copied message. For the default 'move' distribution mode, on a shared queue, a message will be allocated to one of the available receivers and from that point will not be available to any other receiver until the first receiver releases it.

How do we ensure the first receiver has released it? Is it invocation of Session::acknowledge(msg) which makes it available to other receivers?
What difference will it make if we use Receiver::get() instead of Receiver::fetch() ?

Best Regards,
Rahul

-----Original Message-----
From: Gordon Sim <gs...@redhat.com> 
Sent: 31 March 2022 10:52
To: users@qpid.apache.org
Subject: Re: QPID C++ Queue handling

AMQP 1.0 doesn't really support what you are trying to do, which if I understand it correctly, is to have many receivers peek at messages in the queue and only remove those that are relevant to them. There is the concept of a delivery mode, but no way to 'acquire' a copied message. For the default 'move' distribution mode, on a shared queue, a message will be allocated to one of the available receivers and from that point will not be available to any other receiver until the first receiver releases it.

The better pattern in my opinion is to have the broker filter the messages into a separate response queue per receiver. Perhaps that is per unique APPId in your case.

On Thu, Mar 31, 2022 at 9:39 AM Rahul.Singh5@morganstanley.com <Ra...@morganstanley.com> wrote:
>
> Hel
> We are using C++ API - qpid-cpp-1.39.0 and qpid-proton-0.34.0 and seems to have an issue handling multiple instances of application (using different implementations).
> The broker supplies all messages to our entity in 1 Response Queue and there are uniqueAPPId to identify the messages received in Response Queue.
>
> However, at times, only 1 instance seems to get these messages. We 
> suspect it's the way we retrieve the messages from the queue. Our 
> current logic is Using namespace qpid::messaging; Message msg; 
> If(Receiver::fetch (msg, Duration(0))) {
>         //process the message if unqiueAppId is ours
>
>         //Acknowledge the message
>        Session::acknowledge(msg);
> }
>
> Is this the correct way of handling the messages form Response Queue?
>
>
>   1.  We had a look at description for Receiver::get() and it indicates that the message is retrieved from the Receiver's local Queue.
> For Receiver::fetch(), the description says "Retrieves the message 
> from Receiver's Subscription. Unlike get(), this message will check with the server that there is no message for the subscription this Receiver is serving before returning false. Is the Receiver::fetch method popping the message off the Response Queue as opposed to Receiver::get () method.
>
>   1.  Whats the purpose of Session::acknowledge(msg) ? Does it pop the message off the Response Queue.
>
> We want to only pull the message off the queue which are destined to our instance. Otherwise, we don't want to remove them since this might affect other instances.
>
> Please can you help in throwing some light on how to get this logic right.
>
> Best Regards,
> Rahul
>
> ________________________________
> NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent required and/or permitted under applicable law, to monitor electronic communications, including telephone calls with Morgan Stanley personnel. This message is subject to the Morgan Stanley General Disclaimers available at the following link: http://www.morganstanley.com/disclaimers.  If you cannot access the links, please notify us by reply message and we will send the contents to you. By communicating with Morgan Stanley you acknowledge that you have read, understand and consent, (where applicable), to the foregoing and the Morgan Stanley General Disclaimers.
>
> You may have certain rights regarding the information that Morgan Stanley collects about you. Please see our Privacy Pledge https://www.morganstanley.com/privacy-pledge for more information about your rights.


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


--------------------------------------------------------------------------------
NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers  If you cannot access these links, please notify us by reply message and we will send the contents to you. By communicating with Morgan Stanley you consent to the foregoing and to the voice recording of conversations with personnel of Morgan Stanley.

You may have certain rights regarding the information that Morgan Stanley collects about you.  Please see our Privacy Pledge https://www.morganstanley.com/privacy-pledge for more information about your rights.

Re: QPID C++ Queue handling

Posted by Gordon Sim <gs...@redhat.com>.
AMQP 1.0 doesn't really support what you are trying to do, which if I
understand it correctly, is to have many receivers peek at messages in
the queue and only remove those that are relevant to them. There is
the concept of a delivery mode, but no way to 'acquire' a copied
message. For the default 'move' distribution mode, on a shared queue,
a message will be allocated to one of the available receivers and from
that point will not be available to any other receiver until the first
receiver releases it.

The better pattern in my opinion is to have the broker filter the
messages into a separate response queue per receiver. Perhaps that is
per unique APPId in your case.

On Thu, Mar 31, 2022 at 9:39 AM Rahul.Singh5@morganstanley.com
<Ra...@morganstanley.com> wrote:
>
> Hel
> We are using C++ API - qpid-cpp-1.39.0 and qpid-proton-0.34.0 and seems to have an issue handling multiple instances of application (using different implementations).
> The broker supplies all messages to our entity in 1 Response Queue and there are uniqueAPPId to identify the messages received in Response Queue.
>
> However, at times, only 1 instance seems to get these messages. We suspect it's the way we retrieve the messages from the queue. Our current logic is
> Using namespace qpid::messaging;
> Message msg;
> If(Receiver::fetch (msg, Duration(0)))
> {
>         //process the message if unqiueAppId is ours
>
>         //Acknowledge the message
>        Session::acknowledge(msg);
> }
>
> Is this the correct way of handling the messages form Response Queue?
>
>
>   1.  We had a look at description for Receiver::get() and it indicates that the message is retrieved from the Receiver's local Queue.
> For Receiver::fetch(), the description says "Retrieves the message from Receiver's Subscription. Unlike get(), this message will check with the server that there is no message for the subscription this
> Receiver is serving before returning false. Is the Receiver::fetch method popping the message off the Response Queue as opposed to Receiver::get () method.
>
>   1.  Whats the purpose of Session::acknowledge(msg) ? Does it pop the message off the Response Queue.
>
> We want to only pull the message off the queue which are destined to our instance. Otherwise, we don't want to remove them since this might affect other instances.
>
> Please can you help in throwing some light on how to get this logic right.
>
> Best Regards,
> Rahul
>
> ________________________________
> NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent required and/or permitted under applicable law, to monitor electronic communications, including telephone calls with Morgan Stanley personnel. This message is subject to the Morgan Stanley General Disclaimers available at the following link: http://www.morganstanley.com/disclaimers.  If you cannot access the links, please notify us by reply message and we will send the contents to you. By communicating with Morgan Stanley you acknowledge that you have read, understand and consent, (where applicable), to the foregoing and the Morgan Stanley General Disclaimers.
>
> You may have certain rights regarding the information that Morgan Stanley collects about you. Please see our Privacy Pledge https://www.morganstanley.com/privacy-pledge for more information about your rights.


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


Re: QPID C++ Queue handling

Posted by Robbie Gemmell <ro...@gmail.com>.
With a queue, only 1 consumer gets a particular message at a time
until the message is consumed. If a consumer is given a message from
the queue (which may occur even before calling get or fetch, if there
is any prefetching being allowed, 'capacity' I think in the old C++
bits terminology) then no other consumer can get it while that
consumer has it, and if you fetch/get it from the consumer but dont
"//process the message if unqiueAppId is ours" as it is not yours,
then still no other consumer can get it, unless the one that did
releases its hold on the message (at which point that consumer may
even get it again).

The acknowledge call acknowledge/accepts consumption of the message,
i,e marks it consumed so it can be removed from the queue. If you
actually acknowledge a message then it is consumed and removed from
the queue, whether you actually processed it or not.

If you only want certain consumers to get certain messages, and other
consumers not to get them, then you would probably want to separate
them at the broker so they only ever go to the consumer of interest.
Either having a response queue for each app (as Gordon has now said
and you have ruled out, before I got back to finishing this mail
hehe), or by providing a message selector when creating consumers so
they can each only ever get the messages actually matching what they
want from the shared response queue.

The qpid-cpp C++ client is not being actively developed at this point,
so you should also consider looking at the Proton C++ client binding.

On Thu, 31 Mar 2022 at 09:31, Rahul.Singh5@morganstanley.com
<Ra...@morganstanley.com> wrote:
>
> Hel
> We are using C++ API - qpid-cpp-1.39.0 and qpid-proton-0.34.0 and seems to have an issue handling multiple instances of application (using different implementations).
> The broker supplies all messages to our entity in 1 Response Queue and there are uniqueAPPId to identify the messages received in Response Queue.
>
> However, at times, only 1 instance seems to get these messages. We suspect it's the way we retrieve the messages from the queue. Our current logic is
> Using namespace qpid::messaging;
> Message msg;
> If(Receiver::fetch (msg, Duration(0)))
> {
>         //process the message if unqiueAppId is ours
>
>         //Acknowledge the message
>        Session::acknowledge(msg);
> }
>
> Is this the correct way of handling the messages form Response Queue?
>
>
>   1.  We had a look at description for Receiver::get() and it indicates that the message is retrieved from the Receiver's local Queue.
> For Receiver::fetch(), the description says "Retrieves the message from Receiver's Subscription. Unlike get(), this message will check with the server that there is no message for the subscription this
> Receiver is serving before returning false. Is the Receiver::fetch method popping the message off the Response Queue as opposed to Receiver::get () method.
>
>   1.  Whats the purpose of Session::acknowledge(msg) ? Does it pop the message off the Response Queue.
>
> We want to only pull the message off the queue which are destined to our instance. Otherwise, we don't want to remove them since this might affect other instances.
>
> Please can you help in throwing some light on how to get this logic right.
>
> Best Regards,
> Rahul
>
> ________________________________
> NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent required and/or permitted under applicable law, to monitor electronic communications, including telephone calls with Morgan Stanley personnel. This message is subject to the Morgan Stanley General Disclaimers available at the following link: http://www.morganstanley.com/disclaimers.  If you cannot access the links, please notify us by reply message and we will send the contents to you. By communicating with Morgan Stanley you acknowledge that you have read, understand and consent, (where applicable), to the foregoing and the Morgan Stanley General Disclaimers.
>
> You may have certain rights regarding the information that Morgan Stanley collects about you. Please see our Privacy Pledge https://www.morganstanley.com/privacy-pledge for more information about your rights.

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