You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by Chris <cc...@gmail.com> on 2011/06/15 16:30:56 UTC

listener or direct exchange?

Hi, sorry but im new to qpid.

I have a server which controls power on my program on my client.
I have to both query the server if powerup is ok, and also listen to the
server if power should be turned off.
I also need to send powerusage from the client to the server every second.

I have to use the messaging api to encode/decode the messages sent/received
correctly.

What i have done so far is sent the message with powerquery and receive from
the appropriate exchange/routing_key which works fine. However if my server
wants to power of my program how do I check this? Do I run a receiver on the
exchange/routing_key at a set interval and check for new messages? I would
rater that if a message appears on the queue, I would receive it
automatically.

Is this doable in the messaging api, if so how? 

Thanks

--
View this message in context: http://apache-qpid-users.2158936.n2.nabble.com/listener-or-direct-exchange-tp6479081p6479081.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org


Re: listener or direct exchange?

Posted by Alan Conway <ac...@redhat.com>.
On 06/15/2011 10:30 AM, Chris wrote:
> Hi, sorry but im new to qpid.
>
> I have a server which controls power on my program on my client.
> I have to both query the server if powerup is ok, and also listen to the
> server if power should be turned off.
> I also need to send powerusage from the client to the server every second.
>
> I have to use the messaging api to encode/decode the messages sent/received
> correctly.
>
> What i have done so far is sent the message with powerquery and receive from
> the appropriate exchange/routing_key which works fine. However if my server
> wants to power of my program how do I check this? Do I run a receiver on the
> exchange/routing_key at a set interval and check for new messages? I would
> rater that if a message appears on the queue, I would receive it
> automatically.
>
> Is this doable in the messaging api, if so how?
>

You can start a thread on your client calling fetch() to wait for messages from 
the server.

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org