[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [xmlblaster-devel] Get connection states of connected nodes...

Matthew Sargent wrote:

I can see lots of info about the admin messages and such, but is it possible for me to access these from my connected client programattically? I would like to report to the user of my client the status of the remote node. My client connects to the local xmlBlaster via an SSL connection, the telnet port to the remote machine is not open. The only connection between my local xmlBlaster and the remote one is via the SSL as well (for security purposes)
Hmm, i'm not sure i understand you here.
The "__cmd:" messages can't currently access everything what JMX can (as seen in jconsole).
Probably adding a "__jmx:" prefix to do a JMX query over a xmlBlaster-message could resolve

Is it this you  are after?


and that gives me the nodeList, but when I attempt to get any information
about any of those nodes, I get an error:

errorCode=user.illegalArgument message=#1.1.1 Query of foreign cluster node
'vsp' is not implemented, sorry '/node/vsp/?numTopics' rejected
Yes, the forwarding of a __cmd to the remote cluster node to find out its attributes (like topic names) is not implemented.

I can, however, query my local node for the same information and I get it:

<key oid='__cmd:/node/stauntonstc/?numTopics'/>' =  <qos> <isGet/> </qos>
<key oid='__cmd:/node/stauntonstc/?numTopics'/> <content

I really just need a simple method to make sure that my local cluster node
is in contact with the others.
See my first remark above, isn't this enough then?


----- Original Message ----- From: "Marcel Ruff" <mr at marcelruff.info>
To: <xmlblaster-devel at server.xmlBlaster.org>
Sent: Wednesday, March 08, 2006 7:56 PM
Subject: Re: [xmlblaster-devel] Get connection states of connected nodes...

Matthew Sargent wrote:

We are using the simple domain to master mapping and have setup
several mater/slave relationships. I would like to test if the
xmlBlaster instance I am connected to is further connected to others
in the cluster. I have a list of domains that I am making
subscriptions to and would like to use those to figure out if the
masters associated with each particular domain is connected. I see
many examples if you already have the master node id, but is there a
way to get the master node id for a domain so I can use that to query
the connection state?
Hmm, probably not out of the box ...

What you can certainly to is to register a native plugin in
you can take a copy of org.xmlBlaster.engine.EventPlugin.java as a base
and throw
out everything you don't need.
Find the code line where
  this.engineGlob = ...
is assigned.
With this you can call

   ClusterNode[] nodes =
   for (int i=0; i<nodes.length; i++) {
      ClusterNode node = nodes[i];
      node.getConnectionState();  // See javadoc, marks alive, polling
      node.getId();               // the nodes name

Now you know the cluster nodes and if the connection is alive.

On the other side note that the EventPlugin implements
With this listener you get notifed about all coming and going
  public void subscriptionAdd(SubscriptionEvent subscriptionEvent) {
      SubscriptionInfo subscriptionInfo =
      String domain = subscriptionInfo.getKeyData().getDomain();
  public void subscriptionRemove(SubscriptionEvent subscriptionEvent) {

Now you know about all subscribed domains.

You could now publish a PtP message to the clients interested or better
publish the current list
to a topic (say oid="myCurrentDomainList") where your clients retrieve
it from with get().


I would like to use the con.get() to gather this information
periodically so I can report on connection status.