Hello...
I need to create new topic in Jboss 5.0.1 from java applications. Did someone know how to
do this.
In Jboss 4.0.1sp1 I do this using next method in Java:
| private void createTopic(String topicName) throws NamingException,
InstanceNotFoundException, MBeanException, ReflectionException, IOException {
| Properties props = new Properties();
| props.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
| props.put(Context.PROVIDER_URL, "jnp://localhost:1099");
|
| InitialContext iniCtx = new InitialContext(props);
|
| try{
| iniCtx.lookup("topic/" + topicName + "");
| }catch (NameNotFoundException e) {
| ObjectName destinationManager =
ObjectNameFactory.create("jboss.mq:service=DestinationManager");
| RMIAdaptor server = null;
| server = (RMIAdaptor) iniCtx.lookup("jmx/invoker/RMIAdaptor");
| server.invoke(destinationManager, "createTopic", new Object[] {
topicName, "topic/" + topicName }, new String[] {
| String.class.getName(), String.class.getName() });
| }
| }
|
|
I try to modificate previous code to work with Jboss 5.0.1GA, but I not success. Sorry on
very bad English.
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4227329#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...