The following code snippet attempts to create a Tib DaemonManager
connecting to a particular rvd, and then query for that rvd's services.
public static void main(String[] args) throws RuntimeException {
DaemonManager daemonManager = new DaemonManager("http://foo.com:7580");
if(daemonManager.getDaemonType() == DaemonManager.RVD) {
DaemonProxy daemonProxy = daemonManager.getDaemonProxy();
final RvdProxy rvdProxy = (RvdProxy) daemonProxy;
Service[] services = rvdProxy.getServices();
System.out.println(services.length); //prints 0
for (Service service : services) {
System.out.println(service.getNetwork());
}
}
}
This prints zero, even though the web interface for this rvd lists multiple available services. Why might this happen?
The daemon I am connecting to is running v 7.5.1 of the software, and the rvconfig.jar
that I am using is from v 7.5.1 as well.
Is there a gotcha when using Tibco's DaemonManager that is causing me to come unstuck?
I used Wireshark to look at the traffic being sent between my
RvdProxy
and the RVD itself, and it looks like a lot ofHTTP GET
traffic. For example:Sure enough, upon further inspection, it turns out that the requests being made by the proxy are to the web pages served by the Daemon itself - so the proxy API is just a screen-scraper.
But why am I getting no services if they appear on the web pages that are being screen-scraped?
Switch on debugging:
And you find that the pattern being used to extract the services from the web-page...
...fails to match anything! In my case it is because my service networks are not of the form
(\\d+\\.\\d+\\.\\d+\\.\\d+)
but rather of the form;(\\d+\\.\\d+\\.\\d+\\.\\d+)
- note the leading semicolon. This subtle difference is the source of all of my problems!This looks like a bug in the
rvconfig
jar - which needs to be raised with Tibco! :(