-
1. Re: Monitoring topic created at runtime
midnightmare Jul 12, 2013 5:33 AM (in response to midnightmare)1 of 1 people found this helpfulI have found this solution with CLI:
Create a file topic.cli with these commands:
connect
jms-topic add --topic-address=myTopic --entries=topic/myTopic
quit
Then, lauch this shell command:
[JBOSS_HOME]/bin/jboss-cli.sh --file=topic.cli
For remove a topic create a file with these commands
connect
jms-topic remove --topic-address=myTopic
quit
-
2. Re: Monitoring topic created at runtime
sfcoy Jul 12, 2013 5:44 AM (in response to midnightmare)Is there any particular reason that you need to create topics dynamically?
-
3. Re: Monitoring topic created at runtime
midnightmare Jul 12, 2013 8:17 AM (in response to sfcoy)In my web application I need to create a topic for every new registered user
-
4. Re: Monitoring topic created at runtime
sfcoy Jul 12, 2013 9:07 AM (in response to midnightmare)How many users do you have?
I'm not sure that your plan will scale very well.
-
5. Re: Monitoring topic created at runtime
midnightmare Jul 12, 2013 11:43 AM (in response to sfcoy)Uhm, about two hundred, but most of them, not cuncurrently.
-
6. Re: Monitoring topic created at runtime
sfcoy Jul 15, 2013 1:51 AM (in response to midnightmare)How are you consuming messages from these dynamicaly created topics?
-
7. Re: Monitoring topic created at runtime
midnightmare Jul 15, 2013 3:16 AM (in response to sfcoy)When a user is logged he receives messages from users that had sent to him
-
8. Re: Monitoring topic created at runtime
sfcoy Jul 15, 2013 3:27 AM (in response to midnightmare)That tells me what you're trying to do, but not not how you plan to do it. What java code are you using to consume messages?
-
9. Re: Monitoring topic created at runtime
midnightmare Jul 15, 2013 4:08 AM (in response to sfcoy)I will use an instance of TopicSubscriber class, and I will call the method receive...
I don't know if you need of an example to understand or is only for curiosity?
-
10. Re: Monitoring topic created at runtime
sfcoy Jul 15, 2013 8:40 AM (in response to midnightmare)So long as you're sticking to the constaints listed in "EE.6.7 Java™ Message Service (JMS) 1.1 Requirements" of the JavaEE spec, I guess you should be OK.
I would avoid calling the blocking javax.jms.MessageConsumer#receive() method though. Use one of the other variants.
If you're using a topic per user, why not use a queue instead? You can then use a javax.jms.QueueBrowser to look at pending messages.
-
11. Re: Monitoring topic created at runtime
midnightmare Jul 15, 2013 9:16 AM (in response to sfcoy)I have chosen the topic because there are more than one receiver for every sender