Stuart_Brierley

JAVA - Problems with NimSubscribe subscribeForQueue

Discussion created by Stuart_Brierley on Dec 23, 2013
Latest reply on Dec 24, 2013 by Stuart_Brierley

Hi all,

 

I'm writting a probe in Java and it needs to subscribe to a queue on a remote hub. I'm using NimSubscribe subscribeForQueue which successfully subscribes to a queue (as I can see it in the status) but when I post a message to the queue it disconnects the subscriber. There is no exception generated so I can't tell what's going on. The code is very straightforward...

 

try {

     subscription_local = new NimSubscribe("nri_collector","/eudev0/nimhubd2.uk.db.com/nimhubd2.uk.db.com",true);

}

catch (NimException e) {

     logger.logStackTrace(0, e);

}

try {

     subscription_local.subscribeForQueue("NRI_COLLECTOR_1",this,"process_message");

}

catch (NimException e) {

     logger.logStackTrace(0, e);

}

 

publicvoid process_message(NimSession session, PDS pdsdata, PDS pdsuserdata) throws NimException {

     System.out.println("Running");

     PDS retpds = new PDS();

     retpds.put("retstat","OK");       

     session.sendReply(NimException.OK, retpds);

}

 

Unfortunately, the code wizzard only generates code that uses NimProbe to subscribe to a message subject so it's difficult to tell if I'm using this correctly. I don't want to use NimProbe as I have a requirement to create several threads wach with their own queue. I'm not sure I'll be able to do this with the NimProbe callback.

 

Any ideas what mmight be going wrong here or how I could trace it?

Outcomes