This is more of a best practice question for the common case of an application receiving messages, persisting them to a database, and possibly sending messages as a result.
- Assume transactionality sorts out atomic commit; what is a good policy on when to shut the application down altogether?
- If the database fails, the application could get flooded by messages, which it will end up rejecting. Should it give up immediately?
- If the outbound messaging service fails, the database will be flooded with rollbacks. Again, is it best to give up immediately?
More brownie points for any hints on how to best force a spring app to shut down in this case, as the default listener contain will catch any runtime exception and keep running.