-
1. Re: Creation of topic @ runtime
gaohoward Jul 14, 2009 8:48 AM (in response to desuraghu)Hi, you need use jmx interface. for example:
MBeanServerConnection mBeanServer = lookupMBeanServerProxy(ic); ObjectName serverObjectName = new ObjectName("jboss.messaging:service=ServerPeer"); String queueName = jndiName.substring(jndiName.lastIndexOf('/') + 1); mBeanServer.invoke(serverObjectName, "deployQueue", new Object[] {queueName, jndiName}, new String[] {"java.lang.String", "java.lang.String"});
-
2. Re: Creation of topic @ runtime
desuraghu Jul 14, 2009 11:50 AM (in response to desuraghu)Is there any other alternative to get ServerPeer MBean instance.
For ex :
---------
MBeanServer mbeanServer = MBeanServerLocator.locateJBoss();
ObjectName objectName = new ObjectName( "jboss.mq:service=DestinationManager");
mBean = (DestinationManagerMBean) MBeanServerInvocationHandler
.newProxyInstance(mbeanServer, objectName,
DestinationManagerMBean.class, false); -
3. Re: Creation of topic @ runtime
timfox Jul 14, 2009 12:20 PM (in response to desuraghu)In both 1.2 and 1.4 the ServerPeer should be visible in the jmx-console in a similar way.
Take a look in the jmx-console to get the object name. -
4. Re: Creation of topic @ runtime
desuraghu Jul 14, 2009 12:22 PM (in response to desuraghu)But in 1.2 we have ServerPeerMBean and in 1.4 this one has been removed.
So we don't have any option to get ServerPeer instance. -
5. Re: Creation of topic @ runtime
timfox Jul 14, 2009 12:29 PM (in response to desuraghu)"desuraghu" wrote:
But in 1.2 we have ServerPeerMBean and in 1.4 this one has been removed.
So we don't have any option to get ServerPeer instance.
That is not correct, ServerPeer is still there in 1.4, here it is in SVN:
http://anonsvn.jboss.org/repos/messaging/tags/JBossMessaging_1_4_4_GA/integration/EAP4/etc/server/default/deploy/messaging-service.xml
And here it is in 1.2:
http://anonsvn.jboss.org/repos/messaging/tags/JBossMessaging_1_2_0_GA/src/etc/server/default/deploy/messaging-service.xml
As I mentioned in my previous post you can see in jmx-console since the object name might have changed. -
6. Re: Creation of topic @ runtime
desuraghu Jul 14, 2009 12:38 PM (in response to desuraghu)I am referring to ServerPeerMBean. In 1.4 I can ServerPeer class.
From jmx-console, I can see and access the ServerPeer MBean.
But my requirement is, I need to create a topic at runtime.
To create a topic, i need ServerPeer instance.
I am trying to create a topic in my application at runtime.
Using jboss-MQ i am able to locate the DestinationManageMBean. In the similar way I am trying to locate ServerPeerMBean. But this interface is not present in 1.4. -
7. Re: Creation of topic @ runtime
timfox Jul 14, 2009 12:41 PM (in response to desuraghu)"desuraghu" wrote:
I am referring to ServerPeerMBean. In 1.4 I can ServerPeer class.
From jmx-console, I can see and access the ServerPeer MBean.
But my requirement is, I need to create a topic at runtime.
To create a topic, i need ServerPeer instance.
I am trying to create a topic in my application at runtime.
Using jboss-MQ i am able to locate the DestinationManageMBean. In the similar way I am trying to locate ServerPeerMBean. But this interface is not present in 1.4.
You are mistaken, this interface *is* present in 1.4. I already posted the MBean descriptors in my previous post. -
8. Re: Creation of topic @ runtime
timfox Jul 14, 2009 12:45 PM (in response to desuraghu)The name of the MBean you are looking for is in 1.4 is ** jboss.messaging:service=ServerPeer **
Note that this name has *changed* from 1.2 so you will need to look in a different place in jmx-console -
9. Re: Creation of topic @ runtime
timfox Jul 14, 2009 12:47 PM (in response to desuraghu)And, by the way, this is a user question, *not* a design question and should have been posted in the user forum.