Java Reference
In-Depth Information
If you want a fine control over the pool size, you can specify the min-pool-size
and max-pool-size elements, which determine the initial and maximum size of
the connections stored in the pool:
<pooled-connection-factory name="hornetq-ra">
<min-pool-size>10</min-pool-size>
<max-pool-size>50</max-pool-size>
...
</pooled-connection-factory>
Specifying which message to receive using selectors
Message selectors allow an MDB to be more selective about the messages it re-
ceives from a particular topic or queue. Message selectors use message properties
as a criteria in conditional expressions. Message properties, upon which message
selectors are based, are additional headers that can be assigned to a message.
They give the application developer the ability to attach more information to a mes-
sage. This information can be either stored as String or using several primitive val-
ues ( boolean , byte , short , int , long , float , and double ).
For example, let's suppose that we want to process two kinds of messages with the
same queue:
• A trace message indicating that a user booked a seat
• A warning message indicating that an error occurred
Hence, our sendMessage method can be changed slightly to include a String
property that can be attached to the message:
public void sendMessage(String txt, String
priority) {
try {
connection = cf.createConnection();
Session session =
connection.createSession(false,
Search WWH ::




Custom Search