Unsubscribe single listener

2 posts / 0 new
Last post
Unsubscribe single listener


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):

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:

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?


Jose M.

Re: Unsubscribe single listener

Hi jmsalas,

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


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.


Log in or register to post comments