| < Day Day Up > |
|
Some best practices for JMS and WebSphere MQ are:
Use message timeouts.
Using message timeouts avoids large numbers of messages remaining on a queue, thus reducing performance overheads. It also allows the relevance of messages to be evaluated. For example, a message may not be relevant after a certain period of time because the information has been superseded.
Use message selectors.
Message selectors allow the underlying provider (through JMS) to browse messages before they are retrieved with little application code.
Persistent versus non-persistent.
Only use durable messages when necessary. This option needs to be explicitly set to non-persistent, as the default in JMS is persistent.
Clusters.
The use of IBM WebSphere MQ clusters allows simple administration, and automatic workload management and failover.
Message producers.
EJB message producers: In a request/reply scenario, it is important that the issue of blocking calls is dealt with correctly. Essentially, EJBs should only be used with appropriate request/reply timeouts and retries.
Message consumers.
Message-driven beans: Business logic should not be implemented in the message-driven bean. Implement the business logic in another component, such as a session bean, and use message-driven beans only for receiving the message. Never throw application exceptions in the onMessage method.
Consider using XML-based messages for inter-application integration.
XML is commonly used as a messaging structure that allows for a more portable inter-application integration model. Although it does add some overhead to the message payload size and requires XML parsers, it is quickly becoming a standard for inter-operability.
| < Day Day Up > |
|