Consumer application basics
For a JMS consumer application, perform the basic steps contained in this topic.
- Retrieve a connection factory object from a JNDI repository.
- Create a connection using the connection factory object.
- Create a session using the connection object.
- Retrieve a destination object from a JNDI repository.
- Use the session object and the destination object to create a message consumer.
- Use the message consumer to receive messages from the destination.
In order for a consumer to receive messages, there must be a producer sending messages to the same destination from which the consumer is attempting to receive.
For persistent or transacted workloads on Eclipse Amlen, you can maximize performance by increasing the value of IMADeliveryThreads environment variable. The IMADeliveryThreads environment variable has a default value of 2. In persistent or transacted workloads it can be helpful to increase this value up to 100. The optimal value depends on several factors:- The number of cores that are allocated to the Eclipse Amlen VM.
- The number of cores that are allocated to the application using the Eclipse Amlen JMS client library.
- The number of concurrent and active connections between the application and the Eclipse Amlen VM.
As these numbers increase, you can increase the value of IMADeliveryThreads to maximize performance.