JBossMQ Configuration and MBeans


The following sections define the MBean services that correspond to the components introduced in the previous section, along with their MBean attributes. The configuration and service files that make up the JBossMQ system include the following:

  • deploy/hsqldb-jdbc-state-service.xml This service descriptor configures the JDBC state service for storing state in the embedded Hypersonic database.

  • deploy/jms/hsqldb-jdbc2-service.xml This service descriptor configures the DestinationManager, MessageCache, and JDBC2 PersistenceManager services for the embedded Hypersonic database.

  • deploy/jms/jbossmq-destinations-service.xml This service defines the default JMS queue and topic destination configurations used by the testsuite unit tests. You can add destinations to this file, remove destinations from this file, or deploy another *-service.xml descriptor with the destination configurations.

  • jbossmq-httpil.sar This SAR file configures the HTTP IL.

  • deploy/jms/jbossmq-service.xml This service descriptor configures the core JBossMQ MBeans, such as the Invoker, SecurityManager, DynamicStateManager, and core interceptor stack. It also defines the MDB default dead-letter queue, DLQ.

  • deploy/jms/jms-ds.xml This is a JCA connection factory and JMS provider MDB integration services configuration that sets JBossMQ as the JMS provider.

  • deploy/jms/jms-ra.rar This is a JCA resource adaptor for JMS providers.

  • deploy/jms/jvm-il-service.xml This service descriptor configures the JVMServerILService, which provides the JVM IL transport.

  • deploy/jms/rmi-il-service.xml This service descriptor configures the RMIServerILService, which provides the RMI IL. The queue and topic connection factory for this IL is bound under the name RMIConnectionFactory.

  • deploy/jms/uil2-service.xml This service descriptor configures the UILServerILService, which provides the UIL2 transport. The queue and topic connection factory for this IL is bound under the name UIL2ConnectionFactory as well as UILConnectionFactory, to replace the deprecated version 1 UIL service.

The following sections discuss the associated MBeans.

The org.jboss.mq.il.jvm.JVMServerILService MBean

You use the org.jboss.mq.il.jvm.JVMServerILService MBean to configure the JVM IL. The configurable attributes are as follows:

  • Invoker This attribute specifies the JMX ObjectName of the JMS entry point service that is used to pass incoming requests to the JMS server. This is not something you would typically change from the jboss.mq:service=Invoker setting unless you change the entry point service.

  • ConnectionFactoryJNDIRef This is the JNDI location that this IL will bind a ConnectionFactory setup to in order to use this IL.

  • XAConnectionFactoryJNDIRef This is the JNDI location that this IL will bind a XAConnectionFactory setup to in order to use this IL.

  • PingPeriod This attribute specifies how often, in milliseconds, the client should send a ping message to the server to validate that the connection is still valid. If this is set to 0, no ping message will be sent. Because it is impossible for a JVM IL connection to go bad, it is recommended that you keep this set to 0.

The org.jboss.mq.il.uil2.UILServerILService MBean

You use the org.jboss.mq.il.uil2.UILServerILService MBean to configure the UIL2 IL. Its configurable attributes are as follows:

  • Invoker This attribute specifies the JMX ObjectName of the JMS entry point service that is used to pass incoming requests to the JMS server. This is not something you would typically change from the jboss.mq:service=Invoker setting unless you change the entry point service.

  • ConnectionFactoryJNDIRef This is the JNDI location that this IL will bind a ConnectionFactory setup to in order to use this IL.

  • XAConnectionFactoryJNDIRef This is the JNDI location that this IL will bind a XAConnectionFactory setup to in order to use this IL.

  • PingPeriod This attribute specifies how often, in milliseconds, the client should send a ping message to the server to validate that the connection is still valid. If this is set to 0, no ping message will be sent.

  • ReadTimeout This is the period, in milliseconds, of the SoTimeout value of the UIL2 socket. This allows detection of dead sockets that are not responsive and are not capable of receiving ping messages. Note that this setting should be longer in duration than the PingPeriod setting.

  • BufferSize This is the size, in bytes, used as the buffer over the basic socket streams. This corresponds to the java.io.BufferedOutputStream buffer size.

  • ChunkSize This is the size, in bytes, between stream listener notifications. UIL2 uses the org.jboss.util.stream.NotifyingBufferedOutputStream and NotifyingBufferedInputStream implementations that support the notion of a heartbeat that is triggered based on data read/written to the stream. This serves as a ping or keep-alive notification when large reads or writes require a duration greater than the PingPeriod.

  • ServerBindPort This is the protocol listening port for this IL. If it is not specified, the default is 0, which means that a random port will be chosen.

  • BindAddress This is the specific address on which this IL listens. This can be used on a multi-homed host for a java.net.ServerSocket that will only accept connection requests on one of its addresses.

  • EnableTcpNoDelay TcpNoDelay causes TCP/IP packets to be sent as soon as the request is flushed. This may improve request response times. Otherwise, the operating system may buffer request packets to create larger IP packets.

  • ServerSocketFactory This is the javax.net.ServerSocketFactory implementation class-name to use to create the service java.net.ServerSocket. If it is not specified, the default factory will be obtained from javax.net.ServerSocketFactory.getDefault().

  • ClientAddress This is the address passed to the client as the address that should be used to connect to the server.

  • ClientSocketFactory This is the javax.net.SocketFactory implementation classname to use on the client. If it is not specified, the default factory will be obtained from javax.net.SocketFactory.getDefault().

  • SecurityDomain This attribute specifies the security domain name to use with JBoss SSL-aware socket factories. This is the JNDI name of the security manager implementation, as described for the security-domain element of the jboss.xml and jboss-web.xml descriptors in Chapter 8, "Security on JBoss."

Configuring UIL2 for SSL

The UIL2 service support the use of SSL through custom socket factories that integrate JSSE, using the security domain associated with the IL service. An example of a UIL2 service descriptor fragment that illustrates the use of the custom JBoss SSL socket factories is shown in Listing 6.10.

Listing 6.10. An Example of a UIL2 Config Fragment for Using SSL
 <mbean code="org.jboss.mq.il.uil2.UILServerILService"     name="jboss.mq:service=InvocationLayer,type=HTTPSUIL2">     <depends optional-attribute-name="Invoker">jboss.mq:service=Invoker</depends>     <attribute name="ConnectionFactoryJNDIRef">SSLConnectionFactory</attribute>     <attribute name="XAConnectionFactoryJNDIRef">SSLXAConnectionFactory</attribute>     <!-- ... -->     <!-- SSL Socket Factories -->     <attribute name="ClientSocketFactory">         org.jboss.security.ssl.ClientSocketFactory     </attribute>     <attribute name="ServerSocketFactory">         org.jboss.security.ssl.DomainServerSocketFactory     </attribute>     <!-- Security domain - see below -->     <attribute name="SecurityDomain">java:/jaas/SSL</attribute> </mbean> <!-- Configures the keystore on the "SSL" security domain      This mbean is better placed in conf/jboss-service.xml where it      can be used by other services, but it will work from anywhere.      Use keytool from the sdk to create the keystore. --> <mbean code="org.jboss.security.plugins.JaasSecurityDomain"        name="jboss.security:service=JaasSecurityDomain,domain=SSL">     <!-- This must correlate with the java:/jaas/SSL above -->     <constructor>         <arg type="java.lang.String" value="SSL"/>     </constructor>     <!-- The location of the keystore resource: loads from the          classpath and the server conf dir is a good default -->     <attribute name="KeyStoreURL">resource:uil2.keystore</attribute>     <attribute name="KeyStorePass">changeme</attribute> </mbean> 

JMS Client Properties for the UIL2 Transport

A JMS client using the UIL2 transport can set several system properties to control the client connection back to the server:

  • org.jboss.mq.il.uil2.useServerHost This system property allows a client to connect to the server InetAddress.getHostName rather than the InetAddress.getHostAddress value. This makes a difference only if name resolution differs between the server and client environments.

  • org.jboss.mq.il.uil2.localAddr This system property allows a client to define the local interface to which its sockets should be bound.

  • org.jboss.mq.il.uil2.localPort This system property allows a client to define the local port to which its sockets should be bound.

  • org.jboss.mq.il.uil2.serverAddr This system property allows a client to override the address to which it attempts to connect. This is useful for networks where NAT is occurring between the client and the JMS server.

  • org.jboss.mq.il.uil2.serverPort This system property allows a client to override the port to which it attempts to connect. This is useful for networks where port forwarding is occurring between the client and the JMS server.

  • org.jboss.mq.il.uil2.retryCount Thissystem property controls the number of attempts to retry connecting to the JMS server. Retries are made only for java.net.ConnectException failures. A value that is less than or equal to zero means no retry attempts will be made.

  • org.jboss.mq.il.uil2.retryDelay This system property controls the delay, in milliseconds, between retries due to ConnectException failures.

The org.jboss.mq.il.http.HTTPServerILService MBean

You use org.jboss.mq.il.http.HTTPServerILService to manage the HTTP/HTTPS IL. This IL allows for the use of the JMS service over HTTP or HTTPS connections. It relies on the servlet deployed in the deploy/jms/jbossmq-httpil.sar to handle the HTTP traffic. The configurable attributes are as follows:

  • TimeOut The default timeout, in seconds, that the client HTTP requests will wait for messages. You can override this on the client by setting the system property org.jboss.mq.il.http.timeout to the number of seconds.

  • RestInterval The number of seconds the client will sleep after each request. The default is 0, but you can set this value in conjunction with the TimeOut value to implement a purely time-based polling mechanism. For example, you could simply do a short-lived request by setting the TimeOut value to 0 and then setting RestInterval to 60. This would cause the client to send a single nonblocking request to the server, return any messages, if available, and sleep for 60 seconds before issuing another request. As with the TimeOut value, you can override this value explicitly on a given client by specifying the org.jboss.mq.il.http. restinterval with the number of seconds to wait between requests.

  • URL The servlet URL. This value takes precedence over any individual values set (for example, URLPrefix, URLSuffix, URLPort). It may be an actual URL or a property name that will be used on the client side to resolve the proper URL by calling System.getProperty(propertyname). If it is not specified, the URL will be formed from URLPrefix+URLHostName+"":"+URLPort+""/"+URLSuffix.

  • URLPrefix The prefix portion of the servlet URL.

  • URLHostName The hostname portion of the servlet URL.

  • URLPort The port portion of the URL.

  • URLSuffix The trailing path portion of the URL.

  • UseHostName A flag that, if set to true, means the default setting for the URLHostName attribute will be taken from InetAddress.getLocalHost().getHostName(). If it is false, the default setting for the URLHostName attribute will be taken from InetAddress.getLocalHost().getHostAddress().

The org.jboss.mq.server.jmx.Invoker MBean

You use org.jboss.mq.server.jmx.Invoker to pass IL requests down to the DestinationManager service through an interceptor stack. There is one configurable attribute:

  • NextInterceptor The JMX ObjectName of the next request interceptor. All the interceptors use this attribute to create the interceptor stack. The last interceptor in the chain should be the DestinationManager.

The org.jboss.mq.server.jmx.InterceptorLoader MBean

You use org.jboss.mq.server.jmx.InterceptorLoader to load a generic interceptor and make it part of the interceptor stack. You typically use this MBean to load custom interceptors such as org.jboss.mq.server.TracingInterceptor, which you can use to efficiently log all client requests via trace-level log messages. The configurable attributes are as follows:

  • NextInterceptor The JMX ObjectName of the next request interceptor. All the interceptors use this attribute to create the interceptor stack. The last interceptor in the chain should be the DestinationManager. This attribute should be set up via a <depends optional-attribute-name="NextInterceptor"> XML tag.

  • InterceptorClass The classname of the interceptor that will be loaded and made part of the interceptor stack. The class specified here must extend the org.jboss.mq.server.JMSServerInterceptor class.

The org.jboss.mq.sm.jdbc.JDBCStateManager MBean

You use the JDBCStateManager MBean as the default state manager assigned to the DestinationManager service. It stores user and durable subscriber information in the database. The configurable attributes are as follows:

  • ConnectionManager This is the ObjectName of the datasource that the JDBC state manager will write to. For Hypersonic, it is jboss.jca:service=DataSourceBinding,name=DefaultDS.

  • SqlProperties This defines the SQL statements to be used to persist JMS state data. If the underlying database is changed, the SQL statements used may need to change.

The org.jboss.mq.security.SecurityManager MBean

If org.jboss.mq.security.SecurityManager is part of the interceptor stack, it will enforce the access control lists assigned to the destinations. SecurityManager uses JAAS, and it therefore requires that an application policy be set up in the JBoss login-config.xml file. The default configuration is as follows:

[View full width]

<application-policy name="jbossmq"> <authentication> <login-module code="org.jboss.security.auth.spi .DatabaseServerLoginModule"flag="required"> <module-option name="unauthenticatedIdentity">guest</module-option> <module-option name="dsJndiName">java:/DefaultDS</module-option> <module-option name="principalsQuery">SELECT PASSWD FROM JMS_USERS WHERE USERID=?</module-option> <module-option name="rolesQuery">SELECT ROLEID, 'Roles' FROM JMS_ROLES WHERE USERID=?</module-option> </login-module> </authentication> </application-policy>

The configurable attributes of the SecurityManager MBean are as follows:

  • NextInterceptor The JMX ObjectName of the next request interceptor. This attribute is used by all the interceptors to create the interceptor stack. The last interceptor in the chain should be DestinationManager.

  • SecurityDomain The security domain name to use for authentication and role-based authorization. This is the JNDI name of the JAAS domain against which to perform authentication and authorization.

  • DefaultSecurityConfig The default security configuration settings for destinations. This applies to temporary queues and topics as well as queues and topics that do not specify a security configuration. DefaultSecurityConfig should declare some number of role elements, which represent each role that is allowed access to a destination. Each role should have the following attributes:

    • name The name attribute defines the name of the role.

    • create The create attribute is a TRue/false value that indicates whether the role has the ability to create durable subscriptions on the topic.

    • read The read attribute is a TRue/false value that indicates whether the role can receive messages from the destination.

    • write The write attribute is a true/false value that indicates whether the role can send messages to the destination.

The org.jboss.mq.server.jmx.DestinationManager MBean

org.jboss.mq.server.jmx.DestinationManager must be the last interceptor in the interceptor stack. The configurable attributes are as follows:

  • PersistenceManager The JMX ObjectName of the PM service the server should use.

  • StateManager The JMX ObjectName of the SM service the server should use.

  • MessageCache The JMX ObjectName of the message cache service the server should use.

Additional read-only attributes and operations that support monitoring include the following:

  • ClientCount The number of clients connected to the server.

  • Clients The java.util.Map<org.jboss.mq.ConnectionToken,org. jboss.mq.server.ClientConsumer> instances for the clients connected to the server.

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

  • listMessageCounter() An operation that generates an HTML table that contains the following:

    • Type Either Queue or Topic, indicating the destination type.

    • Name The name of the destination.

    • Subscription The subscription ID for a topic.

    • Durable A Boolean that indicates whether the topic subscription is durable.

    • Count The number of messages delivered to the destination.

    • CountDelta The change in message count since the previous access of Count.

    • Depth The number of messages in the destination.

    • DepthDelta The change in the number of messages in the destination since the previous access of Depth.

    • Last Add The date/time string, in DateFormat.SHORT/DateFormat.MEDIUM format, of the last time a message was added to the destination.

  • resetMessageCounter() A method that zeros all destination counts and last added times.

You can create and destroy queues and topics at runtime through the DestinationManager MBean. DestinationManager provides createQueue and createTopic operations for this. Each of these methods has a one-argument version that takes the destination name and a two-argument version that takes the destination and the JNDI name of the destination. You can remove queues and topics by using the destroyQueue and destroyTopic operations, both of which take a destination name as input.

The org.jboss.mq.server.MessageCache MBean

The server determines when to move messages to secondary storage by using the org.jboss.mq.server.MessageCache MBean. The configurable attributes are as follows:

  • CacheStore The JMX ObjectName of the service that will act as the cache store. MessageCache uses the cache store to move messages to persistent storage. The value you set here typically depends on the type of PM you are using.

  • HighMemoryMark The amount of JVM heap memory, in megabytes, that must be reached before the MessageCache starts to move messages to secondary storage.

  • MaxMemoryMark The maximum amount of JVM heap memory, in megabytes, that the MessageCache considers to be the maximum memory mark. As memory usage approaches the maximum memory mark, MessageCache will move messages to persistent storage so that the number of messages kept in memory approaches zero.

  • MakeSoftReferences Whether the message cache will keep soft references to messages that need to be removed. The default is TRue.

  • MinimumHard The minimum number of the in-memory cache. JBoss won't try to go below this number of messages in the cache. The default value is 1.

  • MaximumHard The upper bound on the number of hard references to messages in the cache. JBoss will soften messages to reduce the number of hard references to this level. A value of 0 means that there is no size-based upper bound. The default is 0.

  • SoftenWaitMillis The maximum wait time before checking whether messages need softening. The default is 1000 milliseconds (1 second).

  • SoftenNoMoreOftenThanMillis The minimum amount of time between checks to soften messages. A value of 0 means that this check should be skipped. The default is 0 milliseconds.

  • SoftenAtLeastEveryMillis The maximum amount of time between checks to soften messages. A value of 0 means that this check should be skipped. The default is 0.

Additional read-only cache attributes that provide statistics include the following:

  • CacheHits The number of times a hard referenced message was accessed.

  • CacheMisses The number of times a softened message was accessed.

  • HardRefCacheSize The number of messages in the cache that are not softened.

  • SoftRefCacheSize The number of messages that are currently softened.

  • SoftenedSize The total number of messages softened since the last boot.

  • TotalCacheSize The total number of messages that are being managed by the cache.

The org.jboss.mq.pm.jdbc2.PersistenceManager MBean

You should use org.jboss.mq.pm.jdbc.PersistenceManager as the PM assigned to the DestinationManager service if you want to store messages in a database. This PM has been tested against the HypersonSQL, Microsoft SQL, Oracle, MySQL, and PostgreSQL databases. The configurable attributes are as follows

  • MessageCache The JMX ObjectName of the MessageCache that has been assigned to the DestinationManager.

  • ConnectionManager The JMX ObjectName of the JCA data source that will be used to obtain JDBC connections.

  • ConnectionRetryAttempts An integer count used to allow the PM to retry attempts at getting a connection to the JDBC store. There is a 1500-millisecond delay between each failed connection attempt and the next attempt. This value must be greater than or equal to 1 and defaults to 5.

  • SqlProperties A property list that is used to define the SQL queries and other JDBC2 PM options. You need to adjust these properties if you want to run against a database other than Hypersonic. Listing 6.11 shows the default setting for this attribute for the Hypersonic database.

Listing 6.11. The Default JDBC2 PeristenceManager SqlProperties Attribute Setting for Hypersonic

[View full width]

<attribute name="SqlProperties"> CREATE_TABLES_ON_STARTUP = TRUE CREATE_USER_TABLE = CREATE TABLE JMS_USERS (USERID VARCHAR(32) NOT NULL, PASSWD VARCHAR(32) NOT NULL, \ CLIENTID VARCHAR(128), PRIMARY KEY(USERID)) CREATE_ROLE_TABLE = CREATE TABLE JMS_ROLES (ROLEID VARCHAR(32) NOT NULL, USERID VARCHAR(32) NOT NULL, \ PRIMARY KEY(USERID, ROLEID)) CREATE_SUBSCRIPTION_TABLE = CREATE TABLE JMS_SUBSCRIPTIONS (CLIENTID VARCHAR(128) NOT NULL, \ SUBNAME VARCHAR(128)NOT NULL, TOPIC VARCHAR(255) NOT NULL, \ SELECTOR VARCHAR(255),PRIMARY KEY(CLIENTID , SUBNAME)) GET_SUBSCRIPTION = SELECT TOPIC, SELECTOR FROM JMS_SUBSCRIPTIONS WHERE CLIENTID=? AND SUBNAME=? LOCK_SUBSCRIPTION = SELECT TOPIC, SELECTOR FROM JMS_SUBSCRIPTIONS WHERE CLIENTID=? AND SUBNAME=? GET_SUBSCRIPTIONS_FOR_TOPIC = SELECT CLIENTID, SUBNAME, SELECTOR FROM JMS_SUBSCRIPTIONS WHERE TOPIC=? INSERT_SUBSCRIPTION = INSERT INTO JMS_SUBSCRIPTIONS (CLIENTID, SUBNAME, TOPIC, SELECTOR) VALUES(?,?,?,?) UPDATE_SUBSCRIPTION = UPDATE JMS_SUBSCRIPTIONS SET TOPIC=?, SELECTOR=? WHERE CLIENTID=? AND SUBNAME=? REMOVE_SUBSCRIPTION = DELETE FROM JMS_SUBSCRIPTIONS WHERE CLIENTID=? AND SUBNAME=? GET_USER_BY_CLIENTID = SELECT USERID, PASSWD, CLIENTID FROM JMS_USERS WHERE CLIENTID=? GET_USER = SELECT PASSWD, CLIENTID FROM JMS_USERS WHERE USERID=? POPULATE.TABLES.01 = INSERT INTO JMS_USERS (USERID, PASSWD) VALUES ('guest', 'guest') POPULATE.TABLES.02 = INSERT INTO JMS_USERS (USERID, PASSWD) VALUES ('j2ee', 'j2ee') POPULATE.TABLES.03 = INSERT INTO JMS_USERS (USERID, PASSWD, CLIENTID) VALUES ('john', 'needle', 'DurableSubscriberExample') POPULATE.TABLES.04 = INSERT INTO JMS_USERS (USERID, PASSWD) VALUES ('nobody', 'nobody') POPULATE.TABLES.05 = INSERT INTO JMS_USERS (USERID, PASSWD) VALUES ('dynsub', 'dynsub') POPULATE.TABLES.06 = INSERT INTO JMS_ROLES (ROLEID, USERID) VALUES ('guest','guest') POPULATE.TABLES.07 = INSERT INTO JMS_ROLES (ROLEID, USERID) VALUES ('j2ee','guest') POPULATE.TABLES.08 = INSERT INTO JMS_ROLES (ROLEID, USERID) VALUES ('john','guest') POPULATE.TABLES.09 = INSERT INTO JMS_ROLES (ROLEID, USERID) VALUES ('subscriber','john') POPULATE.TABLES.10 = INSERT INTO JMS_ROLES (ROLEID, USERID) VALUES ('publisher','john') POPULATE.TABLES.11 = INSERT INTO JMS_ROLES (ROLEID, USERID) VALUES ('publisher','dynsub') POPULATE.TABLES.12 = INSERT INTO JMS_ROLES (ROLEID, USERID) VALUES ('durpublisher' ,'john') POPULATE.TABLES.13 = INSERT INTO JMS_ROLES (ROLEID, USERID) VALUES ('durpublisher' ,'dynsub') POPULATE.TABLES.14 = INSERT INTO JMS_ROLES (ROLEID, USERID) VALUES ('noacc','nobody') </attribute>

Listing 6.12 shows an alternate setting for Oracle.

Listing 6.12. A Sample JDBC2 PeristenceManager SqlProperties Attribute Setting for Oracle

[View full width]

<attribute name="SqlProperties"> BLOB_TYPE=BINARYSTREAM_BLOB INSERT_TX = INSERT INTO JMS_TRANSACTIONS (TXID) values(?) INSERT_MESSAGE = INSERT INTO JMS_MESSAGES (MESSAGEID, DESTINATION, MESSAGEBLOB, TXID , TXOP) VALUES(?,?,?,?,?) SELECT_ALL_UNCOMMITED_TXS = SELECT TXID FROM JMS_TRANSACTIONS SELECT_MAX_TX = SELECT MAX(TXID) FROM JMS_MESSAGES SELECT_MESSAGES_IN_DEST = SELECT MESSAGEID, MESSAGEBLOB FROM JMS_MESSAGES WHERE DESTINATION=? SELECT_MESSAGE = SELECT MESSAGEID, MESSAGEBLOB FROM JMS_MESSAGES WHERE MESSAGEID=? AND DESTINATION=? MARK_MESSAGE = UPDATE JMS_MESSAGES SET TXID=?, TXOP=? WHERE MESSAGEID=? AND DESTINATION=? UPDATE_MESSAGE = UPDATE JMS_MESSAGES SET MESSAGEBLOB=? WHERE MESSAGEID=? AND DESTINATION=? UPDATE_MARKED_MESSAGES = UPDATE JMS_MESSAGES SET TXID=?, TXOP=? WHERE TXOP=? UPDATE_MARKED_MESSAGES_WITH_TX = UPDATE JMS_MESSAGES SET TXID=?, TXOP=? WHERE TXOP=? AND TXID=? DELETE_MARKED_MESSAGES_WITH_TX = DELETE FROM JMS_MESSAGES MESS WHERE TXOP=:1 AND EXISTS (SELECT TXID FROM JMS_TRANSACTIONS TXWHERE TX.TXID = MESS.TXID) DELETE_TX = DELETE FROM JMS_TRANSACTIONS WHERE TXID = ? DELETE_MARKED_MESSAGES = DELETE FROM JMS_MESSAGES WHERE TXID=? AND TXOP=? DELETE_TEMPORARY_MESSAGES = DELETE FROM JMS_MESSAGES WHERE TXOP='T' DELETE_MESSAGE = DELETE FROM JMS_MESSAGES WHERE MESSAGEID=? AND DESTINATION=? CREATE_MESSAGE_TABLE = CREATE TABLE JMS_MESSAGES ( MESSAGEID INTEGER NOT NULL, \ DESTINATION VARCHAR(255) NOT NULL, TXID INTEGER, TXOP CHAR(1), \ MESSAGEBLOB BLOB, PRIMARY KEY (MESSAGEID, DESTINATION) ) CREATE_IDX_MESSAGE_TXOP_TXID = CREATE INDEX JMS_MESSAGES_TXOP_TXID ON JMS_MESSAGES (TXOP, TXID) CREATE_IDX_MESSAGE_DESTINATION = CREATE INDEX JMS_MESSAGES_DESTINATION ON JMS_MESSAGES (DESTINATION) CREATE_TX_TABLE = CREATE TABLE JMS_TRANSACTIONS ( TXID INTEGER, PRIMARY KEY (TXID) ) CREATE_TABLES_ON_STARTUP = TRUE </attribute>

You can find additional examples in the docs/examples/jms directory of the distribution.

Destination MBeans

The following sections describe the destination MBeans used in the jbossmqdestinations-service.xml and jbossmq-service.xml descriptors.

The org.jboss.mq.server.jmx.Queue MBean

You use the Queue MBean 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> 

You use the name attribute of the JMX ObjectName of this MBean to determine the destination name. For example, the name of the queue we just looked at 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-attributename="DestinationManager"> XML tag.

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

  • SecurityConf An XML fragment that 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 SecurityConf attribute on the SecurityManager.

  • 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 earlier, the JNDI name would be queue/testQueue.

  • MaxDepth An upper limit to the backlog of messages that can exist for a destination. If this value is exceeded, attempts to add new messages will result in an org.jboss.mq.DestinationFullException. The MaxDepth can still be exceeded in a number of situations, such as 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 you don't want the transaction to fail during the commit phase, when the message is physically added to the queue.

  • MessageCounterHistoryDayLimit The destination message counter history day limit, which has a value less than 0 to indicate unlimited history, a 0 value to disable the history, and a value greater than 0 to give the history days count.

Additional read-only attributes that provide statistics information include the following:

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

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

  • resetMessageCounter() A method that zeros all destination counts and last added times.

  • listMessageCounterHistory() An operation that displays an HTML table showing the hourly message counts per hour for each day in the history.

  • resetMessageCounterHistory() An operation that resets the day history message counts.

The org.jboss.mq.server.jmx.Topic MBean

You use org.jboss.mq.server.jmx.Topic 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, the name of the topic we just looked at 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 An element that specifies an XML fragment that describes the access control list that SecurityManager should use 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 earlier, the JNDI name would be topic/testTopic.

  • MaxDepth An upper limit to the backlog of messages that can exist for a destination. If this value is 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, such as when a message is placed back into the queue. Also, transactions that perform read-committed processing look at the current size of the queue, ignoring any messages that may be added as a result of the current transaction or other transactions. This is because you don't want the transaction to fail during the commit phase, when the message is physically added to the topic.

  • MessageCounterHistoryDayLimit The destination message counter history day limit, which is set with a value less than 0 to indicate unlimited history, a 0 value to disable history, and a value greater than 0 to give the history days count.

Additional read-only attributes that provide statistics information include the following:

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

  • 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 of messages in non-durable subscription queues.

  • NonDurableSubscriptionsCount The count of non-durable subscribers.

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

  • resetMessageCounter() An operation that zeros all destination counts and last added times.

  • listMessageCounterHistory() An operation that displays an HTML table showing the hourly message counts per hour for each day of history.

  • resetMessageCounterHistory() An operation that resets the day history message counts.



JBoss 4. 0(c) The Official Guide
JBoss 4.0 - The Official Guide
ISBN: B003D7JU58
EAN: N/A
Year: 2006
Pages: 137

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net