activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From qin ding <>
Subject Re: Please Help
Date Sun, 18 Jul 2010 13:06:20 GMT
Thanks. specifically what should I implement "one topic per table".  My message 
Producer creates a reply Destination and set this destination to the message 
jmsReplyto property.  This destination is dynamically reacted using the 
tableName informaiton.  If the table name is "mytable", then the topic becomes 
"game.mytable".  So the reply message will be deliered to this Destination.  
Now, how do I dynamically switch listener on the  consumer side so that when the 
message arrives at the game.mytable topic, I can get the message from 
game.mytable rather than from other topic.

1. when a table is created, I create a destination and store it in the static 
2. When a user is sitting at a tble, I create a listener for that table's 
3. When the game starts, all the user sitting at the same table an exchange the 
3. when a user leaves from the table, the listener should be removed
4. when a game is over, the topic/destination should be removed from server.

Is the plan workable in activemq?  Do anyone implement this kind of usecase 
already?  Any advise, suggestions, and comments are greatly appreciated.


----- Original Message ----
From: "" <>
Sent: Fri, July 16, 2010 11:56:28 AM
Subject: Re: Please Help

I would go with one topic per table . Using selectors is possible but will 
degrade performance and will also limit your options for achieving horizontal 
scalability down the road.

-----Original Message-----
From: qin ding []
Sent: Friday, July 16, 2010 09:07 AM
Subject: Please Help

Hi, I am using activemq to implement my game. I have n number of game tables and 
n number of players at each table. Right now, a queue is setup to send all 
requests from all users of all tables. A request handler listens to the queue, 
after the request arrives, it processes the request and then sends a response to 
a topic. All players are subscribed to the topic. Therefore they all receive the 
same response.This is not exactly what I want. I want all players at one table 
receives the message. Say, player1 and player2 sit at the table1. When a player1 
send a request, and both player1 and player2 get the response; but no other 
players at other tables should get the response.First I thiink the selector is 
good for this usecase. tableName = '[table name value]' but since the table name 
is runtime property, I don't know how it can be implemented.Then I think use the 
message group. However, I don't see the expected result after I add 
replyMessage.setStringProperty("JMSXGroupID", tableName);.Then I think I should 
create one topic for one table and make players at the table subscribe the 
toptic. In this case, lots of topics will be created depending on the tables are 
created at runtime. And I need to find way to clean the topics when tables are 
no longer used.What should I correctly implement the use case? In brief, all 
players sit at one table should be communicated or share messages among 
themselves. Players from different tables do not.Thank you very much for any 


View raw message