cascClient.removeClientSubscriptionId(msgToForward.getSessionId());
Map<String, SubscriptionMask> clnSubscriptions = cascClient.getClientSubscriptionIds();
if (clnSubscriptions.size() == 0) {
// cascaded client can unsubscribe himself
SCMPCscUnsubscribeCall cscUnsubscribeCall = new SCMPCscUnsubscribeCall(this.requester, msgToForward);
// set cascaded client subscriptonId
msgToForward.setHeader(SCMPHeaderAttributeKey.CASCADED_SUBSCRIPTION_ID, cascClient.getSubscriptionId());
try {
cscUnsubscribeCall.invoke(callback, oti);
} finally {
cascClient.setSubscribed(false);
cascClient.destroy();
}
return;