[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [xmlblaster] null oid in unsubscribe



Hi Jason,
The 'oid is null' message tells you no topic was hit by your XPATH query. This is probably the case since your message was erased (either explicitly or by a timeout).


If you want to unsubscribe even when the topic is not here anymore, you could keep the SubscribeReturnQos when subscribing (lets call it subRet). Then when unsubscribing invoke:

UnSubscribeKey uk = new UnSubscribeKey(glob, subRet.getSubscriptionId());
 UnSubscribeQos uq = new UnSubscribeQos(glob);
 UnSubscribeReturnQos[] urq = con.unSubscribe(uk, uq);

I think this is a better approach since you specify exactly which subscription you want to remove.

Saluti
Michele



Jason Martin wrote:
Another question; how does one unsubscribe from a dead topic.
Scenario:

1. Subscribe to oid
2. Message gets published and consumed.
3. Time passes.
4. Attempt to unsubscribe via xpath, get 'oid is null' error.
5. New message published and consumed.
6. Immediately unsubscrube, get ok result.

Am I missing something about how unsubscribes work?

-Jason Martin


--
Michele Laghi
mailto:laghi at swissinfo.org
tel. +46 8 7492952 / mob. +46 70 4103964
http://eclettic.tripod.com
http://www.xmlBlaster.org