unSubscribe to a solcache topic

alinaqvi
alinaqvi Member Posts: 35

Currently we use the following code to subscribe to a solcache topic:

   cacheSession.sendCacheRequest(Long.valueOf(10011l), "my/topic", true, 
   CacheLiveDataAction.FLOW_THRU,
                new CacheRequestListener() {

                    @Override
                    public void onException(Long arg0, Topic arg1, JCSMPException arg2) {

                        LOG.error("Consumer Received exception for solace-cache-topic:" + arg2);

                    }

                    @Override
                    public void onComplete(Long arg0, Topic arg1, CacheRequestResult arg2) {

                        String str = String.format("Completed Cache Request for topic: %s with status: %s", arg1.getName(), arg2);

                    }

                });

Is there any way to unSubscribe to this async request(when needed) so that we dont keep on receiving any new messages being published on this topic?

Many Thanks,
Ali

Best Answer

Answers