5.7.2. Configuring Queues

5.7.2.1. Queue MBean Attributes

Name
Defines the queue name.
JNDIName
Defines the JNDI name that binds the queue.
DLQ
Defines the DLQ (Dead Letter Queue) for this queue and overrides any value set in the Server Peer configuration file.
ExpiryQueue
Defines the expiry queue and overrides any value set in the Server Peer configuration file.
RedeliveryDelay
Defines the redelivery delay to be applied to this queue and overrides any value set in the Server Peer configuration file.
MaxDeliveryAttempts
Defines the maximum number of times message delivery is attempted before the message is sent to the DLQ, if configured. The default value, -1, means that the value from the Server Peer configuration file is used. Any other setting will override the value set in the Server Peer configuration file.
CreatedProgrammatically
Returns true if the queue was created programmatically.
MessageCount
Returns the total number of messages in the queue. That is, the number of messages being scheduled plus the number being delivered, plus the number not being delivered.
ScheduledMessageCount
Returns the number of scheduled messages in the queue. This is the number of messages scheduled to be delivered at a later date.
Scheduled delivery lets you specify the earliest time at which a particular message will be delivered. For example, you can send a message now, and specify that it will not be delivered for two hours. To do so, set the following in the message header:
              
long now = System.currentTimeMillis();

Message msg = sess.createMessage();  
    
msg.setLongProperty(JBossMessage.JMS_JBOSS_SCHEDULED_DELIVERY_PROP_NAME,
  now + 1000 * 60 * 60 * 2);

prod.send(msg);

MaxSize
Specifies the maximum number of messages that can be held in a queue. Any excess messages will be dropped. The default value is -1, which is unbounded.
Clustered
This attribute must be set to true if the destination is clustered.
MessageCounter
Each queue maintains a message counter.
MessageCounterStatistics
The statistics for the message counter.
MessageCounterHistoryDayLimit
The maximum number of days for which to hold message counter history. Overrides any value set in the Server Peer configuration file.
ConsumerCount
The number of consumers currently consuming from the queue.
DropOldMessageOnRedeploy
Specifies how queue services with clustered attributes that differ from previously deployed attributes are handled. If set to true, all remaining messages in the queue are deleted after the queue service re-deployment if the queue service attribute contains a different clustered attribute. If set to false (default), all messages are reserved.

Warning

When you re-deploy a destination, you must shut down all the nodes in the cluster, make proper configuration changes, and then restart the nodes.
Redeploying from a non-clustered to a clustered queue requires you set the clustered attribute to true, and add the queue service configuration to each node.
Redeploying from a clustered to a non-clustered queue requires you set the clustered attribute to false in one of the queue configurations and delete all other queues in the cluster.
5.7.2.1.1. Destination Security Configuration
<SecurityConfig> determines which roles can read, write and create upon the destination. It uses the same syntax and semantics as JBossMQ destination security configuration.
<SecurityConfig>
  <security>
    <role read="true" write="true" create="true"/>
  </security>
<SecurityConfig>
The <SecurityConfig> element must contain one <security> element, which can contain multiple <role> elements. A <role> element defines the access type for that particular role using the following attributes:
read
Specifies the role can create consumers, receive messages, and browse the destination.
write
Specifies the role can create producers, or send messages to the destination.
create
Specifies the role can create durable subscriptions on this destination.

Note

Configuring security for a destination is optional. If a SecurityConfig element is not specified, then the default security configuration from the Server Peer will be used instead.
5.7.2.1.2. Destination paging parameters
Pageable Channels is a JBoss Messaging feature that lets you specify a maximum number of messages to be stored in memory at one time, on a queue-by-queue or topic-by-topic basis. JBoss Messaging then pages messages to and from storage transparently in blocks. This allows queues and subscriptions to grow to very large sizes without any degradation in performance as channel size increases.
The individual parameters associated with pageable channels are as follows:
FullSize
Specifies the maximum number of messages held by the queue or topic subscription in memory at any one time. The actual queue can hold more messages, but these are paged to and from storage as messages are added or consumed. If no value is specified, the default is 75000.
PageSize
Specifies the maximum number of messages that are pre-loaded per operation when loading messages from the queue or subscription. If no value is specified, the default is 2000.
DownCacheSize
Specifies the maximum number of messages the Down Cache holds before the messages are flushed to storage. The default value is 2000 messages.
When messages are paged to storage from the queue, they enter a Down Cache before being written to storage. This enables the write to occur as a single operation, which aids performance.

Note

Paging parameters for temporary queues must be specified on the appropriate connection factory. Refer to Section 5.8, “Configuring Connection Factories” for detailed information about the different connection factories available.
5.7.2.1.3. Queue Managed Bean Operations
RemoveAllMessages
Removes (and deletes) all messages from the queue.

Important

This will permanently delete all messages from the queue; use this operation with caution.
ListAllMessages
Lists all messages currently in the queue. Using a JMS selector as an argument in this operation lets you retrieve a subset of the messages in the queue that match the given criteria.
ListDurableMessages
Lists all durable messages in the queue. Using a JMS selector as an argument in this operation lets you retrieve a subset of messages in the queue that match the given criteria.
ListNonDurableMessages
Lists all non-durable messages in a queue. Using a JMS selector as an argument in this operation lets you retrieve a subset of messages in the queue that match the given criteria.
ResetMessageCounter
Resets the message counter to zero.
ResetMessageCounterHistory
Resets the message counter history.
ListMessageCounterAsHTML
Lists the message counter in HTML format.
ListMessageCounterHistoryAsHTML
Lists the message counter history in HTML format.