Events received after unsubscribe
|
|
---|---|
Hello, Using the Tango Java API, I have an issue with the unsubscribe_event() method. After subscription, I'm receiving the events as expected (although I get a 'No heartbeat' message). After a while, the unsubscribe() method is called, but the messages are still received. I've attached my test case, and the corresponding output. Any hints? Thanks, Jerome PS: I'm running the Tango VM TangoBox-9.2_RC11, and running my test case on my laptop using JTango-9.1.2.jar |
|
|
---|---|
Using the Tango Java API, I have an issue with the unsubscribe_event() method. Hi Jerome, It looks like you are not receiving the events as expected. The "No heartbeat" error events are a sign that your system is not well configured for the events to work properly. You got the impression the events were working because your callback was executed but it looks like no event was transmitted via ZMQ in your use case. When you subscribe to an attribute event, Tango will first read the attribute synchronously (using CORBA) to get the current value and will call your callback with this value. This is the first event you received in your case:
Then Tango is expecting to receive at least once every 10 seconds an heartbeat event coming from the admin device responsible for the device where is the attribute you subscribed to. In your case, it looks like your client is not receiving the expected heartbeat event within 10 seconds so this is triggering a reconnection attempt every 10 seconds which is basically a new subscription attempt, so there is a new attribute read synchronous (CORBA) call and your callback is executed again. Still it looks like there is an issue with the unsubscribe_event method in your specific case indeed. In your case it would be good to fix the heartbeat problem which is usually coming from some network config issues (using network aliases) or when using different TANGO_HOST definitions on client side and server side. Hoping this helps a bit. Reynald
Rosenberg's Law: Software is easy to make, except when you want it to do something new.
Corollary: The only software that's worth making is software that does something new. |
|
|
---|---|
Hi Reynald, Thanks a lot, this is working as expected now! Indeed, I used a hostname that was different from the TANGO_HOST name. I still have an issue to stop the Tango threads related to connection to Tango and Zmq. How can I free all the allocated resources and threads? Are there dedicated methods to call for this? (In this case my test case JVM would terminate) Thanks, Jerome |
|
|
---|---|
(For clarity I've asked my last question in a separate topic) |