Chapter 5. JBoss Messaging Installation

This section describes procedures on how to install JBoss Messaging into JBoss AS. At the end of this procedure, you will create a JBoss Messaging configuration that will start a clustered or non-clustered messaging server.

By default, JBoss AS 4.2.0 instance ships with JBossMQ as default JMS provider. In order to use the JBoss AS instance with JBoss Messaging, you need to perform the installation procedure described below.

Note

A JBossMQ and a JBoss Messaging instance cannot coexist, at least not unless special precautions are taken. Do not simply attempt to copy the Messaging release artifact jboss-messaging.sar over to the JBoss instance deploy directory. Follow one of the alternate installation procedures outlined below instead.

Note

We only recommend and support installing JBoss Messaging in JBoss AS 4.2 or later. You should avoid using JBoss Messaging on any version of JBoss AS prior to JBoss 4.2.0.GA, such as 4.0.5.GA and 4.0.4.GA.

5.1. Installing JBoss Messaging on JBoss AS 4.2

In this section we present five different methods of installing JBoss Messaging in JBoss AS 4.2

5.1.1. Automated Non-clustered Installation from clean JBoss AS 4.2 installation

Note

This procedure should only be performed from a clean JBoss AS 4.2 installation. If you have modifed the JBoss AS 4.2 installation at all since installation then you will need to perform a manual JBoss Messaging installation

Set up the JBOSS_HOME environment variable to point to the JBoss 4.2 installation you want to use JBoss Messaging with. Run the installation script, available in the util directory of the release bundle.

 cd util
 ant -f release-admin.xml
      

The installation script will create a $JBOSS_HOME/server/messaging configuration.

Warning

For use in production it is highly recommended to use a different database other than the HSQLDB. HSQLDB does not have any transaction isolation. For simple non clustered development evaluation HSQLDB may suffice. If you decide to use a different database please follow the follow steps:

  • Replace JBOSS_CONFIG/deploy/jboss-messaging.sar/hsqldb-persistence-service.xml by the persistence-service of from <downloadPackage>/examples/config.

  • Configure a JCA datasource using an example from $JBOSS_HOME/docs/examples/jca

    and copying to $JBOSS_CONFIG/deploy

    JBoss Messaging uses DefaultDS by default so you should configure your datasource to bind to that

  • Remove hsqldb-ds.xml from $JBOSS_CONFIG/deploy

  • Copy your database driver to $JBOSS_CONFIG/lib

    Your database driver can probably be downloaded from your database providers web site

There are few extra steps at Section 5.1.5, “Extra steps to complete your installation”

That's it!

Note

If you want to create a JBoss Messaging configuration with a different name, you can specify the messaging.config.name system property when you run the command:

 cd util
 ant -f release-admin.xml -Dmessaging.config.name=mymessaging
        

5.1.2. Manual Non-clustered Installation

Note

This installation procedure should be performed if you are installing into a JBoss AS configuration that you have changed in some way from the default JBoss AS distribution. If you are just using the standard, untouched JBoss AS 4.2 distribution you can use the automated procedure above

For this procedure we assume you already have your custom configuration located at JBOSS_CONFIG=$JBOSS_HOME/server/<myconfiguration>, and that it contains a JBoss MQ installation.

You don't actually have to create an environment variable JBOSS_CONFIG, this is just used in the installation instructions to describe the steps

  • Move $JBOSS_CONFIG/deploy/jms/jms-ds.xml and $JBOSS_CONFIG/deploy/jms/jms-ra.rar to $JBOSS_CONFIG/deploy

  • Remove the old JBoss MQ by removing the directory $JBOSS_CONFIG/deploy/jms.

    .

    Remove the old JBoss MQ jar file: $JBOSS_CONFIG/lib/jbossmq.jar

  • Add a security policy called "messaging" on $JBOSS_CONFIG/config/login-config.xml. You could use this as an example, or create one according to JBoss Security Documentation:

    <application-policy name = "messaging">
    <authentication>
    <login-module code = "org.jboss.security.auth.spi.UsersRolesLoginModule" flag = "required" >
       <module-option name = "unauthenticatedIdentity">guest</module-option>
       <module-option name = "usersProperties">props/messaging-users.properties</module-option>
       <module-option name = "rolesProperties">props/messaging-roles.properties</module-option>
    </login-module>
    </authentication>
    </application-policy>
              

    In case you are using the above policy you should also create files messaging-users.properties and messaging-roles.properties in the $JBOSS_CONFIG/config/props/ directory

    .

    Note

    You can find an example messaging-users.properties and messaging-roles.properties in the JBoss Messaging distribution in the <downloadPackage>src/etc/server/default/config directory.
    # messaging-roles.properties
    # Add roles as you like
    # user=role1,role2,...
    #
    guest=guest
              
    # messaging-users.properties
    
    # Add users as you like
    # user=password
    #
    guest=guest
              
  • Unzip jboss-messaging.sar from your download package into the directory JBOSS_CONFIG/deploy/jboss-messaging.sar

    JBoss Messaging sar should be deployed unzipped (exploded) so you have easy access to its config files which are stored there.

  • Copy jboss-messaging.jar from your download package into the directory JBOSS_CONFIG/lib

    jboss-messaging.jar needs to go in the lib directory so it is accessible to other services e.g. the JBoss Transactions Recovery Manager

  • Warning

    For use in production it is highly recommended to use a different database other than the HSQLDB. HSQLDB does not have any transaction isolation. For simple non clustered development evaluation HSQLDB may suffice. If you decide to use a different database please follow the follow steps:
    • Replace JBOSS_CONFIG/deploy/jboss-messaging.sar/hsqldb-persistence-service.xml by the persistence-service of from <downloadPackage>/examples/config.

    • Configure a JCA datasource using an example from $JBOSS_HOME/docs/examples/jca

      and copying to $JBOSS_CONFIG/deploy

      JBoss Messaging uses DefaultDS by default so you should configure your datasource to bind to that

    • Remove hsqldb-ds.xml from $JBOSS_CONFIG/deploy

    • Copy your database driver to $JBOSS_CONFIG/lib

      Your database driver can probably be downloaded from your database providers web site

  • There are few extra steps at Section 5.1.5, “Extra steps to complete your installation”

  • That's it!

5.1.3. Clustered Automated Installation

Note

This procedure should only be performed from a clean JBoss AS 4.2 installation. If you have modifed the JBoss AS 4.2 installation at all since installation then you will need to perform a manual clustered JBoss Messaging installation

For the rest of the procedure we assume JBOSS_CONFIG refers to your new messaging configuration (e.g. messaging-node0)

You don't actually have to create an environment variable JBOSS_CONFIG, this is just used in the installation instructions to describe the steps

  • Set up the JBOSS_HOME environment variable to point to the JBoss 4.2 installation you want to use JBoss Messaging with. Run the installation script, available in the util directory of the release bundle as follows:

     cd util
     ant -f release-admin.xml -Dmessaging.config.source=all -Dmessaging.config.name=messaging-node0
             

    In the above you would substitute messaging-node0 with whatever is the name you want to give the configuration. If you will have several cluster nodes on the same machine, e.g. for development purposes then a good convention is to name them messaging-node0, messaging-node1 to match messaging-node<ServerPeerID>

    The installation script will create a $JBOSS_HOME/server/messaging-node0 configuration. (If you have chosen messaging-node0)

  • Warning

    For a clustered installation it is mandatory that a shared database is available to all nodes in the cluster. The default JBoss AS uses HSQLDB for its database which is a local shared database. Therefore in order to use clustering you must replace this with a different shared database. If the database is not replaced then clustering will not work.
    • Replace $JBOSS_CONFIG/deploy/jboss-messaging.sar/hsqldb-persistence-service.xml by the clustered-<databasename>-persistence-service from <downloadPackage>/examples/config.. For instance clustered-mysql-persistence-service.xml

    • Configure a JCA datasource using an example from $JBOSS_HOME/docs/examples/jca

      and copying to $JBOSS_CONFIG/deploy

      JBoss Messaging uses DefaultDS by default so you should configure your datasource to bind to that

    • Remove hsqldb-ds.xml from $JBOSS_CONFIG/deploy

    • Copy your database driver to $JBOSS_CONFIG/lib

      Your database driver can probably be downloaded from your database provider's web site

  • Ensure the ServerPeerID MBean constructor parameter in messaging-service.xml is unique for each node on the cluster. The ServerPeerID value must be a valid integer.

    Warning

    Each node must have a unique ServerPeerID for clustering to work!
  • If you want to run multiple JBoss Messaging nodes on the same box using the same IP address, e.g. for development purposes, then you can use the ServiceBindingManager to do this as follows:

    • Uncomment binding manager service from $JBOSS_CONFIG/conf/jboss-service.xml

    • Specify the desired port rage (e.g. ports-01, ports-02... etc)

    • Look at $JBOSS_HOME/docs/examples/binding-manager/sample-bindings.xml. On each port range, JBoss Remoting configuration should look like:

            <service-config name="jboss.messaging:service=Connector,transport=bisocket"
                            delegateClass="org.jboss.services.binding.AttributeMappingDelegate">
               <delegate-config>
                  <attribute name="Configuration"><![CDATA[
      	   <config>
                  <invoker transport="bisocket">
                     <attribute name="marshaller" isParam="true">org.jboss.jms.wireformat.JMSWireFormat</attribute>
                     <attribute name="unmarshaller" isParam="true">org.jboss.jms.wireformat.JMSWireFormat</attribute>
                     <attribute name="dataType" isParam="true">jms</attribute>
                     <attribute name="socket.check_connection" isParam="true">false</attribute>
                     <attribute name="timeout" isParam="true">0</attribute>
                     <attribute name="serverBindAddress">${jboss.bind.address}</attribute>
                     <attribute name="serverBindPort">4657</attribute>
                     <attribute name="leasePeriod">10000</attribute>
                     <attribute name="clientSocketClass" isParam="true">org.jboss.jms.client.remoting.ClientSocketWrapper</attribute>
                     <attribute name="serverSocketClass">org.jboss.jms.server.remoting.ServerSocketWrapper</attribute>
                     <attribute name="numberOfRetries" isParam="true">1</attribute>
                     <attribute name="numberOfCallRetries" isParam="true">1</attribute>
                     <attribute name="clientMaxPoolSize" isParam="true">50</attribute>
                  </invoker>
                  <handlers>
                     <handler subsystem="JMS">org.jboss.jms.server.remoting.JMSServerInvocationHandler</handler>
                  </handlers>
               </config>
                  ]]></attribute>
               </delegate-config>
               <binding port="4657"/>
            </service-config>
                    
                    

      Warning

      You must ensure that the config (like above) is identical to that in remoting-service.xml With the exception of the actual serverBindPort which clearly must be different for each ports range. Please note that the default JBoss Messaging service binding manager bindings in sample-bindings.xml shipped with JBAS 4.2.0 is out of date and you will need to copy the config from remoting-service.xml

      You should ensure that each node is configured to use a different ports range.

  • There are few extra steps at Section 5.1.5, “Extra steps to complete your installation”

  • That's it

5.1.4. Clustered Manual Installation

Note

This installation procedure should be performed if you are installing into a JBoss AS configuration that you have changed in some way from the default JBoss AS distribution. If you are just using the standard, untouched JBoss AS 4.2 distribution you can use the automated procedure above

For this procedure we assume you already have your custom configuration located at JBOSS_CONFIG=$JBOSS_HOME/server/<myconfiguration>, and that it contains a JBoss MQ installation.

You don't actually have to create an environment variable JBOSS_CONFIG, this is just used in the installation instructions to describe the steps

  • Move $JBOSS_CONFIG/deploy/jms/hajndi-jms-ds.xml and $JBOSS_CONFIG/deploy/jms/jms-ra.rar to $JBOSS_CONFIG/deploy

  • Remove the old JBoss MQ by removing the directory $JBOSS_CONFIG/deploy/jms.

    .

    Remove the old JBoss MQ jar file: $JBOSS_CONFIG/lib/jbossmq.jar

    Make sure you don't have any JBossMQ files under $JBOSS_CONFIG/deploy-hasingleton. For that just remove $JBOSS_CONFIG/deploy-hasingleton/jms

  • Add a security policy called "messaging" on $JBOSS_CONFIG/config/login-config.xml. You could use this as an example, or create one according to JBoss Security Documentation:

    <application-policy name = "messaging">
    <authentication>
    <login-module code = "org.jboss.security.auth.spi.UsersRolesLoginModule" flag = "required" >
       <module-option name = "unauthenticatedIdentity">guest</module-option>
       <module-option name = "usersProperties">props/messaging-users.properties</module-option>
       <module-option name = "rolesProperties">props/messaging-roles.properties</module-option>
    </login-module>
    </authentication>
    </application-policy>
              

    In case you are using the above policy you should also create files messaging-users.properties and messaging-roles.properties in the $JBOSS_CONFIG/config/props/ directory

    .

    Note

    You can find an example messaging-users.properties and messaging-roles.properties in the JBoss Messaging distribution in the <downloadPackage>src/etc/server/default/config directory.
    # messaging-roles.properties
    # Add roles as you like
    # user=role1,role2,...
    #
    guest=guest
              
    # messaging-users.properties
    
    # Add users as you like
    # user=password
    #
    guest=guest
              
  • Unzip jboss-messaging.sar from your download package into the directory JBOSS_CONFIG/deploy/jboss-messaging.sar

    JBoss Messaging should be deployed unzipped (exploded) so you have easy access to its config files which are stored there.

  • Copy jboss-messaging.jar from your download package into the directory JBOSS_CONFIG/lib

    jboss-messaging.jar needs to go in the lib directory so it is accessible to other services e.g. the JBoss Transactions Recovery Manager

  • Warning

    For a clustered installation it is mandatory that a shared database is available to all nodes in the cluster. The default JBoss AS uses HSQLDB for its database which is a local shared database. Therefore in order to use clustering you must replace this with a different shared database. If the database is not replaced then clustering will not work.
    • Replace $JBOSS_CONFIG/deploy/jboss-messaging.sar/hsqldb-persistence-service.xml by the clustered-<databasename>-persistence-service from <downloadPackage>/examples/config.. For instance clustered-mysql-persistence-service.xml

    • Configure a JCA datasource using an example from $JBOSS_HOME/docs/examples/jca

      and copying to $JBOSS_CONFIG/deploy

      JBoss Messaging uses DefaultDS by default so you should configure your datasource to bind to that

    • Remove hsqldb-ds.xml from $JBOSS_CONFIG/deploy

    • Copy your database driver to $JBOSS_CONFIG/lib

      Your database driver can probably be downloaded from your database provider's web site

  • Ensure the ServerPeerID MBean constructor parameter in messaging-service.xml is unique for each node on the cluster. The ServerPeerID value must be a valid integer.

    Warning

    Each node must have a unique ServerPeerID for clustering to work!
  • If you want to run multiple JBoss Messaging nodes on the same box using the same IP address, e.g. for development purposes, then you can use the ServiceBindingManager to do this as follows:

    • Uncomment binding manager service from $JBOSS_CONFIG/conf/jboss-service.xml

    • Specify the desired port rage (e.g. ports-01, ports-02... etc)

    • Look at $JBOSS_HOME/docs/examples/binding-manager/sample-bindings.xml. On each port range, JBoss Remoting configuration should look like:

            <service-config name="jboss.messaging:service=Connector,transport=bisocket"
                            delegateClass="org.jboss.services.binding.AttributeMappingDelegate">
               <delegate-config>
                  <attribute name="Configuration"><![CDATA[
      	   <config>
                  <invoker transport="bisocket">
                     <attribute name="marshaller" isParam="true">org.jboss.jms.wireformat.JMSWireFormat</attribute>
                     <attribute name="unmarshaller" isParam="true">org.jboss.jms.wireformat.JMSWireFormat</attribute>
                     <attribute name="dataType" isParam="true">jms</attribute>
                     <attribute name="socket.check_connection" isParam="true">false</attribute>
                     <attribute name="timeout" isParam="true">0</attribute>
                     <attribute name="serverBindAddress">${jboss.bind.address}</attribute>
                     <attribute name="serverBindPort">4657</attribute>
                     <attribute name="leasePeriod">10000</attribute>
                     <attribute name="clientSocketClass" isParam="true">org.jboss.jms.client.remoting.ClientSocketWrapper</attribute>
                     <attribute name="serverSocketClass">org.jboss.jms.server.remoting.ServerSocketWrapper</attribute>
                     <attribute name="numberOfRetries" isParam="true">1</attribute>
                     <attribute name="numberOfCallRetries" isParam="true">1</attribute>
                     <attribute name="clientMaxPoolSize" isParam="true">50</attribute>
                  </invoker>
                  <handlers>
                     <handler subsystem="JMS">org.jboss.jms.server.remoting.JMSServerInvocationHandler</handler>
                  </handlers>
               </config>
                  ]]></attribute>
               </delegate-config>
               <binding port="4657"/>
            </service-config>
                    
                    

      Warning

      You must ensure that the config (like above) is identical to that in remoting-service.xml With the exception of the actual serverBindPort which clearly must be different for each ports range. Please note that the default JBoss Messaging service binding manager bindings in sample-bindings.xml shipped with JBAS 4.2.0 is out of date and you will need to copy the config from remoting-service.xml

      You should ensure that each node is configured to use a different ports range.

  • There are few extra steps at Section 5.1.5, “Extra steps to complete your installation”

  • That's it

5.1.5. Extra steps to complete your installation

You should also make these changes on any configuration you choose, to remove all references to the old JBossMQ:

  • Edit $JBOSS_CONFIG/jms-ds.xml and replace jboss.mq by jboss.messaging on every occurrence

    If you are in a clustered installation, then do the above with the file $JBOSS_CONFIG/hajndi-jms-ds.xml

  • Edit $JBOSS_CONFIG/config/standardjboss.xml and set CreateJBossMQDestination to false on every occurrence

    Make sure it looks like this:

    <CreateJBossMQDestination>false</CreateJBossMQDestination>

    Those Proxies will try to create a Destination on JBossMQ if they can't find it on JNDI, what would cause some errors related to JBoss MQ.

  • Edit $JBOSS_CONFIG/config/jboss-service.xml and remove the reference to JBoss MQ on JSR-77 Management Bean:

     <!-- ==================================================================== -->
     <!-- JSR-77 Single JBoss Server Management Domain                         -->
     <!-- ==================================================================== -->
     <mbean code="org.jboss.management.j2ee.LocalJBossServerDomain"
    
      ... Remove this line ...
     <attribute name="JMSService">jboss.mq:service=DestinationManager</attribute>
                 
  • Change $JBOSS_CONFIG/conf/login-config.xml and remove jboss-mq security policies

    ### Remove these lines:
    
    <!-- Security domain for JBossMQ -->
    <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>
    
    <!-- Security domain for JBossMQ when using file-state-service.xml
    <application-policy name = "jbossmq">
     <authentication>
        <login-module code = "org.jboss.mq.sm.file.DynamicLoginModule"
           flag = "required">
           <module-option name = "unauthenticatedIdentity">guest</module-option>
           <module-option name = "sm.objectname">jboss.mq:service=StateManager</module-option>
        </login-module>
     </authentication>
    </application-policy>
    -->
                 
                

5.2. JBoss Messaging on JBoss 4.0.x

Warning

You should avoid using JBossMessaging on any version prior to JBoss 4.2.0.GA, such as 4.0.5.GA and 4.0.4.GA. JBoss Messaging uses newer versions of JBoss AOP, JBoss Remoting and JGroups compared to JBoss 4.0.X. If you really need to install JBoss Messaging on those versions you will have to update those jars as described on this section but this might cause problems with other components such as JBoss Web Services and EJB3, and may cause other parts of JBoss AS to stop functioning. Also there may be support implications when running in this configuration since the installation procedure requires overwriting some of the jars in JBoss AS. Do this at your own peril!

5.3. Starting the Server

To run the server, execute the run.bat or run.sh script as appropriate for your operating system, in the $JBOSS_HOME/bin directory.

cd $JBOSS_HOME/bin
./run.sh -c <config name>
   

Where config_name is the name of the JBoss AS configuration where you have installed messaging. (The default is 'messaging')

A successful JBoss Messaging deployment generates logging output similar to for a non clustered installation (for a clustered installation you will also see extra cluster related output)

....
13:19:14,914 WARN  [JDBCPersistenceManager] 

JBoss Messaging Warning: DataSource connection transaction isolation should be READ_COMMITTED, but it is currently NONE.
                         Using an isolation level less strict than READ_COMMITTED may lead to data consistency problems.
                         Using an isolation level more strict than READ_COMMITTED may lead to deadlock.

13:19:15,166 INFO  [ServerPeer] JBoss Messaging 1.3.0.GA server [0] started
13:19:15,411 INFO  [ConnectionFactory] Connector bisocket://127.0.0.1:4457 has leasing enabled, lease period 10000 milliseconds
13:19:15,412 INFO  [ConnectionFactory] [/ConnectionFactory, /XAConnectionFactory, java:/ConnectionFactory, java:/XAConnectionFactory] started
13:19:15,412 WARN  [ConnectionFactoryJNDIMapper] supportsFailover attribute is true on connection factory: jboss.messaging.connectionfactory:service=ClusteredConnectionFactory but post office is non clustered. So connection factory will *not* support failover
13:19:15,413 WARN  [ConnectionFactoryJNDIMapper] supportsLoadBalancing attribute is true on connection factory: jboss.messaging.connectionfactory:service=ClusteredConnectionFactory but post office is non clustered. So connection factory will *not* support load balancing
13:19:15,449 INFO  [ConnectionFactory] Connector bisocket://127.0.0.1:4457 has leasing enabled, lease period 10000 milliseconds
13:19:15,449 INFO  [ConnectionFactory] [/ClusteredConnectionFactory, /ClusteredXAConnectionFactory, java:/ClusteredConnectionFactory, java:/ClusteredXAConnectionFactory] started
13:19:15,468 INFO  [QueueService] Queue[/queue/DLQ] started, fullSize=200000, pageSize=2000, downCacheSize=2000
13:19:15,474 INFO  [QueueService] Queue[/queue/ExpiryQueue] started, fullSize=200000, pageSize=2000, downCacheSize=2000
13:19:15,476 INFO  [TopicService] Topic[/topic/testTopic] started, fullSize=200000, pageSize=2000, downCacheSize=2000
13:19:15,478 INFO  [TopicService] Topic[/topic/securedTopic] started, fullSize=200000, pageSize=2000, downCacheSize=2000
13:19:15,479 INFO  [TopicService] Topic[/topic/testDurableTopic] started, fullSize=200000, pageSize=2000, downCacheSize=2000
13:19:15,482 INFO  [QueueService] Queue[/queue/testQueue] started, fullSize=200000, pageSize=2000, downCacheSize=2000
13:19:15,483 INFO  [QueueService] Queue[/queue/A] started, fullSize=200000, pageSize=2000, downCacheSize=2000
13:19:15,485 INFO  [QueueService] Queue[/queue/B] started, fullSize=200000, pageSize=2000, downCacheSize=2000
13:19:15,487 INFO  [QueueService] Queue[/queue/C] started, fullSize=200000, pageSize=2000, downCacheSize=2000
13:19:15,489 INFO  [QueueService] Queue[/queue/D] started, fullSize=200000, pageSize=2000, downCacheSize=2000
13:19:15,490 INFO  [QueueService] Queue[/queue/ex] started, fullSize=200000, pageSize=2000, downCacheSize=2000
13:19:15,501 INFO  [QueueService] Queue[/queue/PrivateDLQ] started, fullSize=200000, pageSize=2000, downCacheSize=2000
13:19:15,503 INFO  [QueueService] Queue[/queue/PrivateExpiryQueue] started, fullSize=200000, pageSize=2000, downCacheSize=2000
13:19:15,507 INFO  [QueueService] Queue[/queue/QueueWithOwnDLQAndExpiryQueue] started, fullSize=200000, pageSize=2000, downCacheSize=2000
13:19:15,508 INFO  [TopicService] Topic[/topic/TopicWithOwnDLQAndExpiryQueue] started, fullSize=200000, pageSize=2000, downCacheSize=2000
13:19:15,511 INFO  [QueueService] Queue[/queue/QueueWithOwnRedeliveryDelay] started, fullSize=200000, pageSize=2000, downCacheSize=2000
13:19:15,512 INFO  [TopicService] Topic[/topic/TopicWithOwnRedeliveryDelay] started, fullSize=200000, pageSize=2000, downCacheSize=2000
13:19:15,514 INFO  [QueueService] Queue[/queue/testDistributedQueue] started, fullSize=200000, pageSize=2000, downCacheSize=2000
13:19:15,519 INFO  [TopicService] Topic[/topic/testDistributedTopic] started, fullSize=200000, pageSize=2000, downCacheSize=2000
13:19:15,809 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'
13:19:15,834 INFO  [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=.../deploy/jmx-console.war/
13:19:16,322 INFO  [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8080
13:19:16,342 INFO  [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
13:19:16,480 INFO  [Server] JBoss (MX MicroKernel) [4.2.0.GA (build: SVNTag=JBoss_4_2_0_GA date=200705111440)] Started in 19s:359ms

   

Note

The warning message "DataSource connection transaction isolation should be READ_COMMITTED, but it is currently NONE" is there to remind you that by default JBossAS ships with Hypersonic, an in-memory Java-based database engine, which is apropriate for demo purposes, but not for heavy load production environments. The Critique of Hypersonic wiki page outlines some of the well-known issues occuring when using this database.

Warning

Before using Messaging in production, you must configure the Messaging instance to use an enterprise-class database backend such as MySQL or Oracle, otherwise you risk losing your data. See Section 7.2, “Changing the Database” for details about replacing Hypersonic.

5.4. Installation Validation

The release bundle contains a series of examples that should run "out of the box" and could be used to validate a new installation. Such an example sends a persistent JMS message to a queue called queue/testQueue.

To run the example and validate the installation, open an new command line window and set the JBOSS_HOME environment variable to point to the JBoss AS 4.x installation you've just installed Messaging on. Navigate to the folder where you extracted the release bundle and drill down to /examples/queue. Apache Ant must pe present in your path in order to be able to run the example.

Make sure you start the JBoss server before trying to run the tests


setenv JBOSS_HOME=<your_JBoss_installation>
cd .../examples/queue
$ant

   

A successfull execution log output looks similar to:

[tim@Vigor14 queue]$ ant
Buildfile: build.xml

identify:
     [echo] ###########################################################################
     [echo] #                       Running the QUEUE example                         #
     [echo] ###########################################################################
     [echo] The queue:      testQueue
     [echo] The client jar: ../../../output/lib/jboss-messaging-client.jar

sanity-check:

init:
    [mkdir] Created dir: /home/tim/dev/jboss-messaging/trunk/docs/examples/queue/output/classes
    [mkdir] Created dir: /home/tim/dev/jboss-messaging/trunk/docs/examples/common/output/classes

compile:
    [javac] Compiling 5 source files to /home/tim/dev/jboss-messaging/trunk/docs/examples/common/output/classes
    [javac] Compiling 1 source file to /home/tim/dev/jboss-messaging/trunk/docs/examples/queue/output/classes

run:
     [java] Queue /queue/testQueue exists
     [java] The message was successfully sent to the testQueue queue
     [java] Received message: Hello!
     [java] The example connected to JBoss Messaging version 1.3.0.GA (1.3)

     [java] #####################
     [java] ###    SUCCESS!   ###
     [java] #####################

BUILD SUCCESSFUL
Total time: 5 seconds
[tim@Vigor14 queue]$

It is recommended to run all validation examples available in the example directory (queue, topic, mdb, stateless, etc.). In Chapter 6, Running the Examples, we will have a look at each of those examples.

5.5. Accessing JBoss Messaging from a remote client

In order to access JBoss Messaging from a client outside the JBoss app server, you will need to ensure the following jar files are on the client classpath: