This section describes the procedure to perfom a non-clustered installation. At the end of this procedure, you will create a JBoss Messaging configuration that will start a non-clustered messaging server. To find out how you can install JBoss Messaging in a clustered configuration, please proceed to Chapter 6, JBoss Messaging Clustered Installation.
By default, a JBoss AS 4.0.x and 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.
Set up the JBOSS_HOME environment variable to point to the JBoss 4.x 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.
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 messaging
A successful JBoss Messaging deployment generates logging output similar to:
.... 01:44:48,317 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. 01:44:50,450 INFO [ServerPeer] JBoss Messaging 1.2.0.GA server [0] started 01:44:51,311 INFO [ConnectionFactory] Connector bisocket://192.168.1.104:4457 has leasing enabled, lease period 10000 milliseconds 01:44:51,311 INFO [ConnectionFactory] [/ConnectionFactory, /XAConnectionFactory, java:/ConnectionFactory, java:/XAConnectionFactory] started 01:44:51,441 INFO [ConnectionFactory] Connector bisocket://192.168.1.104:4457 has leasing enabled, lease period 10000 milliseconds 01:44:51,441 INFO [ConnectionFactory] [/NonClusteredConnectionFactory, /NonClusteredXAConnectionFactory, java:/NonClusteredConnectionFactory, java:/NonClusteredXAConnectionFactory] started 01:44:51,681 INFO [QueueService] Queue[/queue/DLQ] started, fullSize=200000, pageSize=2000, downCacheSize=2000 01:44:51,681 INFO [QueueService] Queue[/queue/ExpiryQueue] started, fullSize=200000, pageSize=2000, downCacheSize=2000 01:44:51,732 INFO [TopicService] Topic[/topic/testTopic] started, fullSize=200000, pageSize=2000, downCacheSize=2000 01:44:51,732 INFO [TopicService] Topic[/topic/securedTopic] started, fullSize=200000, pageSize=2000, downCacheSize=2000 01:44:51,732 INFO [TopicService] Topic[/topic/testDurableTopic] started, fullSize=200000, pageSize=2000, downCacheSize=2000 01:44:51,752 INFO [QueueService] Queue[/queue/testQueue] started, fullSize=200000, pageSize=2000, downCacheSize=2000 01:44:51,752 INFO [QueueService] Queue[/queue/A] started, fullSize=200000, pageSize=2000, downCacheSize=2000 01:44:51,762 INFO [QueueService] Queue[/queue/B] started, fullSize=200000, pageSize=2000, downCacheSize=2000 01:44:51,762 INFO [QueueService] Queue[/queue/C] started, fullSize=200000, pageSize=2000, downCacheSize=2000 01:44:51,882 INFO [QueueService] Queue[/queue/D] started, fullSize=200000, pageSize=2000, downCacheSize=2000 01:44:51,882 INFO [QueueService] Queue[/queue/ex] started, fullSize=200000, pageSize=2000, downCacheSize=2000 01:44:51,882 INFO [QueueService] Queue[/queue/PrivateDLQ] started, fullSize=200000, pageSize=2000, downCacheSize=2000 01:44:51,892 INFO [QueueService] Queue[/queue/PrivateExpiryQueue] started, fullSize=200000, pageSize=2000, downCacheSize=2000 01:44:51,892 INFO [QueueService] Queue[/queue/QueueWithOwnDLQAndExpiryQueue] started, fullSize=200000, pageSize=2000, downCacheSize=2000 01:44:51,892 INFO [TopicService] Topic[/topic/TopicWithOwnDLQAndExpiryQueue] started, fullSize=200000, pageSize=2000, downCacheSize=2000 01:44:51,942 INFO [QueueService] Queue[/queue/QueueWithOwnRedeliveryDelay] started, fullSize=200000, pageSize=2000, downCacheSize=2000 01:44:51,942 INFO [TopicService] Topic[/topic/TopicWithOwnRedeliveryDelay] started, fullSize=200000, pageSize=2000, downCacheSize=2000 01:44:51,952 INFO [QueueService] Queue[/queue/testDistributedQueue] started, fullSize=200000, pageSize=2000, downCacheSize=2000 01:44:51,952 INFO [TopicService] Topic[/topic/testDistributedTopic] started, fullSize=200000, pageSize=2000, downCacheSize=2000 01:44:52,372 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:name=JmsXA,service=ConnectionFactoryBinding' to JNDI name 'java:JmsXA' ....
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.
setenv JBOSS_HOME=<your_JBoss_installation> cd .../examples/queue $ant
A successfull execution log output looks similar to:
$ 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: c:\work\src\svn\messaging\docs\examples\queue\output [mkdir] Created dir: c:\work\src\svn\messaging\docs\examples\common\output compile: [javac] Compiling 5 source files to c:\work\src\svn\messaging\docs\examples\common\output [javac] Compiling 1 source file to c:\work\src\svn\messaging\docs\examples\queue\output 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.2.0.GA (1.2) [java] [java] ##################### [java] ### SUCCESS! ### [java] ##################### BUILD SUCCESSFUL Total time: 9 seconds
It is recommended to run all validation examples available in the example directory (queue, topic, mdb, stateless, etc.). In Chapter 7, Running the Examples, we will have a look at each of those examples.