Best Practices

JMS is a versatile API to support the design of reliable, flexible, and high-performance enterprise applications. One of the basic design guidelines is selecting which messaging model the application will use. Another important decision is what type of message is appropriate. Choosing the message size depends on the type of message you decide to use, which in turn has an impact on application performance. Smaller size gives better performance and vice versa. For example, ByteMessage takes less memory than TextMessage and can support Unicode. ObjectMessage carries a serialized Java object, and you need to specify the transient keyword for members that need not be exchanged to reduce overhead.

In general, a good practice is closing ...

Get Sams Teach Yourself EJB in 21 Days now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.