Archived
This forum has been archived. Please start a new discussion on GitHub.
Exception in IceStorm subscriber's report function leads to disabled topic
Hello,
whenever an exception is thrown in a subscriber's report function of an IceStorm topic, the report function on the subscriber is never called again although the publishers still publishes.
Is this intended? Is there a flag to configure that behavior?
Thanks
whenever an exception is thrown in a subscriber's report function of an IceStorm topic, the report function on the subscriber is never called again although the publishers still publishes.
Is this intended? Is there a flag to configure that behavior?
Thanks
0
Comments
-
Hi,
That's the expected behavior. Our documentation describes this:If IceStorm encounters a failure while attempting to deliver a message to a subscriber, the subscriber is immediately unsubscribed from the topic on which the message was published.
Regards,
Mark0 -
Ok, thank you. I didnt find that.
But also that sounds to me that it means, the subscriber will be unsubscribed, when there is a problem with IceStorm and not when the subscriber encounters an error itself.
Maybe you can clarify that in the documentation.0 -
Hi,
I'm not sure what you mean by "problem with IceStorm". When delivering a message, IceStorm does the equivalent of this:try { subscriber->report(args); } catch(Exception ex) { // cancel this subscriber }
The only errors that can really occur here are connection errors (where IceStorm cannot connect to the subscriber) or run-time errors in the subscriber (where an exception is raised and reported to IceStorm as an UnknownException). In either case, it indicates that there is something wrong with the subscriber (either temporarily or permanently), and so IceStorm cancels its subscription.
Regards,
Mark0 -
Hi,
I just wanted to say, that the documentation there is not clear to me as a normal user.
I dont know if there could be problems with IceStorm and the description reads like in case of problems with IceStorm the subscriber gets unsubscribed.
Is there a possibility to get notified when a subscriber gets unsubscribed?0 -
Ok, I've updated that page to try to be more clear about subscriber failures.Is there a possibility to get notified when a subscriber gets unsubscribed?
Could you provide more detail about your use case?
Regards,
Mark0 -
Well, I dont want the subscribers to be unsubscribed, when they threw an exception once.
Also I dont want to try{}catch(...){} all report functions.
Our subscribers dont care much if one report function caused an error because all report function calls are independent from each other.
Also the report functions are implemented by persons who dont know that an error would cause unsubscription (like I didnt know until yesterday )
So, if the subscriber would be notified on unsubscription, I could resubscribe again.0 -
Subscribers can define the retryCount quality-of-service parameter to configure how many times IceStorm will retry before removing a failing subscriber. For example, you can set it to -1 and IceStorm will never remove a subscriber (except in a couple of exception scenarios). See the manual for more information on this.
I think the important question is Why are subscribers throwing exceptions? Is it a programming error? Or is it just a temporary failure caused by some other resource? Some situations indicate a problem that will likely never be corrected, so retrying won't change the outcome. Other situations could benefit from a non-zero retryCount.
Mark0 -
The retries send the same call then again and again, right?
The same call will probably cause the same error again.
But the next call might has different data in the parameters and the exception probably wont happen on the next call.
The failure is caused by some ill-formed data (e.g. a null pointer is some of the data) from the publisher, which is not handled on the subscriber side. But the next call probably contains different data, which does not lead to an exception and my subscribers just want to stay subscribed.0 -
Yes, IceStorm retries will try to send the same message again. IceStorm does not have a setting that would cause it to discard a message that results in an error while keeping the subscription active.
You'll either need to correct the problem in the publisher, change the subscribers to trap and ignore it, or use a different publish/subscribe solution.
Mark0 -
Ok, thanks for your help. Maybe I can figure out a solution.
Is there a way to get a list of all subscribers to a topic?0 -
The Topic interface provides a getSubscribers operation, but it returns a sequence of identities, not proxies. You wouldn't be able to use these identities to resubscribe a subscriber unless you also knew that subscriber's endpoints, or unless the identities were "well-known objects" (i.e., you're using IceGrid).
Mark0