you should shutdown client/consume entity/etc in try/(catch/)fianlly