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.sin...@morganstanley.com <rahul.sin...@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 <robbie.gemm...@gmail.com> > Sent: 04 April 2022 11:45 > To: users <users@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.sin...@morganstanley.com > <rahul.sin...@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 <robbie.gemm...@gmail.com> > > Sent: 01 April 2022 14:57 > > To: users <users@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.sin...@morganstanley.com > > <rahul.sin...@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.sin...@morganstanley.com > > > <rahul.sin...@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 <robbie.gemm...@gmail.com> > > > Sent: 31 March 2022 16:33 > > > To: users <users@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.sin...@morganstanley.com > > > <rahul.sin...@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 <g...@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.sin...@morganstanley.com > > > > <rahul.sin...@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-unsubscr...@qpid.apache.org For > > > > additional commands, e-mail: users-h...@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-unsubscr...@qpid.apache.org For > > > additional commands, e-mail: users-h...@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-unsubscr...@qpid.apache.org For > > > additional commands, e-mail: users-h...@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-unsubscr...@qpid.apache.org For > > > additional commands, e-mail: users-h...@qpid.apache.org > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org For > > additional commands, e-mail: users-h...@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-unsubscr...@qpid.apache.org For > > additional commands, e-mail: users-h...@qpid.apache.org > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org For additional > commands, e-mail: users-h...@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-unsubscr...@qpid.apache.org > For additional commands, e-mail: users-h...@qpid.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org For additional commands, e-mail: users-h...@qpid.apache.org