Anyone help out w/ the order of creation of a dynamic queue. What's in the docs is nothing close to what's in the JBoss src (the only examples I could find). I'm trying to create a dynamic queue locally to the server.
 
...
   // really don't understand the MBeans, in the src, I see an MBean
   // is created ... in the docs, it's findMBeanSever( ...
 
   MBeanServer server = (MBeanServer) MBeanServerFactory.findMBeanServer(null).iterator().next();
   server.invoke(new ObjectName("JBossMQ", "service", "Server"), "createQueue", new Object[] { bInfo.getNodeName() }, new String[] {"java.lang.String"});
 
   context = new InitialContext();
 
   connectionFactory = (QueueConnectionFactory)
   context.lookup("QueueConnectionFactory");
 
   connection = connectionFactory.createQueueConnection();
 
   session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
 
   // really not sure if I still use the "queue/" prefix and how to grab the new queue
   // or if any of this is still to be done ...
   queue = (Queue)context.lookup("queue/" + bInfo.getNodeName());
 
   sender = session.createSender(queue);
 
   ObjectMessage message = session.createObjectMessage();
   message.setObject(bInfo);
 
   sender.send(queue, message);
...

Reply via email to