activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From qin ding <qindi...@yahoo.com>
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 
map
2. When a user is sitting at a tble, I create a listener for that table's 
topic/destination
3. When the game starts, all the user sitting at the same table an exchange the 
information
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.

QD



----- Original Message ----
From: "clark.obrien@ttmsolutions.com" <clark.obrien@ttmsolutions.com>
To: users@activemq.apache.org
Sent: Fri, July 16, 2010 11:56:28 AM
Subject: Re: Please Help

QD,
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.


-clark
-----Original Message-----
From: qin ding [mailto:qinding1@yahoo.com]
Sent: Friday, July 16, 2010 09:07 AM
To: users@activemq.apache.org
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 
advise.QD



      

Mime
View raw message