Monday, July 14, 2008

Exceptions in JMS Architecture

System Exception Steps
• These exceptions occur because there might be some issues with the system such as any component might be down, could be a database issue, a service is down.
• On any System Exceptions the transaction should be retried a certain number of times with Delay or no delay between message deliveries.
• Always Log the error in the log files and notify the support about the exception.
• Suspend sender process if possible after 1000 number of time (During a Prolonged Outage) - Create a script using JMX to suspend the message Producer
• Try Sending notifications every half an hour/one hour for same errors that you are encountering.
• If message expires then move the expired messages to the expiration queue - This queue must be defined in the jms configuration.
• Introducing a timeout delay in the message consumer could be one possibility
Business Exception Steps
• These types of exceptions could be due to some data issues, some synchronization issues between system. For example customer data is missing in the receiving system.
• These types of errors shouldn't be retried. The data must be fixed and then the transactions should be replayed or retried.
• Always Log the error in the log files and notify the support about the exception.
• Always Put these erred messages and the errors combined as a separate message in the error queue - this must be defined separately in the code
• Try to use a workflow process to generate exception workflows from this error queue.
• Have a UI to browse exception messages to debug or resend these exceptions by support personnel

No comments: