Best Practices

As mentioned on Day 2, “Understanding EJB Types and Interfaces,” you should consider using a message-driven bean when you want to develop loosely coupled systems and process asynchronous messages.

Consider using message-driven beans, instead of standard JMS consumers, in situations in which you need the power of EJBs, such as security and transaction management. Another benefit is that the EJB container can create multiple instances of a message-driven bean to process large volumes of messages concurrently. On the other hand, a message-driven bean can be associated with a single JMS Destination (Topic or Queue). So, if your application requires a single JMS consumer to process messages from multiple Topics or Queues, you must use a standard JMS consumer or deploy multiple message-driven bean classes.

Consider tuning the message-driven bean's instance pool size. For best performance, the maximum number of beans in the pool should be equal to the maximum number of concurrent messages. If the pool size is less than the number of concurrent messages, messages have to wait for an available bean, which degrades performance.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.51.228