I'm trying to close durable subscription so messages are not stored on server anymore. I disconnect all listeners and do
ConnectionFactory cf = (ConnectionFactory)context.lookup(tcfurl);
Connection connection = cf.createConnection(user, password);
connection.setClientID(clientId);
connection.start();
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
TopicSubscriber subscriber = session.createDurableSubscriber(topic, subName);
subscriber.close();
session.unsubscribe(subName);
Here I got exception "Not allowed to unsubscribe configured durable". I had an idea that it could be if some durable consumet is running, but I checked that they are not connected. Could you please advice on it? Thanks.
It was a limitation in our installation of tibco ems: it is not allowed to unsubscribe durable subscribers programmatically.