13.5 Best practices

 < Day Day Up > 



13.5 Best practices

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 > 



Patterns Direct Connections for Intra- And Inter-Enterprise. Direct Connections for Intra- And Inter-Enterprise (IBM Redbook) (Paperback)
Patterns Direct Connections for Intra- And Inter-Enterprise. Direct Connections for Intra- And Inter-Enterprise (IBM Redbook) (Paperback)
ISBN: N/A
EAN: N/A
Year: 2003
Pages: 139

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net