azure - Automatic reboot whenever there's an uncaught exception in a continous WebJob -


i'm creating continous webjob polling api, , forward messages azure service bus. i've managed work fine, have 1 problem; if app crashes whatever reason? if there's uncaught exception, or goes wrong, , app stops running. how run again?

i created test app, send message every service bus, on 11th message crash due intentionally placed nullreferenceexception. did in order investigate behaviour whenever/if app crashes.

what happens app runs fine first 10 seconds (as expected). messages being sent, , looks good. after 10th second, when exception occurs, nothing happens. no log in azure saying there exception, no reboot - nothing. stands there "running", messages no longer being sent.

how deal this? it's essential application able reboot if fails. there standard ways this? best practices?

any appreciated :)

it handle of failure scenarios in system ourselves rather let hosting environment react failures.

my suggestion have check in code exceptions try catch block in executable script catch different kind of failure scenarios , instead of throwing exceptions, log self or take retry operation if required.

example, when got junk data process , failed. can try operation again eg. 3 times , push log deadletter account manually take care of such junk inputs. , don't let flow stopped throwing exception instead handle self logging message needs manual intervention.

in gui or web applications, if there exception flow re initiated user click , system respond. here background processor, ideal avoid such control flow blockers.

hope help.


Comments

Popular posts from this blog

javascript - Bootstrap Popover: iOS Safari strange behaviour -

Magento/PHP - Get phones on all members in a customer group -

session - Logging Out Using PHP -