Unsubscribe single listener

2 posts / 0 new
Last post
jmsalas
Unsubscribe single listener

Hi,

I am trying to unsubscribe a single listener using the java API. However the listener event OnUpdate is still triggered after unsubscribing. No error when trying to unsubscribe.

To unsubscribe, I store in a hashmap the SubscribedTableKey at the time of subscribing an epic to the listener. The HashMap is defined as below:

private HashMap epicStreamers = new HashMap();

And then I try to unsubscribe using my key (the epic name):
teLightStreamerComponent.unsubscribe(epicStreamers.get(epicName));

This is pretty much following the logic in the sample SDK unsubscribeAllLightstreamerListeners(), where it goes through the listeners in a loop getting the SubscribedTableKey for all of them:
teLightStreamerComponent.unsubscribe(listener.getSubscribedTableKey());

Could you please help?
Is there a better way to unsubscribe selectively the epics I want?

If not, is there a limit on the number of times I can subscribe/unsubscribe?

Thanks,

Jose M.

Chris
Re: Unsubscribe single listener

Hi jmsalas,

The sample just calls the LS client to forcefully unsubscribe. It may be worth trying to call:

Ls_client.unscribeTable(…)

instead and check if that fails. We can check the LS logs to see if there were any unsubscribe failures – but would need a subscription key and time at which you tried to unsubscribe (please send in via Contact Us.

Does this happen all the time for all subscription types (OPUs, confirms, etc.) or just some of them? The unsubscribe button on the streaming companion (javascript) appears to work ok.

Chris

Log in or register to post comments