-
1. Re: Dynamically create JMS destinations in clustered environ
vaidyatcr Mar 28, 2005 5:53 AM (in response to chris_pollentier)Hello,
I noticed that you'd posted this a while ago but haven't got a response yet. I have pretty much the same problem, so if you did resolve it, can you please respond how?
On the other hand, if you haven't been successful, then I will let you know if I get a solution.
Thanks -
2. Re: Dynamically create JMS destinations in clustered environ
chris_pollentier Mar 29, 2005 12:36 PM (in response to chris_pollentier)Hi,
I did indeed found a solution for this.
Check wiki:
http://www.jboss.org/wiki/Wiki.jsp?page=JBossHASingletonRemoteAccess
This wiki explains how to deploy an RMI invoker that can be used to invoke methods on singleton MBeans from anywhere in the cluster.
This invoker is deployed as a singleton (deploy-hasingleton) on the each node in a cluster, and binds itself to HAJNDI, which makes it available cluster-wide.
The invoker will delegate all calls to it's local MBeanServer. Since the RMIAdapter is deployed in the deploy-hasingleton directory, this will always be the MBeanServer that is also running the JMS DestinationManager MBean
After you deploy this RMI invoker, you can create a queue at runtime by invoking the DestinationManager through this rmi-invoker:
// Get HAJNDI InitialContext
Properties env = new Properties();
env.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
env.setProperty(Context.PROVIDER_URL, "localhost:1100");
env.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
InitialContext context = new InitialContext(env);
// Get the RMI Invoker
RMIAdaptor rmiAdaptor = (RMIAdaptor) context.lookup("jmx/invoker/SingletonRMIAdaptor");
// Create the queue by delegating the call to the 'master' server
// through the RMI invoker
ObjectName objectName = new ObjectName("jboss.mq:service=DestinationManager");
rmiAdaptor.invoke(objectName, "createQueue", new Object[] {name}, new String[] {"java.lang.String"});
This solution is working fine for me. Hope it helps you as well.
Regards,
Chris -
3. HOWTO:Dynamically create persistent JMS destinations in clus
umeshs79 Mar 30, 2006 6:44 AM (in response to chris_pollentier)Hi,
Is this way queue will be persitent..? and will the queue be added on secondary JMS server(i.e. which is not Master node)
I need to do the same and I need the queue to be persistent and should be added on both node.
Regards,
Umesh -
4. Re: Dynamically create JMS destinations in clustered environ
chris_pollentier Mar 31, 2006 9:40 AM (in response to chris_pollentier)The queue will be persistent if you configured the JMS provider to use persistent queues (the file hsqldb-jdbc2-service.xml in the deploy-hasingleton/jms directory configures the persistent storage using hypersonic DB)
There is no secondary JMS server where the queue can be added. When deploying JMS on a clustered environment, it is running ONLY on the master node.
Any node using JMS must connect to this node. If the node goes down, it gets redeployed on the newly selected master node (this occurs for all services deployed in the deloy-hasingleton directory)
The service described in this thread describes a service that automatically detects the master node, and delegates the creation of JMS queues to that node. When the master node goes down, and a new node is selected to host the JMS provider, then the service will automatically direct the subsequent queue creation calls to that new node.
For 'normal' usage of JMS (sending / receiving), use the cluster wide jndi-context (listening on port 1100) to get the JMS ConnectionFactories. The connection factories will take care of routing the message to the correct node .
The RMIAdapter is intended to be used to invoke a method on an MBean on the master node of a cluster (e.g. when trying to create a queue at runtime), -
5. JBoss Support for JMS clustering
jaink Apr 5, 2006 5:06 PM (in response to chris_pollentier)Hi,
I am new to JBoss and JBoss MQ but need to create clusters with cluster-wide queues and topics. Does JBoss supports it? Is it possible to route messages from one cluster to another?
Thanks. -
6. Re: Dynamically create JMS destinations in clustered environ
brian.stansberry Apr 5, 2006 5:09 PM (in response to chris_pollentier)From one cluster to another, or one server to another within a cluster?
If the latter, yes, JBoss MQ supports clustering. See http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossMQHA. -
7. Re: Dynamically create JMS destinations in clustered environ
jaink Apr 5, 2006 9:59 PM (in response to chris_pollentier)Thanks for replying. Cluster to cluster with cluster being across WAN with possibly a satellite link connecting them.