You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by "Hamid.Shahid" <ha...@hotmail.com> on 2012/08/27 17:09:13 UTC

Is possible to start reading a message queue from a specific message number

Hi,

I am trying to read a message queue in the 'browse' mode, using following
connection properties;

{ node: { type: queue }, create: never, assert: never, mode: browse }

Everytime, I read the queue it starts from the message#1 to message#n, since
it is in browsing mode. 

Is it possible that I can start reading the queue in browing mode but from a
specific message# ?

For example: The first time I read the queue, I want to start from the
begining but the next time I want to start from a specific message number.

Please let me know, if it is possible, while using the browsing mode.

Thank you.

regards,
Hamid Shahid



--
View this message in context: http://qpid.2158936.n2.nabble.com/Is-possible-to-start-reading-a-message-queue-from-a-specific-message-number-tp7581299.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: Is possible to start reading a message queue from a specific message number

Posted by Gordon Sim <gs...@redhat.com>.
On 09/04/2012 01:36 PM, Hamid.Shahid wrote:
> Yes, I am using JMS. Can you please describe more about the selectors? and
> How can they be used?

Any decent JMS tutorial or book will include a description of selectors, 
e.g. http://docs.oracle.com/javaee/6/tutorial/doc/bnceh.html#bncer.

> Moreover, How can I subscribe to a queue existing on the Qpid server, by
> creating a topic on the client end?

I'm sorry but the question doesn't make sense to me, so I'm not sure how 
to answer.

I'd recommend reading 
http://qpid.apache.org/books/0.18/Programming-In-Apache-Qpid/html/ 
however as well as a good introduction to JMS.

In JMS you have two types of 'Destination' from which you can receive 
messages: Queues and Topics. (Basically corresponding to point-to-point 
and pub-sub patterns respectively if that terminology is more familiar).

Qith the Qpid JMS client, you configure the Destinations using an 
address syntax described in the programming guide above. In its simplest 
form that can be the name of a queue or an 'exchange' (which is the AMQP 
concept used to model JMS Topics). These can be created on the server 
with administrative tools. However the address syntax support more 
advanced options for cases where on demand creation is needed.

For a topic subscription, the Qpid client will create a 'subscription 
queue' and 'bind' that to the exchange used for the topic. It will then 
subscribe to that subscription queue. However this is all done by the 
library for you. All you need to do is define the name of the topic (and 
optionally decide if it should do any filtering).

Hope this helps. As I say the question wasn't really clear to me, so if 
it didn't please feel free to ask again :-)

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


Re: Is possible to start reading a message queue from a specific message number

Posted by "Hamid.Shahid" <ha...@hotmail.com>.
Hi Gordon,

Thank you for your suggestions.

Yes, I am using JMS. Can you please describe more about the selectors? and
How can they be used?

Moreover, How can I subscribe to a queue existing on the Qpid server, by
creating a topic on the client end?

- Hamid



--
View this message in context: http://qpid.2158936.n2.nabble.com/Is-possible-to-start-reading-a-message-queue-from-a-specific-message-number-tp7581299p7581627.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: Is possible to start reading a message queue from a specific message number

Posted by Gordon Sim <gs...@redhat.com>.
On 08/27/2012 04:09 PM, Hamid.Shahid wrote:
>
> Hi,
>
> I am trying to read a message queue in the 'browse' mode, using following
> connection properties;
>
> { node: { type: queue }, create: never, assert: never, mode: browse }
>
> Everytime, I read the queue it starts from the message#1 to message#n, since
> it is in browsing mode.
>
> Is it possible that I can start reading the queue in browing mode but from a
> specific message# ?

There is nothing that directly does that. You could emulate something 
similar with selectors (you are using JMS, right?).

An alternative would be to use a durable topic subscription instead of 
browsing the queue. Whether that is any use will depend on the bigger 
picture in your system.


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