JBoss.org Community Documentation

7.3.11.2. org.jboss.mq.server.jmx.Topic

The org.jboss.mq.server.jmx.Topic is used to define a topic destination in JBoss. The following shows the configuration of one of the default JBoss topics.

<mbean code="org.jboss.mq.server.jmx.Topic"
       name="jboss.mq.destination:service=Topic,name=testTopic">
    <depends optional-attribute-name="DestinationManager">
        jboss.mq:service=DestinationManager
    </depends>
    <depends optional-attribute-name="SecurityManager">
        jboss.mq:service=SecurityManager
    </depends>
    <attribute name="SecurityConf">
        <security>
            <role name="guest"        read="true" write="true" />
            <role name="publisher"    read="true" write="true" create="false" />
            <role name="durpublisher" read="true" write="true" create="true" />
        </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 topic we just looked at, the name of the topic is testTopic. The configurable attributes are as follows:

  • DestinationManager : The JMX object name of the destination manager configured for the server.

  • SecurityManager : The JMX object name of the security manager 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 that for the SecurityManager SecurityConf attribute.

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

  • MaxDepth : The MaxDepth is an upper limit to the backlog of messages that can exist for a destination, and 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 knacked 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 topic.

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

Additional read-only attributes that provide statistics information include:

  • AllMessageCount : The message count across all queue types associated with the topic.

  • AllSubscriptionsCount : The count of durable and non-durable subscriptions.

  • DurableMessageCount : The count of messages in durable subscription queues.

  • d DurableSubscriptionsCount : The count of durable subscribers.

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

  • NonDurableMessageCount : The count on messages in non-durable subscription queues.

  • NonDurableSubscriptionsCount : The count of non-durable subscribers.

The following are some of the operations available on topics.

  • 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 topic. Message counters are only maintained for each active subscription, durable or otherwise.

  • 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 of history.

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