JBoss.org Community Documentation

7.3.11.1. org.jboss.mq.server.jmx.Queue

The Queue is used to define a queue destination in JBoss. The following shows the configuration of one of the default JBoss queues.

<mbean code="org.jboss.mq.server.jmx.Queue" 
       name="jboss.mq.destination:service=Queue,name=testQueue">
    <depends optional-attribute-name="DestinationManager">
        jboss.mq:service=DestinationManager
    </depends>
    <depends optional-attribute-name="SecurityManager">
        jboss.mq:service=SecurityManager
    </depends>
    <attribute name="MessageCounterHistoryDayLimit">-1</attribute>
    <attribute name="SecurityConf">
        <security>
            <role name="guest"     read="true"  write="true"/>
            <role name="publisher" read="true"  write="true" create="false"/>
            <role name="noacc"     read="false" write="false" create="false"/>
        </security>
    </attribute>
</mbean>

The name attribute of the JMX object name of this MBean is used to determine the destination name. For example. In the case of the queue we just looked at, the name of the queue is testQueue. The configurable attributes are as follows:

  • DestinationManager : The JMX ObjectName of the destination manager service for the server. This attribute should be set via a <depends optional-attribute-name="DestinationManager"> XML tag.

  • SecurityManager : The JMX ObjectName of the security manager service that is being used to validate client requests.

  • SecurityConf : This element specifies a XML fragment which describes the access control list to be used by the SecurityManager to authorize client operations against the destination. The content model is the same as for the SecurityManager SecurityConf attribute.

  • JNDIName : The location in JNDI to which the queue object will be bound. If this is not set it will be bound under the queue context using the name of the queue. For the testQueue shown above, the JNDI name would be queue/testQueue.

  • MaxDepth : The MaxDepth is an upper limit to the backlog of messages that can exist for a destination. If exceeded, attempts to add new messages will result in a org.jboss.mq.DestinationFullException. The MaxDepth can still be exceeded in a number of situations, e.g. when a message is placed back into the queue. Also transactions performing read committed processing, look at the current size of queue, ignoring any messages that may be added as a result of the current transaction or other transactions. This is because we don't want the transaction to fail during the commit phase when the message is physically added to the queue.

  • MessageCounterHistoryDayLimit : Sets the destination message counter history day limit with a value less than 0 indicating unlimited history, a 0 value disabling history and a value greater than 0 giving the history days count.

Additional read-only attributes that provide statistics information include:

  • MessageCounter : An array of org.jboss.mq.server.MessageCounter instances that provide statistics for this destination.

  • QueueDepth : The current backlog of waiting messages.

  • ReceiversCount : The number of receivers currently associated with the queue.

  • ScheduledMessageCount : The number of messages waiting in the queue for their scheduled delivery time to arrive.

The following are some of the operations available on queues.

  • listMessageCounter() : This operation generates an HTML table that contains the same data we as the listMessageCounter operation on the DestinationManager, but only for this one queue.

  • resetMessageCounter() : This zeros all destination counts and last added times.

  • listMessageCounterHistory() : This operation display an HTML table showing the hourly message counts per hour for each day in the history.

  • resetMessageCounterHistory() : This operation resets the day history message counts.

  • removeAllMessages() : This method removes all the messages on the queue.