You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by lucas <zh...@163.com> on 2016/08/26 12:49:23 UTC

How to unbind queue and topic with C++ Message API

I have bound a queue and topic with code:
         "family ; {create:always,node: {type: topic,durable:True,
x-bindings:[{queue:lucas}]}}";
Now I want to unbind this connection,but i dont konw how to do;
Please help!
I try to use "delete:always" but the whole queue or topic will be delete at
last.

Any help will be appreciated.



--
View this message in context: http://qpid.2158936.n2.nabble.com/How-to-unbind-queue-and-topic-with-C-Message-API-tp7649664.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

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


Re: How to unbind queue and topic with C++ Message API

Posted by lucas <zh...@163.com>.
Thank you.Virgilio Fornazin
 Does "QMF framework" means qpid-config and qpid-route and so on?
I never use anything about QMF and i cant even use qpid-route because it
report i lack module qmf.console.
But i have already install QPID-broker、C++MessageAPI、PythonMessagAPI.
I am also looking for the solution above.If QMF framework have connection
with qmf.console,I think i cant use it temporarilly.
Could you please write me an example code that use QMF framework to
dinamically bind/unbind topics to 
queues ?
Thanks



--
View this message in context: http://qpid.2158936.n2.nabble.com/How-to-unbind-queue-and-topic-with-C-Message-API-tp7649664p7649731.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

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


Re: How to unbind queue and topic with C++ Message API

Posted by Gordon Sim <gs...@redhat.com>.
On 30/08/16 10:40, lucas wrote:
> I am so sorry that I have annotated some code before when I test the unbind()
> function.It's work both now.Thank for your help and examples.
> Can you please tell me where can I find these information about
> "Variant::Map"\u3001\u201cencode\u201d\u3001\u201cdecode\u201d?

https://qpid.apache.org/releases/qpid-0.32/messaging-api/cpp/api/classqpid_1_1types_1_1Variant.html

https://qpid.apache.org/releases/qpid-0.32/messaging-api/cpp/api/namespaceqpid_1_1messaging.html#a950c7ad4cd0650513e4d02741f480ee7

Actually though, now you point it out, that is the old way of doing 
things (this is an old example). It still works but you can also just 
use the Message::getContentObject() which avoids needing to do the 
encode and decode explicitly. There are some examples of using that e.g.

https://qpid.apache.org/releases/qpid-0.32/messaging-api/cpp/examples/map_sender.cpp.html



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


Re: How to unbind queue and topic with C++ Message API

Posted by lucas <zh...@163.com>.
I am so sorry that I have annotated some code before when I test the unbind()
function.It's work both now.Thank for your help and examples.
Can you please tell me where can I find these information about
"Variant::Map"、“encode”、“decode”?
I learn QPID usage from https://qpid.apache.org/ but I see few above
Infos.So that I dont really totally unstanding your code now buf I will
study and digest it as soon as i can.
Thx again



--
View this message in context: http://qpid.2158936.n2.nabble.com/How-to-unbind-queue-and-topic-with-C-Message-API-tp7649664p7649916.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

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


Re: How to unbind queue and topic with C++ Message API

Posted by Gordon Sim <gs...@redhat.com>.
On 30/08/16 10:13, lucas wrote:
> Thank you very much!Sim.
> I have compiled and run your code and I find that working when I call
> function controller.bind(),
> but it seems doesn't work when I call controller.unbind(I qpif-config add a
> queue and exchange,then bind them.I want to see if controller.unbind will
> unbind them but It does not).

Works for me. I modified the example to allow you to trigger the unbind 
also (see attached). I did a quick test as follows:

> $ qpid-config queues -r
> Queue '46f35f54-10b6-44e2-9e36-74a6b4fa8f91:0.0'
>     bind [46f35f54-10b6-44e2-9e36-74a6b4fa8f91:0.0] => ''
>     bind [direct.c1249134-6c8e-454a-b973-9a2b48c71962] => qmf.default.topic
> Queue 'db2c36e2-1818-4792-b4a4-a5b63fccf636#'
>     bind [db2c36e2-1818-4792-b4a4-a5b63fccf636#] => ''
> Queue 'my-queue'
>     bind [my-queue] => ''
> $ qpid-send -a my-queue/control -M exchange=amq.direct -M key=my-key
> $ qpid-config queues -r
> Queue '0d2f8688-6a79-4ab7-9abb-a648f3584060:0.0'
>     bind [0d2f8688-6a79-4ab7-9abb-a648f3584060:0.0] => ''
>     bind [direct.fd79576d-5378-4088-a812-645d7ba0fb33] => qmf.default.topic
> Queue 'db2c36e2-1818-4792-b4a4-a5b63fccf636#'
>     bind [db2c36e2-1818-4792-b4a4-a5b63fccf636#] => ''
> Queue 'my-queue'
>     bind [my-queue] => ''
>     bind [my-key] => amq.direct
> $ qpid-send -a my-queue/control -M exchange=amq.direct -M key=my-key -M unbind=true
> $ qpid-config queues -r
> Queue 'ab23bbb5-23f9-47d5-a5e8-d6dea168f7c2:0.0'
>     bind [ab23bbb5-23f9-47d5-a5e8-d6dea168f7c2:0.0] => ''
>     bind [direct.01106841-1373-4e5a-9351-ae266b16a39e] => qmf.default.topic
> Queue 'db2c36e2-1818-4792-b4a4-a5b63fccf636#'
>     bind [db2c36e2-1818-4792-b4a4-a5b63fccf636#] => ''
> Queue 'my-queue'
>     bind [my-queue] => ''
> $ qpid-config bind amq.topic my-queue some-key
> $ qpid-config queues -r
> Queue '49f64c5d-6f1c-4052-9539-981c4badf067:0.0'
>     bind [49f64c5d-6f1c-4052-9539-981c4badf067:0.0] => ''
>     bind [direct.19776178-a495-4dba-b099-6441ed870074] => qmf.default.topic
> Queue 'db2c36e2-1818-4792-b4a4-a5b63fccf636#'
>     bind [db2c36e2-1818-4792-b4a4-a5b63fccf636#] => ''
> Queue 'my-queue'
>     bind [my-queue] => ''
>     bind [some-key] => amq.topic
> $ qpid-send -a my-queue/control -M exchange=amq.topic -M key=some-key -M unbind=true
> $ qpid-config queues -r
> Queue 'db2c36e2-1818-4792-b4a4-a5b63fccf636#'
>     bind [db2c36e2-1818-4792-b4a4-a5b63fccf636#] => ''
> Queue 'f7361e1d-44eb-4954-b733-a05315d0c8a3:0.0'
>     bind [f7361e1d-44eb-4954-b733-a05315d0c8a3:0.0] => ''
>     bind [direct.f81355a8-a136-4956-bf42-c3f65a953e02] => qmf.default.topic
> Queue 'my-queue'
>     bind [my-queue] => ''

(Note that the example as attached always uses my-queue as the queue 
name. You would have to change it to allow a different queue name to be 
passed in).


Re: How to unbind queue and topic with C++ Message API

Posted by lucas <zh...@163.com>.
Thank you very much!Sim.
I have compiled and run your code and I find that working when I call
function controller.bind(),
but it seems doesn't work when I call controller.unbind(I qpif-config add a
queue and exchange,then bind them.I want to see if controller.unbind will
unbind them but It does not).



--
View this message in context: http://qpid.2158936.n2.nabble.com/How-to-unbind-queue-and-topic-with-C-Message-API-tp7649664p7649914.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

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


Re: How to unbind queue and topic with C++ Message API

Posted by Gordon Sim <gs...@redhat.com>.
On 27/08/16 04:53, lucas wrote:
>  Does "QMF framework" means qpid-config and qpid-route and so on?

QMF is a management protocol layered on top of AMQP. Those tools use 
that protocol, but you can also sends and receive QMF messages directly 
from any client API.

> I never use anything about QMF and i cant even use qpid-route because it
> report i lack module qmf.console.
> But i have already install QPID-broker

I'm assuming it is the c++ broker you have, right? (There is a plugin 
for QMF support for the java broker, but the recommended approach for 
the java broker I believe is the REST API, i.e. HTTP).

>\u3001C++MessageAPI\u3001PythonMessagAPI.
> I am also looking for the solution above.If QMF framework have connection
> with qmf.console,I think i cant use it temporarilly.
> Could you please write me an example code that use QMF framework to
> dinamically bind/unbind topics to
> queues ?

See attached.


Re: How to unbind queue and topic with C++ Message API

Posted by lucas <zh...@163.com>.
Thank you.Virgilio Fornazin 
 Does "QMF framework" means qpid-config and qpid-route and so on? 
I never use anything about QMF and i cant even use qpid-route because it
report i lack module qmf.console. 
But i have already install QPID-broker、C++MessageAPI、PythonMessagAPI. 
I am also looking for the solution above.If QMF framework have connection
with qmf.console,I think i cant use it temporarilly. 
Could you please write me an example code that use QMF framework to
dinamically bind/unbind topics to 
queues ? 
Thanks



--
View this message in context: http://qpid.2158936.n2.nabble.com/How-to-unbind-queue-and-topic-with-C-Message-API-tp7649664p7649732.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

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


Re: How to unbind queue and topic with C++ Message API

Posted by Virgilio Fornazin <vi...@gmail.com>.
you must use QMF framework to dinamically bind/unbind topics to exchanges /
queues

On Fri, Aug 26, 2016 at 9:49 AM, lucas <zh...@163.com> wrote:

> I have bound a queue and topic with code:
>          "family ; {create:always,node: {type: topic,durable:True,
> x-bindings:[{queue:lucas}]}}";
> Now I want to unbind this connection,but i dont konw how to do;
> Please help!
> I try to use "delete:always" but the whole queue or topic will be delete at
> last.
>
> Any help will be appreciated.
>
>
>
> --
> View this message in context: http://qpid.2158936.n2.nabble.
> com/How-to-unbind-queue-and-topic-with-C-Message-API-tp7649664.html
> Sent from the Apache Qpid users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>
>