Actually that will not solve my purpose as in my case same application sends
out messages with different labels so i want specifically label
functionality only...
Also please tel me why are AppId, UserId, CorrelationId & MessageId
provided???
what about Peek functionality in qpid? my application requires that i just
want to read the data from queue without deleting it from the queue. just as
peek in MSMQ... getDate() returns then data in queue but also at the same
time removes it from the queue...




Gordon Sim wrote:
> 
> ft420 wrote:
>> okie so you mean if i want to get messages on basis on its label say only
>> messages with HELLO label will be received else all will be discarded
>> then
>> on sender side i need to set 
>> message.getHeader().setString("Label", "HELLO"); 
>> 
>> and 
>> on receiver side 
>> put output of message.getHeader().getString("Label") in conditional
> 
> If you simply want to route messages based on some fixed labeling, you 
> can use the routing key.
> 
> E.g. on sender side published message will have the routing key set to 
> HELLO:
> 
> message.getDeliveryProperties().setRoutingkey("HELLO");
> 
> and on the receiver:
> 
> session.queueDeclare(arg::queue="my-queue",
>                       arg::exclusive=true,
>                       arg::autoDelete=true);
> 
> session.exchangeBind(arg::exchange="amq.direct",
>                       arg::queue="my-queue",
>                       arg::bindingKey="HELLO");
> 
> and then subscribe a listener to my-queue and you will receive any 
> messages published with routing-key == HELLO.
> 
> (If you want the queue to remain after the consuming client exits, 
> remove the exclusive and autoDelete arguments in the queue declare).
> 
> You might also like to have a look at the some of the examples for other 
> patterns of use.
> 
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:users-subscr...@qpid.apache.org
> 
> 
> 

-- 
View this message in context: 
http://n2.nabble.com/send-receive-to-from-remote-machine-tp2507392p2508233.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-subscr...@qpid.apache.org

Reply via email to