qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gordon Sim <g...@redhat.com>
Subject Re: How to unbind queue and topic with C++ Message API
Date Tue, 30 Aug 2016 09:28:06 GMT
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).


Mime
View raw message