[jboss-user] [JBoss Messaging Users] - Queue-like/Persistent Topics
do-not-reply at jboss.com
Sun Aug 30 16:29:08 EDT 2009
Hello everyone, this is my first post.
I have a question/problem for which I think I have an answer/solution. What I need is sort of a hybrid between a queue and a topic (unless there's a topic configuration that already does what I want).
I *already* have a service that every once in a while (say 10 msg/min) publishes messages to a Topic. I can then have multiple clients connect to this topic, subscribe and receive messages *as they are published*.
But I need the option to retrieve those messages that have already been published before subscribing, like a JMS Queue, which stores messages waiting to be consumed.
A more concrete example of what I *NEED*:
1. Service (i.e. the Message Publisher) starts up.
2. Publisher sends 10 messages.
3. Client 1 connects, subscribes and receives those ten messages, along with any new messages
4. Publisher sends 10 more messages; Client 1 receives them
5. Client 2 connects, subscribes and receives 20 messages, then any new messages
6. Publisher keeps sending messages and Clients 1 & 2 receive them.
Now, all I have been able to do is receive messages after subscribing. All messages published before subscribing are lost. I've searched high and low and have found no standard (i.e. configurable) way to do what I want.
I do have a work-around, but I am not too sure that it is the best way to go (the best way might be some configuration I've overlooked). I can have the publishing service create a certain amount of persistent subscriptions at start-up (i.e. create 30 subscribers named 'Subscriber-n", where n goes from 1 to 30), disconnect each of these 30 subscribers immediately, and then have the clients connect using one of these pre-created subscriptions. Since the subscriptions are persistent, they will receive every message since start-up.
I know a database should work as well, but I need to use JMS.
Any suggestions or comments?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4252505#4252505
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4252505
More information about the jboss-user