You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by Bill Whiting <te...@bellsouth.net> on 2009/08/13 23:12:48 UTC

get message by correlationId

Is there a sample program or documentation that shows getting a message 
from a queue by the correlationId or messageId?

//Bill

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


Re: get message by correlationId

Posted by Marnie McCormack <ma...@googlemail.com>.
Ah, sorry Bill - then I think Gordon's reply was the most apposite !

M

On Fri, Aug 14, 2009 at 1:38 PM, Bill Whiting <te...@bellsouth.net> wrote:

> Thanks for the quick reply Marnie,
> My application is written in C++, so I don't think that helps.
>
> //Bill
>
>
> On 08/14/2009 05:15 AM, Marnie McCormack wrote:
>
>> Hi Bill,
>>
>> The Java Broker/Client support JMSCorrelationId&  JMSMessageId. They
>> are exposed as part of the properties on the JMSMessage, allowing bridging
>> across applications and messaging services.
>>
>> In the Java example package, the simple.reqresp classes contain code
>> showing
>> how to get/set the JMSCorrelationId.
>>
>> We also support JMSMessageId, and though there are not any examples I can
>> spot - the logic is the same i.e. the getter/setter is exposed on the
>> JMSMessage object. This property is set after send or carried across for
>> non-Qpid messages.
>> The JMX management interfaces supported in the Java Broker allow a user
>> to view message content using using the Qpid message Id (which will be the
>> same as JMSMessageId after send for Qpid messages).
>>
>> Hth - give us a shout with any more questions and we'll try to help,
>> Marnie
>> On Thu, Aug 13, 2009 at 10:12 PM, Bill Whiting<te...@bellsouth.net>
>>  wrote:
>>
>>
>>
>>> Is there a sample program or documentation that shows getting a message
>>> from a queue by the correlationId or messageId?
>>>
>>> //Bill
>>>
>>> ---------------------------------------------------------------------
>>> Apache Qpid - AMQP Messaging Implementation
>>> Project:      http://qpid.apache.org
>>> Use/Interact: mailto:users-subscribe@qpid.apache.org
>>>
>>>
>>>
>>>
>>
>>
>>
>
>

Re: get message by correlationId

Posted by Bill Whiting <te...@bellsouth.net>.
Thanks for the quick reply Marnie,
My application is written in C++, so I don't think that helps.

//Bill

On 08/14/2009 05:15 AM, Marnie McCormack wrote:
> Hi Bill,
>
> The Java Broker/Client support JMSCorrelationId&  JMSMessageId. They
> are exposed as part of the properties on the JMSMessage, allowing bridging
> across applications and messaging services.
>
> In the Java example package, the simple.reqresp classes contain code showing
> how to get/set the JMSCorrelationId.
>
> We also support JMSMessageId, and though there are not any examples I can
> spot - the logic is the same i.e. the getter/setter is exposed on the
> JMSMessage object. This property is set after send or carried across for
> non-Qpid messages.
> The JMX management interfaces supported in the Java Broker allow a user
> to view message content using using the Qpid message Id (which will be the
> same as JMSMessageId after send for Qpid messages).
>
> Hth - give us a shout with any more questions and we'll try to help,
> Marnie
> On Thu, Aug 13, 2009 at 10:12 PM, Bill Whiting<te...@bellsouth.net>  wrote:
>
>    
>> Is there a sample program or documentation that shows getting a message
>> from a queue by the correlationId or messageId?
>>
>> //Bill
>>
>> ---------------------------------------------------------------------
>> Apache Qpid - AMQP Messaging Implementation
>> Project:      http://qpid.apache.org
>> Use/Interact: mailto:users-subscribe@qpid.apache.org
>>
>>
>>      
>
>    


Re: get message by correlationId

Posted by Marnie McCormack <ma...@googlemail.com>.
Hi Bill,

The Java Broker/Client support JMSCorrelationId & JMSMessageId. They
are exposed as part of the properties on the JMSMessage, allowing bridging
across applications and messaging services.

In the Java example package, the simple.reqresp classes contain code showing
how to get/set the JMSCorrelationId.

We also support JMSMessageId, and though there are not any examples I can
spot - the logic is the same i.e. the getter/setter is exposed on the
JMSMessage object. This property is set after send or carried across for
non-Qpid messages.
The JMX management interfaces supported in the Java Broker allow a user
to view message content using using the Qpid message Id (which will be the
same as JMSMessageId after send for Qpid messages).

Hth - give us a shout with any more questions and we'll try to help,
Marnie
On Thu, Aug 13, 2009 at 10:12 PM, Bill Whiting <te...@bellsouth.net> wrote:

> Is there a sample program or documentation that shows getting a message
> from a queue by the correlationId or messageId?
>
> //Bill
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org
>
>

Re: get message by correlationId

Posted by Bill Whiting <te...@bellsouth.net>.
When it's committed, let me know if I can help with testing.

//Bill

On 08/14/2009 10:24 AM, Gordon Sim wrote:
> Bill Whiting wrote:
>> Gordon,
>> Is the patch to add the XSLT based selectors included in the current 
>> trunk for SVN?
>
> Not yet, no.
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org
>
>


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


Re: get message by correlationId

Posted by Gordon Sim <gs...@redhat.com>.
Bill Whiting wrote:
> Gordon,
> Is the patch to add the XSLT based selectors included in the current 
> trunk for SVN?

Not yet, no.

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


Re: get message by correlationId

Posted by Bill Whiting <te...@bellsouth.net>.
Gordon,
Is the patch to add the XSLT based selectors included in the current 
trunk for SVN?

//Bill

On 08/14/2009 09:11 AM, Gordon Sim wrote:
> Bill Whiting wrote:
>> So the only way to receive a specific message by the correlationId 
>> (at this time) would be to browse the queue looking for the correct 
>> message?
>
> Thats right.
>
> As I say selectors are 'coming soon', there is a patch for XSLT based 
> selectors attached to QPID-530[1] if you are interested in previewing 
> that. I don't know the full state of completion, and I believe it does 
> not yet allow selection on specific message- or delivery- properties 
> yet (does allow selection based on 'application-headers' though).
>
> [1] https://issues.apache.org/jira/browse/QPID-530
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org
>
>


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


Re: get message by correlationId

Posted by Carl Trieloff <cc...@redhat.com>.
Gordon Sim wrote:
> Robert Greig wrote:
>>> As I say selectors are 'coming soon', there is a patch for XSLT based
>>> selectors attached to QPID-530[1] if you are interested in 
>>> previewing that.
>>
>> Out of curiosity, why XSLT? Is it to handle message body selection as
>> well as the more traditional headers?
>
> My apologies first of all, it's not XSLT, its XQuery. The XML exchange 
> plugin already had logic for matching messages using an xquery and the 
> initial patch for selectors just re-used that. (Instead of having to 
> develop a parser and evaluator for some other syntax, though I suspect 
> that will also be added at some point).
>
> It can select on bodies as well, yes.
>
>> How fast is it?
>
> Not sure to be honest. I haven't had the time to try out the patch, 
> though I believe some others have.

I integrated it and put it back onto the JIRA. There is one SEGV that 
needs to be found and fixed, at which time it can be merged to trunk (if 
you want to help out). The performance is ok for selectors, but not 
fantastic. the main perf issue is the way selectors are deleting from 
the queue deque. This however should be quite easy optimize.

Regards
Carl.

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


Re: get message by correlationId

Posted by Gordon Sim <gs...@redhat.com>.
Robert Greig wrote:
>> As I say selectors are 'coming soon', there is a patch for XSLT based
>> selectors attached to QPID-530[1] if you are interested in previewing that.
> 
> Out of curiosity, why XSLT? Is it to handle message body selection as
> well as the more traditional headers?

My apologies first of all, it's not XSLT, its XQuery. The XML exchange 
plugin already had logic for matching messages using an xquery and the 
initial patch for selectors just re-used that. (Instead of having to 
develop a parser and evaluator for some other syntax, though I suspect 
that will also be added at some point).

It can select on bodies as well, yes.

> How fast is it?

Not sure to be honest. I haven't had the time to try out the patch, 
though I believe some others have.

> Selectors by correlationid is a very common case - e.g. although IBM
> MQ 6 JMS selector support is on the client in general (and therefore
> pretty useless) it does it on the broker for correlationid. A good
> number of proportion of people migrating from MQ would need this
> feature and for it to be fast.

Thats very useful information. Special cases like this may well be worth 
optimising.

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


Re: get message by correlationId

Posted by Robert Greig <ro...@gmail.com>.
> As I say selectors are 'coming soon', there is a patch for XSLT based
> selectors attached to QPID-530[1] if you are interested in previewing that.

Out of curiosity, why XSLT? Is it to handle message body selection as
well as the more traditional headers?

How fast is it?

Selectors by correlationid is a very common case - e.g. although IBM
MQ 6 JMS selector support is on the client in general (and therefore
pretty useless) it does it on the broker for correlationid. A good
number of proportion of people migrating from MQ would need this
feature and for it to be fast.

RG

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


Re: get message by correlationId

Posted by Gordon Sim <gs...@redhat.com>.
Bill Whiting wrote:
> So the only way to receive a specific message by the correlationId (at 
> this time) would be to browse the queue looking for the correct message?

Thats right.

As I say selectors are 'coming soon', there is a patch for XSLT based 
selectors attached to QPID-530[1] if you are interested in previewing 
that. I don't know the full state of completion, and I believe it does 
not yet allow selection on specific message- or delivery- properties yet 
(does allow selection based on 'application-headers' though).

[1] https://issues.apache.org/jira/browse/QPID-530

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


Re: get message by correlationId

Posted by Rob Godfrey <ro...@gmail.com>.
On 25 May 2012 18:38, yannanlu <ya...@turner.com> wrote:
> I am a newby on Qpid. I have Qpid 0.16 Java broker running. I am able to
> send/receive and browse messages on queues via JMS client. But I am not able
> to browse individual messages via message selector on their JMSMessageID.

When selecting by JMSMessageID you need to remove the leading "ID:"
from the string used in your selector.  That is if

getJMSMessageID() returns "ID:xxxxyyyyzzzz" you would need to specify
a selector of the form

"JMSMessageID = 'xxxxyyyyzzzz'" in order to be able to select on it.
This is because the JMS spec (bizarrely) insists that the JMSMessageID
begins with ID: whereas the actual native AMQP message ID does not.

Hope this helps,
Rob

>
> I understood Qpid is not a pure JMS solution. But I am wondering how to
> browse the messages via message selector in AMQP land. Is there any example
> or successful use case?
>
> BTW, I really like Qpid. It allows my JMS code to access AMQP land. Compared
> to RabbitMQ, it supports browse. Therefore, I would like to know how to
> browse individual messages from a queue via certain message selectors. It
> does not have to be JMS friendly.
>
> Thanks in advance,
>
> Yannan
>
> --
> View this message in context: http://qpid.2158936.n2.nabble.com/get-message-by-correlationId-tp3440876p7576789.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
>

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


Re: get message by correlationId

Posted by yannanlu <ya...@turner.com>.
I am a newby on Qpid. I have Qpid 0.16 Java broker running. I am able to
send/receive and browse messages on queues via JMS client. But I am not able
to browse individual messages via message selector on their JMSMessageID.

I understood Qpid is not a pure JMS solution. But I am wondering how to
browse the messages via message selector in AMQP land. Is there any example
or successful use case?

BTW, I really like Qpid. It allows my JMS code to access AMQP land. Compared
to RabbitMQ, it supports browse. Therefore, I would like to know how to
browse individual messages from a queue via certain message selectors. It
does not have to be JMS friendly.

Thanks in advance,

Yannan  

--
View this message in context: http://qpid.2158936.n2.nabble.com/get-message-by-correlationId-tp3440876p7576789.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: get message by correlationId

Posted by Nithesh Shetty <kn...@yahoo.com>.
Hi,

I am using QPID 8 trying to get message by id .

Hope it has been implementated. and can u please give me the link of
the example to get message id.

Regards,

Nithesh

--- On Fri, 8/14/09, Marnie McCormack <ma...@googlemail.com> wrote:

> From: Marnie McCormack <ma...@googlemail.com>
> Subject: Re: get message by correlationId
> To: users@qpid.apache.org
> Date: Friday, August 14, 2009, 12:42 PM
> Hi Bill,
> 
> You can use JMS message selectors to get the message you
> want from the
> queue/topic, you specify the selector string on the
> creation of the consumer
> (via the Session) e.g.
> session.createConsumer(queue,"JMSCorrelationID="+correlationID)
> 
> Hth,
> Marnie
> 
> 
> 
> 
> On Fri, Aug 14, 2009 at 1:23 PM, Bill Whiting <te...@bellsouth.net>
> wrote:
> 
> > So the only way to receive a specific message by the
> correlationId (at this
> > time) would be to browse the queue looking for the
> correct message?
> >
> > //Bill
> >
> >
> > On 08/14/2009 02:58 AM, Gordon Sim wrote:
> >
> >> Bill Whiting wrote:
> >>
> >>> Is there a sample program or documentation
> that shows getting a message
> >>> from a queue by the correlationId or
> messageId?
> >>>
> >>
> >> We don't I'm afraid (assuming you are talking
> about the c++ broker). We
> >> hope to add in selectors shortly however and this
> would be a good example to
> >> add at that time.
> >>
> >>
> ---------------------------------------------------------------------
> >> Apache Qpid - AMQP Messaging Implementation
> >> Project:      http://qpid.apache.org
> >> Use/Interact: mailto:users-subscribe@qpid.apache.org
> >>
> >>
> >>
> >
> >
> ---------------------------------------------------------------------
> > Apache Qpid - AMQP Messaging Implementation
> > Project:      http://qpid.apache.org
> > Use/Interact: mailto:users-subscribe@qpid.apache.org
> >
> >
> 

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


Re: get message by correlationId

Posted by Marnie McCormack <ma...@googlemail.com>.
Hi Bill,

You can use JMS message selectors to get the message you want from the
queue/topic, you specify the selector string on the creation of the consumer
(via the Session) e.g.
session.createConsumer(queue,"JMSCorrelationID="+correlationID)

Hth,
Marnie




On Fri, Aug 14, 2009 at 1:23 PM, Bill Whiting <te...@bellsouth.net> wrote:

> So the only way to receive a specific message by the correlationId (at this
> time) would be to browse the queue looking for the correct message?
>
> //Bill
>
>
> On 08/14/2009 02:58 AM, Gordon Sim wrote:
>
>> Bill Whiting wrote:
>>
>>> Is there a sample program or documentation that shows getting a message
>>> from a queue by the correlationId or messageId?
>>>
>>
>> We don't I'm afraid (assuming you are talking about the c++ broker). We
>> hope to add in selectors shortly however and this would be a good example to
>> add at that time.
>>
>> ---------------------------------------------------------------------
>> Apache Qpid - AMQP Messaging Implementation
>> Project:      http://qpid.apache.org
>> Use/Interact: mailto:users-subscribe@qpid.apache.org
>>
>>
>>
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org
>
>

Re: get message by correlationId

Posted by Bill Whiting <te...@bellsouth.net>.
So the only way to receive a specific message by the correlationId (at 
this time) would be to browse the queue looking for the correct message?

//Bill

On 08/14/2009 02:58 AM, Gordon Sim wrote:
> Bill Whiting wrote:
>> Is there a sample program or documentation that shows getting a 
>> message from a queue by the correlationId or messageId?
>
> We don't I'm afraid (assuming you are talking about the c++ broker). 
> We hope to add in selectors shortly however and this would be a good 
> example to add at that time.
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:users-subscribe@qpid.apache.org
>
>


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


Re: get message by correlationId

Posted by Gordon Sim <gs...@redhat.com>.
Bill Whiting wrote:
> Is there a sample program or documentation that shows getting a message 
> from a queue by the correlationId or messageId?

We don't I'm afraid (assuming you are talking about the c++ broker). We 
hope to add in selectors shortly however and this would be a good 
example to add at that time.

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