You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by mohank <mo...@eventtracker.com.INVALID> on 2020/05/26 07:08:15 UTC

QPID C++ AMQP 1.0 (create Queue and routing key)

Hi,

Client : QPID C++ 1.36 AMPQ 1.0
Broker : RabbitMQ 3.8

Is there any QPID C++ API to create Queue, and bind routing to the same
grammatically.

tried below commands:

*Create Queue name called "Service_Queue"*
         Receiver receiver = session.createReceiver("service_queue");
        
*Create temp Queue, with routing key "#.news"*
         Receiver receiver = session.createReceiver("'/topic/#.news'")
        

*I want to create Queue news and routing key in receiver link*
tried below command didn't create Queue news, created temp Queue and bind
the routing key.
        Receiver receiver =
session.createReceiver("amq.topic/#.news;{node:{capabilities:[shared]},
link:{name: 'news'}}");


Can someone please guide me.

Thanks,
Mohan




--
Sent from: http://qpid.2158936.n2.nabble.com/Apache-Qpid-users-f2158936.html

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


Re: QPID C++ AMQP 1.0 (create Queue and routing key)

Posted by Gordon Sim <gs...@redhat.com>.
On 27/05/2020 6:47 pm, mohank wrote:
> I have uploaded the sample code where I have commented the blocking close
> call( comment //Blocking call)
> 
> Both receiver and sender close API's are blocking.
> 
> Server.cpp <http://qpid.2158936.n2.nabble.com/file/t396514/Server.cpp>
> Client.cpp <http://qpid.2158936.n2.nabble.com/file/t396514/Client.cpp>

Do you mean that the calls block *indefinitely*? If so that is likely 
due to https://github.com/rabbitmq/rabbitmq-amqp1.0/issues/60

(You can verify by running with 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++ AMQP 1.0 (create Queue and routing key)

Posted by mohank <mo...@eventtracker.com.INVALID>.
I have uploaded the sample code where I have commented the blocking close
call( comment //Blocking call)

Both receiver and sender close API's are blocking.

Server.cpp <http://qpid.2158936.n2.nabble.com/file/t396514/Server.cpp>  
Client.cpp <http://qpid.2158936.n2.nabble.com/file/t396514/Client.cpp>  

Thanks,
Mohan



--
Sent from: http://qpid.2158936.n2.nabble.com/Apache-Qpid-users-f2158936.html

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


Re: QPID C++ AMQP 1.0 (create Queue and routing key)

Posted by mohank <mo...@eventtracker.com.INVALID>.
>> 3) is there any work around to delete the temp queue programmatically?

>Not sure I understand the question. The temp queue would be deleted by
>closing the receiver.

I have tried with receiver close API, it is blocking call and deleting the
temp queue.	

                Message response = receiver.fetch();
		std::cout << request.getContent() << " -> " << response.getContent() <<
std::endl;
		
		receiver.close();

thanks,
Mohan



--
Sent from: http://qpid.2158936.n2.nabble.com/Apache-Qpid-users-f2158936.html

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


Re: QPID C++ AMQP 1.0 (create Queue and routing key)

Posted by Virgilio Fornazin <vi...@gmail.com>.
sure it has, I have this code somewhere, let me take a look I'll post it
here

On Wed, May 27, 2020 at 2:17 AM mohank <mo...@eventtracker.com.invalid>
wrote:

> >> 3) is there any work around to delete the temp queue programmatically?
>
> >Not sure I understand the question. The temp queue would be deleted by
> >closing the receiver.
>
> I have tried with receiver close API, it is blocking call and deleting the
> temp queue.
>
>                 Message response = receiver.fetch();
>                 std::cout << request.getContent() << " -> " <<
> response.getContent() <<
> std::endl;
>
>                 receiver.close();
>
> thanks,
> Mohan
>
>
>
> --
> Sent from:
> http://qpid.2158936.n2.nabble.com/Apache-Qpid-users-f2158936.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>
>

Re: QPID C++ AMQP 1.0 (create Queue and routing key)

Posted by mohank <mo...@eventtracker.com.INVALID>.
>> 3) is there any work around to delete the temp queue programmatically?

>Not sure I understand the question. The temp queue would be deleted by
>closing the receiver.

I have tried with receiver close API, it is blocking call and deleting the
temp queue.	

                Message response = receiver.fetch();
		std::cout << request.getContent() << " -> " << response.getContent() <<
std::endl;
		
		receiver.close();

thanks,
Mohan



--
Sent from: http://qpid.2158936.n2.nabble.com/Apache-Qpid-users-f2158936.html

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


Re: QPID C++ AMQP 1.0 (create Queue and routing key)

Posted by Gordon Sim <gs...@redhat.com>.
On 26/05/2020 12:36 pm, mohank wrote:
> Hi Gordon Sim,
> 
> Thanks for your reply.
> 
> *
> So you could try "'/exchange/amq.topic/#.news'" (the quotes are required)
> *
> 
> This create temporary Q and bound with routing key #.news.
> 
> 1) is it possible to consumer Queue (news ) and bound with routing key
> #.news. instead of creating temporary queue.

No. AMQP 1.0 does not cover any specific notion of queues and bindings 
(which are concepts from earlier iterations of the spec that did not 
survive into 1.0).

For static setup you could use rabbitmq tools, or write scripts using a 
client library based on one of those earlier versions of the spec.

> 
> 2) below command create non durable queue.
>      Receiver receiver = session.createReceiver("service_queue");
> 
>      is there any way to create Durable queue grammatically using QPID
> C++(AMQP 1.0)

No (see above for detail)

> 3) is there any work around to delete the temp queue programmatically?

Not sure I understand the question. The temp queue would be deleted by 
closing the receiver.


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


Re: QPID C++ AMQP 1.0 (create Queue and routing key)

Posted by mohank <mo...@eventtracker.com.INVALID>.
Hi Gordon Sim,

Thanks for your reply.

*
So you could try "'/exchange/amq.topic/#.news'" (the quotes are required)
*

This create temporary Q and bound with routing key #.news.

1) is it possible to consumer Queue (news ) and bound with routing key
#.news. instead of creating temporary queue. 

2) below command create non durable queue.
    Receiver receiver = session.createReceiver("service_queue");

    is there any way to create Durable queue grammatically using QPID
C++(AMQP 1.0)

3) is there any work around to delete the temp queue programmatically?

Thanks,
Mohan



--
Sent from: http://qpid.2158936.n2.nabble.com/Apache-Qpid-users-f2158936.html

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


Re: QPID C++ AMQP 1.0 (create Queue and routing key)

Posted by Gordon Sim <gs...@redhat.com>.
On 26/05/2020 8:08 am, mohank wrote:
> Hi,
> 
> Client : QPID C++ 1.36 AMPQ 1.0
> Broker : RabbitMQ 3.8
> 
> Is there any QPID C++ API to create Queue, and bind routing to the same
> grammatically.
> 
> tried below commands:
> 
> *Create Queue name called "Service_Queue"*
>           Receiver receiver = session.createReceiver("service_queue");
>          
> *Create temp Queue, with routing key "#.news"*
>           Receiver receiver = session.createReceiver("'/topic/#.news'")
>          
> 
> *I want to create Queue news and routing key in receiver link*
> tried below command didn't create Queue news, created temp Queue and bind
> the routing key.
>          Receiver receiver =
> session.createReceiver("amq.topic/#.news;{node:{capabilities:[shared]},
> link:{name: 'news'}}");

 From https://github.com/rabbitmq/rabbitmq-amqp1.0#routing-and-addressing:

     "/exchange/"  X "/" RK  Consume from temp queue bound to X
                             with routing key RK

So you could try "'/exchange/amq.topic/#.news'" (the quotes are required)


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