Re: QPID C++ Subscribing to a topic

2021-07-02 Thread Gordon Sim
Use the Message:setContentObject()/getContentObject() methods and
supply the body as a qpid::types::Variant which lets you specify the
*encoding* as utf8, ensuring it is encoded correctly as a string for
AMQP 1.0 rather than bytes.

e.g. either:

qpid::types::Variant value(s[i], "utf8");
msg.setContentObject(value);

or:

msg.getContentObject() = s[i];
msg.getContentObject().setEncoding("utf8");


On Fri, Jul 2, 2021 at 12:18 PM rahul.sin...@morganstanley.com
 wrote:
>
> Many thanks for your responses. Using the single quote helped me to get this 
> working.
>
> Now I am trying to add a request to a queue. For this I create a sender and 
> receiver where I would send the request on 'queue://ID.RequestQueueExample' 
> and then receive any response from 'queue://ID.ResponseQueueExample'.
> Sender sender = session.createSender("'queue://ID.RequestQueueExample'");
> Receiver recv = session.createReceiver("'queue://ID.ResponseQueueExample'");
>
> Then I create a Message and set the necessary parameters and prepare the 
> Content as required.  The content needs to be in XML format which I populate 
> beforehand, extract it in a string and then invoke Message::setContent(str).
> I also tried setting the contentType to "utf8".  Not sure if we need to set 
> this to any other type?
> Here is an example of the string passed to Message::setContent(str) -
> 
>   
> ABCDE
> AB_CDE
>   
>   
> XYZ
>   
> 
>
> However, when I send the request, I receive back error from the broker in the 
> receiver queue complaining that the message format is incorrect. My suspicion 
> are -
>
> 1)  The content and contentType is not being set properly.
> 2)  I do not find the sender queue details in the outgoing AMQP frames.  In 
> the message, I set the Message::ReplyTo with the Receiver Queue Address. 
> After looking at some example AMPQ frames which seems to be taken from JMS, I 
> see that the outgoing frame also has the Sender queue address 
> 'queue://ID.ReqQueueExample' in the outgoing frame. I am not quite sure how 
> can I add that with the C++ QPID API. The Message class do not seem to have 
> that option.
>
> Any suggestions for the above 2 points would be highly appreciated.
>
> Best Regards,
> Rahul
> -Original Message-
> From: Robbie Gemmell 
> Sent: 01 July 2021 15:01
> To: users 
> Subject: Re: QPID C++ Subscribing to a topic
>
> On Thu, 1 Jul 2021 at 13:18, Gordon Sim  wrote:
> >
> > On Thu, Jul 1, 2021 at 1:08 PM rahul.sin...@morganstanley.com
> >  wrote:
> > >   1.  As per Robbie's suggestion, I have tried adding topic:// in the 
> > > past as well but the address and name selection gets chopped off from our 
> > > end (after topic: ) in the outgoing AMQP frame to Broker.
> > >
> > > Our Code -
> > > qpid::messaging::Receiver topic_receiver = 
> > > session.createReceiver("topic://ID.ExampleTopic; {node:{type:topic}}"
> > > ");
> >
> > You need some ugly quoting in there, netsed single quotes around the
> > address, e.g.:
> >
> >session.createReceiver("'topic://ID.ExampleTopic';
> > {node:{type:topic}}");
> >
> > That prevents the '/' being misinterpreted. (It has special meaning in
> > the qpid::messaging address syntax, which we don't want here).
> >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org For
> > additional commands, e-mail: users-h...@qpid.apache.org
> >
>
> What Gordon said with the quoting should work to get it to parse correctly, I 
> forgot about that being needed (as its not a combination I've really used 
> myself).
>
> Note I wasnt suggesting you do both the prefix and the 'type:topic'
> node config though, as I dont think ActiveMQ 5 actually looks for the 
> terminus 'topic' capability that adds, rather it uses the address name and 
> looks for a name prefix of "topic://" (something which e.g the JMS client 
> adds itself under the covers based on values the broker advertises at 
> connection open time).
>
> -
> 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

Re: QPID C++ Subscribing to a topic

2021-07-02 Thread Robbie Gemmell
UTF8 is not a content type, it is an encoding. The hello world example
does the following to have send the utf8 AMQP 'string' typed message
body, perhaps try that:
https://github.com/apache/qpid-cpp/blob/1.39.0/examples/messaging/hello_world.cpp#L46-L47

The JMS client stamps the destination address into the sent messages
'to' field to satisfy JMS behaviour for the JMSDestination header.
This shouldnt necessarily be needed with the C++ client, unless the
recipient specifically requires the value be present.

I've never seen that done with the old cpp client, but this file
references intercepting a special "x-amqp-to" message property name
that can be used to work with the value, perhaps try using that:
https://github.com/apache/qpid-cpp/blob/1.39.0/docs/amqp-1.0.txt#L137




On Fri, 2 Jul 2021 at 12:12, rahul.sin...@morganstanley.com
 wrote:
>
> Many thanks for your responses. Using the single quote helped me to get this 
> working.
>
> Now I am trying to add a request to a queue. For this I create a sender and 
> receiver where I would send the request on 'queue://ID.RequestQueueExample' 
> and then receive any response from 'queue://ID.ResponseQueueExample'.
> Sender sender = session.createSender("'queue://ID.RequestQueueExample'");
> Receiver recv = session.createReceiver("'queue://ID.ResponseQueueExample'");
>
> Then I create a Message and set the necessary parameters and prepare the 
> Content as required.  The content needs to be in XML format which I populate 
> beforehand, extract it in a string and then invoke Message::setContent(str).
> I also tried setting the contentType to "utf8".  Not sure if we need to set 
> this to any other type?
> Here is an example of the string passed to Message::setContent(str) -
> 
>   
> ABCDE
> AB_CDE
>   
>   
> XYZ
>   
> 
>
> However, when I send the request, I receive back error from the broker in the 
> receiver queue complaining that the message format is incorrect. My suspicion 
> are -
>
> 1)  The content and contentType is not being set properly.
> 2)  I do not find the sender queue details in the outgoing AMQP frames.  In 
> the message, I set the Message::ReplyTo with the Receiver Queue Address. 
> After looking at some example AMPQ frames which seems to be taken from JMS, I 
> see that the outgoing frame also has the Sender queue address 
> 'queue://ID.ReqQueueExample' in the outgoing frame. I am not quite sure how 
> can I add that with the C++ QPID API. The Message class do not seem to have 
> that option.
>
> Any suggestions for the above 2 points would be highly appreciated.
>
> Best Regards,
> Rahul
> -Original Message-
> From: Robbie Gemmell 
> Sent: 01 July 2021 15:01
> To: users 
> Subject: Re: QPID C++ Subscribing to a topic
>
> On Thu, 1 Jul 2021 at 13:18, Gordon Sim  wrote:
> >
> > On Thu, Jul 1, 2021 at 1:08 PM rahul.sin...@morganstanley.com
> >  wrote:
> > >   1.  As per Robbie's suggestion, I have tried adding topic:// in the 
> > > past as well but the address and name selection gets chopped off from our 
> > > end (after topic: ) in the outgoing AMQP frame to Broker.
> > >
> > > Our Code -
> > > qpid::messaging::Receiver topic_receiver = 
> > > session.createReceiver("topic://ID.ExampleTopic; {node:{type:topic}}"
> > > ");
> >
> > You need some ugly quoting in there, netsed single quotes around the
> > address, e.g.:
> >
> >session.createReceiver("'topic://ID.ExampleTopic';
> > {node:{type:topic}}");
> >
> > That prevents the '/' being misinterpreted. (It has special meaning in
> > the qpid::messaging address syntax, which we don't want here).
> >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org For
> > additional commands, e-mail: users-h...@qpid.apache.org
> >
>
> What Gordon said with the quoting should work to get it to parse correctly, I 
> forgot about that being needed (as its not a combination I've really used 
> myself).
>
> Note I wasnt suggesting you do both the prefix and the 'type:topic'
> node config though, as I dont think ActiveMQ 5 actually looks for the 
> terminus 'topic' capability that adds, rather it uses the address name and 
> looks for a name prefix of "topic://" (something which e.g the JMS client 
> adds itself under the covers based on values the broker advertises at 
> connection open time).
>
> -

RE: QPID C++ Subscribing to a topic

2021-07-02 Thread rahul.sin...@morganstanley.com
Many thanks for your responses. Using the single quote helped me to get this 
working. 

Now I am trying to add a request to a queue. For this I create a sender and 
receiver where I would send the request on 'queue://ID.RequestQueueExample' and 
then receive any response from 'queue://ID.ResponseQueueExample'.
Sender sender = session.createSender("'queue://ID.RequestQueueExample'");
Receiver recv = session.createReceiver("'queue://ID.ResponseQueueExample'");

Then I create a Message and set the necessary parameters and prepare the 
Content as required.  The content needs to be in XML format which I populate 
beforehand, extract it in a string and then invoke Message::setContent(str).
I also tried setting the contentType to "utf8".  Not sure if we need to set 
this to any other type?
Here is an example of the string passed to Message::setContent(str) - 

  
ABCDE
AB_CDE
  
  
XYZ
  


However, when I send the request, I receive back error from the broker in the 
receiver queue complaining that the message format is incorrect. My suspicion 
are -

1)  The content and contentType is not being set properly.
2)  I do not find the sender queue details in the outgoing AMQP frames.  In the 
message, I set the Message::ReplyTo with the Receiver Queue Address. After 
looking at some example AMPQ frames which seems to be taken from JMS, I see 
that the outgoing frame also has the Sender queue address 
'queue://ID.ReqQueueExample' in the outgoing frame. I am not quite sure how can 
I add that with the C++ QPID API. The Message class do not seem to have that 
option.

Any suggestions for the above 2 points would be highly appreciated.

Best Regards,
Rahul
-Original Message-----
From: Robbie Gemmell  
Sent: 01 July 2021 15:01
To: users 
Subject: Re: QPID C++ Subscribing to a topic

On Thu, 1 Jul 2021 at 13:18, Gordon Sim  wrote:
>
> On Thu, Jul 1, 2021 at 1:08 PM rahul.sin...@morganstanley.com 
>  wrote:
> >   1.  As per Robbie's suggestion, I have tried adding topic:// in the past 
> > as well but the address and name selection gets chopped off from our end 
> > (after topic: ) in the outgoing AMQP frame to Broker.
> >
> > Our Code -
> > qpid::messaging::Receiver topic_receiver = 
> > session.createReceiver("topic://ID.ExampleTopic; {node:{type:topic}}"
> > ");
>
> You need some ugly quoting in there, netsed single quotes around the 
> address, e.g.:
>
>session.createReceiver("'topic://ID.ExampleTopic'; 
> {node:{type:topic}}");
>
> That prevents the '/' being misinterpreted. (It has special meaning in 
> the qpid::messaging address syntax, which we don't want here).
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org For 
> additional commands, e-mail: users-h...@qpid.apache.org
>

What Gordon said with the quoting should work to get it to parse correctly, I 
forgot about that being needed (as its not a combination I've really used 
myself).

Note I wasnt suggesting you do both the prefix and the 'type:topic'
node config though, as I dont think ActiveMQ 5 actually looks for the terminus 
'topic' capability that adds, rather it uses the address name and looks for a 
name prefix of "topic://" (something which e.g the JMS client adds itself under 
the covers based on values the broker advertises at connection open time).

-
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.

Re: QPID C++ Subscribing to a topic

2021-07-01 Thread Robbie Gemmell
On Thu, 1 Jul 2021 at 13:18, Gordon Sim  wrote:
>
> On Thu, Jul 1, 2021 at 1:08 PM rahul.sin...@morganstanley.com
>  wrote:
> >   1.  As per Robbie's suggestion, I have tried adding topic:// in the past 
> > as well but the address and name selection gets chopped off from our end 
> > (after topic: ) in the outgoing AMQP frame to Broker.
> >
> > Our Code -
> > qpid::messaging::Receiver topic_receiver = 
> > session.createReceiver("topic://ID.ExampleTopic; {node:{type:topic}}"
> > ");
>
> You need some ugly quoting in there, netsed single quotes around the
> address, e.g.:
>
>session.createReceiver("'topic://ID.ExampleTopic'; {node:{type:topic}}");
>
> That prevents the '/' being misinterpreted. (It has special meaning in
> the qpid::messaging address syntax, which we don't want here).
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org
> For additional commands, e-mail: users-h...@qpid.apache.org
>

What Gordon said with the quoting should work to get it to parse
correctly, I forgot about that being needed (as its not a combination
I've really used myself).

Note I wasnt suggesting you do both the prefix and the 'type:topic'
node config though, as I dont think ActiveMQ 5 actually looks for the
terminus 'topic' capability that adds, rather it uses the address name
and looks for a name prefix of "topic://" (something which e.g the JMS
client adds itself under the covers based on values the broker
advertises at connection open time).

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



Re: QPID C++ Subscribing to a topic

2021-07-01 Thread Gordon Sim
On Thu, Jul 1, 2021 at 1:08 PM rahul.sin...@morganstanley.com
 wrote:
>   1.  As per Robbie's suggestion, I have tried adding topic:// in the past as 
> well but the address and name selection gets chopped off from our end (after 
> topic: ) in the outgoing AMQP frame to Broker.
>
> Our Code -
> qpid::messaging::Receiver topic_receiver = 
> session.createReceiver("topic://ID.ExampleTopic; {node:{type:topic}}"
> ");

You need some ugly quoting in there, netsed single quotes around the
address, e.g.:

   session.createReceiver("'topic://ID.ExampleTopic'; {node:{type:topic}}");

That prevents the '/' being misinterpreted. (It has special meaning in
the qpid::messaging address syntax, which we don't want here).


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



Re: QPID C++ Subscribing to a topic

2021-07-01 Thread rahul.sin...@morganstanley.com
Hello Gordon/Robbie,


  1.  Adding the {node:{type:topic}} to the topic name helps in getting the 
topic Capability added in the outgoing AMQP frame to broker. However, I still 
get the same error.

Our Code -
qpid::messaging::Receiver topic_receiver = 
session.createReceiver("ID.ExampleTopic; {node:{type:topic}}"
");

AMQP FRAMES -
ME -> BROKER
FRAME: 0 -> @attach(18) 
[name="ID.ExampleTopic_c1118253-bf96-4379-70ac-721571b25c70", handle=0, 
role=true, snd-settle-mode=2, rcv-settle-mode=0, source=@source(40) 
[address="ID.ExampleTopic", durable=0, timeout=0, dynamic=false, 
capabilities=:topic], target=@target(41) [address="ID.ExampleTopic", durable=0, 
timeout=0, dynamic=false], initial-delivery-count=0, max-message-size=0]

BROKER -> ME
FRAME: 0 <- @attach(18) 
[name="ID.ExampleTopic_c1118253-bf96-4379-70ac-721571b25c70", handle=0, 
role=false, snd-settle-mode=2, rcv-settle-mode=0, target=@target(41) 
[address="ID.ExampleTopic"], incomplete-unsettled=false, 
initial-delivery-count=0]
FRAME: 0 <- @detach(22) [handle=0, closed=true, error=@error(29) 
[condition=:"amqp:unauthorized-access", description="x 
is not authorized to create: queue://ID.ExampleTopic"]]


  1.  As per Robbie's suggestion, I have tried adding topic:// in the past as 
well but the address and name selection gets chopped off from our end (after 
topic: ) in the outgoing AMQP frame to Broker.

Our Code -
qpid::messaging::Receiver topic_receiver = 
session.createReceiver("topic://ID.ExampleTopic; {node:{type:topic}}"
");

AMQP FRAMES -

ME -> BROKER
0 -> @attach(18) [name="topic:_c1118253-bf96-4379-70ac-721571b25c70", handle=0, 
role=true, snd-settle-mode=2, rcv-settle-mode=0, source=@source(40) 
[address="topic:", durable=0, timeout=0, dynamic=false, 
filter={:"subject-filter"=@7756710c6395760 "/ID.ExampleTopic"}, 
capabilities=:topic], target=@target(41) [address="topic:", durable=0, 
timeout=0, dynamic=false], initial-delivery-count=0, max-message-size=0]

BROKER -> ME
FRAME: 0 <- @attach(18) [name="topic:_c1118253-bf96-4379-70ac-721571b25c70", 
handle=0, role=false, snd-settle-mode=2, rcv-settle-mode=0, target=@target(41) 
[address="topic:"], incomplete-unsettled=false, initial-delivery-count=0]
FRAME: 0 <- @detach(22) [handle=0, closed=true, error=@error(29) 
[condition=:"amqp:unauthorized-access", 
description=" is not authorized to read from: 
queue://topic:"]]

Is there a way, we can ensure no such chopping happens when the string passed 
to createReceiver  has "//".

According to the broker, they should be able to accept both "ID.ExampeTopic" OR 
"topic://ID.ExampleTopic", however, the former is still not working even after 
setting topic capability ({node:{type:topic}} , and the later somehow gets 
truncated and
"topic://ID.ExampleTopic" ends up in "topic:".

According to them, what should work in JMS (Java equivalent)
String dataTopic=" topic://ID.ExampleTopic"; OR "ID.ExampleTopic"
String uniqueID="MyUniqueID";
JMSConsumer topicConsumer = context.createDurableConsumer(dataTopic, uniqueID);

One thing I noticed is that the "durable" parameter is 0 in our outgoing 
frames. Was wondering if there is a way to set that upfront while creating the 
Receiver. ( I have seen durable feature with Message Class in C++ but that 
comes later)

Best Regards,
Rahul
-Original Message-
From: Gordon Sim 
Sent: 01 July 2021 10:43
To: users@qpid.apache.org
Subject: Re: QPID C++ Subscribing to a topic

To specify a :topic capability you can use an address of the form 
"ID.ExampleTopic; {node:{type:topic}}".

On Thu, Jul 1, 2021 at 10:10 AM rahul.sin...@morganstanley.com 
 wrote:
>
> Hello,
> The broker does not seem to have much understanding of the C++ QPID
> Messaging API and is more used to the Java version. All it is suggesting to 
> ensure that  we pass the topic in the format "ID.ExampleTopic". However, 
> looking at the AMQP frames from Broker, it seems to misinterpret that topic 
> for a queue, hence there is an unauthorize error reported. ( " is not 
> authorized to create: queue://ID.ExampleTopic" ) From the QPID API usage 
> perspective, do I need to invoke something else to make the topic usage 
> clear. I also experimented with creating a Sender with same topic name but I 
> get the same error.
>
> Best Regards,
> Rahul
>
> -Original Message-
> From: Gordon Sim 
> Sent: 30 June 2021 10:01
> To: users@qpid.apache.org
> Subject: Re: QPID C++ Subscribing to a topic
>
> On Wed, Jun 30, 2021 at 9:40 AM rahul.sin...@morganstanley.com 
>  wrote:
> > After

Re: QPID C++ Subscribing to a topic

2021-07-01 Thread Robbie Gemmell
The broker will have little idea what it is talking to, they all speak
AMQP 1.0 to each other. The only questions are what you are trying to
do, what the broker requires to be asked to do that, and how you
configure your client to get that.

I'm guessing this may be an ActiveMQ broker from the behaviour. If so,
try adding topic:// as a prefix to the address string to have the
broker understand you want to subscribe to the topic of the following
name, rather than a queue with that name, which is what it assumes
unless asked otherwise.

Robbie

On Thu, 1 Jul 2021 at 10:05, rahul.sin...@morganstanley.com
 wrote:
>
> Hello,
> The broker does not seem to have much understanding of the C++ QPID Messaging 
> API and is more used to the Java version. All it is suggesting to ensure that 
>  we pass the topic in the format "ID.ExampleTopic". However, looking at the 
> AMQP frames from Broker, it seems to misinterpret that topic for a queue, 
> hence there is an unauthorize error reported. ( " is not authorized to 
> create: queue://ID.ExampleTopic" )
> From the QPID API usage perspective, do I need to invoke something else to 
> make the topic usage clear. I also experimented with creating a Sender with 
> same topic name but I get the same error.
>
> Best Regards,
> Rahul
>
> -Original Message-
> From: Gordon Sim 
> Sent: 30 June 2021 10:01
> To: users@qpid.apache.org
> Subject: Re: QPID C++ Subscribing to a topic
>
> On Wed, Jun 30, 2021 at 9:40 AM rahul.sin...@morganstanley.com 
>  wrote:
> > After being able to establish the connection with the broker at other end, 
> > we try to subscribe to a given topic. For this, we create the receiver with 
> > string mapping to the topic. ( Id.ExampleTopic ), where Id is the 
> > identifier broker assigned to us and ExampleTopic is the topic.
> > We have already sought clarification with the broker about this issue, 
> > however, we wanted to ensure if the AMQP APIs are being used correctly for 
> > this and if we need to somehow communicate that we are subscribing for a 
> > topic. (for example, do we need to add some qualifier to the passed string 
> > etc.
> >
> > qpid::messaging::Connection conn(url, options); conn.open();
> >
> > qpid::messaging::Session session = conn.createSession();
> >
> > qpid::messaging::Receiver topic_receiver =
> > session.createReceiver("Code.ExampleTopic");
>
>
> If you are using AMQP 1.0, and the broker treats the creation of a receiver 
> with that pattern as a subscription on a topic, then the client does not 
> require any further configuration.
>
>
> -
> 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



Re: QPID C++ Subscribing to a topic

2021-07-01 Thread Gordon Sim
To specify a :topic capability you can use an address of the form
"ID.ExampleTopic; {node:{type:topic}}".

On Thu, Jul 1, 2021 at 10:10 AM rahul.sin...@morganstanley.com
 wrote:
>
> Hello,
> The broker does not seem to have much understanding of the C++ QPID Messaging 
> API and is more used to the Java version. All it is suggesting to ensure that 
>  we pass the topic in the format "ID.ExampleTopic". However, looking at the 
> AMQP frames from Broker, it seems to misinterpret that topic for a queue, 
> hence there is an unauthorize error reported. ( " is not authorized to 
> create: queue://ID.ExampleTopic" )
> From the QPID API usage perspective, do I need to invoke something else to 
> make the topic usage clear. I also experimented with creating a Sender with 
> same topic name but I get the same error.
>
> Best Regards,
> Rahul
>
> -Original Message-
> From: Gordon Sim 
> Sent: 30 June 2021 10:01
> To: users@qpid.apache.org
> Subject: Re: QPID C++ Subscribing to a topic
>
> On Wed, Jun 30, 2021 at 9:40 AM rahul.sin...@morganstanley.com 
>  wrote:
> > After being able to establish the connection with the broker at other end, 
> > we try to subscribe to a given topic. For this, we create the receiver with 
> > string mapping to the topic. ( Id.ExampleTopic ), where Id is the 
> > identifier broker assigned to us and ExampleTopic is the topic.
> > We have already sought clarification with the broker about this issue, 
> > however, we wanted to ensure if the AMQP APIs are being used correctly for 
> > this and if we need to somehow communicate that we are subscribing for a 
> > topic. (for example, do we need to add some qualifier to the passed string 
> > etc.
> >
> > qpid::messaging::Connection conn(url, options); conn.open();
> >
> > qpid::messaging::Session session = conn.createSession();
> >
> > qpid::messaging::Receiver topic_receiver =
> > session.createReceiver("Code.ExampleTopic");
>
>
> If you are using AMQP 1.0, and the broker treats the creation of a receiver 
> with that pattern as a subscription on a topic, then the client does not 
> require any further configuration.
>
>
> -
> 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



RE: QPID C++ Subscribing to a topic

2021-07-01 Thread rahul.sin...@morganstanley.com
Hello,
The broker does not seem to have much understanding of the C++ QPID Messaging 
API and is more used to the Java version. All it is suggesting to ensure that  
we pass the topic in the format "ID.ExampleTopic". However, looking at the AMQP 
frames from Broker, it seems to misinterpret that topic for a queue, hence 
there is an unauthorize error reported. ( " is not authorized to create: 
queue://ID.ExampleTopic" )
From the QPID API usage perspective, do I need to invoke something else to make 
the topic usage clear. I also experimented with creating a Sender with same 
topic name but I get the same error. 

Best Regards,
Rahul

-Original Message-
From: Gordon Sim  
Sent: 30 June 2021 10:01
To: users@qpid.apache.org
Subject: Re: QPID C++ Subscribing to a topic

On Wed, Jun 30, 2021 at 9:40 AM rahul.sin...@morganstanley.com 
 wrote:
> After being able to establish the connection with the broker at other end, we 
> try to subscribe to a given topic. For this, we create the receiver with 
> string mapping to the topic. ( Id.ExampleTopic ), where Id is the identifier 
> broker assigned to us and ExampleTopic is the topic.
> We have already sought clarification with the broker about this issue, 
> however, we wanted to ensure if the AMQP APIs are being used correctly for 
> this and if we need to somehow communicate that we are subscribing for a 
> topic. (for example, do we need to add some qualifier to the passed string 
> etc.
>
> qpid::messaging::Connection conn(url, options); conn.open();
>
> qpid::messaging::Session session = conn.createSession();
>
> qpid::messaging::Receiver topic_receiver = 
> session.createReceiver("Code.ExampleTopic");


If you are using AMQP 1.0, and the broker treats the creation of a receiver 
with that pattern as a subscription on a topic, then the client does not 
require any further configuration.


-
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.

Re: QPID C++ Subscribing to a topic

2021-06-30 Thread Gordon Sim
On Wed, Jun 30, 2021 at 9:40 AM rahul.sin...@morganstanley.com
 wrote:
> After being able to establish the connection with the broker at other end, we 
> try to subscribe to a given topic. For this, we create the receiver with 
> string mapping to the topic. ( Id.ExampleTopic ), where Id is the identifier 
> broker assigned to us and ExampleTopic is the topic.
> We have already sought clarification with the broker about this issue, 
> however, we wanted to ensure if the AMQP APIs are being used correctly for 
> this and if we need to somehow communicate that we are subscribing for a 
> topic. (for example, do we need to add some qualifier to the passed string 
> etc.
>
> qpid::messaging::Connection conn(url, options);
> conn.open();
>
> qpid::messaging::Session session = conn.createSession();
>
> qpid::messaging::Receiver topic_receiver = 
> session.createReceiver("Code.ExampleTopic");


If you are using AMQP 1.0, and the broker treats the creation of a
receiver with that pattern as a subscription on a topic, then the
client does not require any further configuration.


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



QPID C++ Subscribing to a topic

2021-06-30 Thread rahul.sin...@morganstanley.com
Hello,
After being able to establish the connection with the broker at other end, we 
try to subscribe to a given topic. For this, we create the receiver with string 
mapping to the topic. ( Id.ExampleTopic ), where Id is the identifier broker 
assigned to us and ExampleTopic is the topic. 
We have already sought clarification with the broker about this issue, however, 
we wanted to ensure if the AMQP APIs are being used correctly for this and if 
we need to somehow communicate that we are subscribing for a topic. (for 
example, do we need to add some qualifier to the passed string etc.

qpid::messaging::Connection conn(url, options);
conn.open();

qpid::messaging::Session session = conn.createSession();

qpid::messaging::Receiver topic_receiver = 
session.createReceiver("Code.ExampleTopic");

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 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