[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Managing JMS using JMS
adrian@jboss.org
do-not-reply at jboss.com
Fri Mar 30 06:52:37 EDT 2007
I suggested this before, but I don't think I wrote it up fully in the forums
so here goes.
It should be possible to manage JMS using JMS,
i.e. create queues, topics, connection factories by sending messages to
a management queue (which is suitably secured).
It would then possible to do something like:
| queue = (Queue) jndi.lookup(JBossJMS.ManagementQueueName):
| QueueRequestor r = new QueueRequestor(session, queue);
| Message request = session.createMessage();
| request.setStringProperty(JBossJMS.OPERATION, JBossJMS.CREATE_QUEUE);
| request.setStringProperty(JBossJMS.DESTINATION_NAME, "myQueue");
| request.setIntegerProperty(JBossJMS.QUEUE_DEPTH, 1000);
| // etc.
| Message response = r.request(m);
| // check the response
|
More likely would create a class that does all this boiler plate for you,
e.g.
| manager = new JBossJMSManagement(session);
| QueueTemplate template = manager.createQueueTemplate();
| template.setQueueDepth(1000);
| manager.createQueue("myQueue", template);
|
Once this is done, JBossMQ could also implement a queue
that handles the same requests which would provide portability across releases.
This is superior to the JMX approach since it will also work "remotely".
In fact, the location of the jms server is transparent and automatic
based on the connection factory the user looks up.
If this had been done when I first requested it, people could have already been
using it.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4033100#4033100
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4033100
More information about the jboss-dev-forums
mailing list