Red Hat DocumentationFuse Message BrokerToggle FramesPrintFeedback

Starting a Broker

In this tutorial you will launch a Fuse Message Broker instance from the command line.

Goals

In this tutorial you will:

  • add the Fuse Message Broker command line tools to your system path

  • locate a Fuse Message Broker configuration file

  • start a Fuse Message Broker instance using the configuration file

Prerequisites

This tutorial requires that you have Fuse Message Broker installed.

While you can use the default configuration for this tutorial it is recommended that you use an instance like the one created in ????.

Procedure for Windows

To start a broker on Windows:

  1. Locate the root folder for the broker instance you wish to start.

    To use the default installation, the root folder is InstallDir.

    To use the instance created in ????, the root folder is c:\tutorial.

  2. Open a command prompt at the instance's root folder.

  3. Add the Fuse Message Broker command line tools your path by entering

    c:\ set PATH=%PATH%;InstallDir\bin
  4. Locate the configuration file for the broker instance.

    The default location for the configuration file is conf\activemq.xml.

  5. Start the broker instance by entering

    c:\ activemq xbean:conf/activemq.xml

    Note

    This assumes the default location of the configuration file.

A number of messages, similar to Figure 1, will appear on the console.

Figure 1. Broker Output

Java Runtime: Sun Microsystems Inc. 1.6.0_16 C:\Program Files\Java\jdk1.6.0_16\jre
  Heap sizes: current=260160k  free=258524k  max=1040512k
    JVM args: -Dcom.sun.management.jmxremote -Xms256M -Xmx1G 
-Dorg.apache.activemq.UseDedicatedTaskRunner=true 
-Djava.util.logging.config.file=logging.properties 
-Dactivemq.classpath=c:\apache-activemq-5.5.0-fuse-00-27\bin\../conf;c:\apache-activemq-5.5.0-fuse-00-27\bin\../conf; 
-Dactivemq.home=c:\apache-activemq-5.5.0-fuse-00-27\bin\.. 
-Dactivemq.base=c:\apache-activemq-5.5.0-fuse-00-27\bin\..
ACTIVEMQ_HOME: c:\apache-activemq-5.5.0-fuse-00-27\bin\..
ACTIVEMQ_BASE: c:\apache-activemq-5.5.0-fuse-00-27\bin\..
Loading message broker from: xbean:conf/activemq.xml
 INFO | Refreshing org.apache.activemq.xbean.XBeanBrokerFactory$1@5a67c9: startup date 
[Mon Sep 12 17:07:04 EDT 2011]; root of context hierarchy
 INFO | PListStore:[c:\apache-activemq-5.5.0-fuse-00-27\bin\..\data\tutorial\tmp_storage ] started
 INFO | Using Persistence Adapter: KahaDBPersistenceAdapter[c:\apache-activemq-5.5.0-fuse-00-27\bin\..\data\kahadb]
 INFO | ActiveMQ 5.5.0-fuse-00-27 JMS Message Broker (tutorial) is starting
 INFO | For help or more information please see: http://activemq.apache.org/
 INFO | Listening for connections at: tcp://nbbedemjohnso1:61616
 INFO | Connector openwire Started
 INFO | ActiveMQ JMS Message Broker (tutorial, ID:nbbedemjohnso1-3192-1315861625337-0:1) started
 INFO | jetty-7.1.6.v20100715
 INFO | ActiveMQ WebConsole initialized.
 INFO | Initializing Spring FrameworkServlet 'dispatcher'
 INFO | ActiveMQ Console at http://0.0.0.0:8161/admin
 INFO | Initializing Spring root WebApplicationContext
 INFO | OSGi environment not detected.
 INFO | Apache Camel 2.7.1-fuse-00-27 (CamelContext: camel) is starting
 INFO | JMX enabled. Using ManagedManagementStrategy.
 INFO | Found 5 packages with 16 @Converter classes to load
 INFO | Loaded 152 type converters in 0.563 seconds
 WARN | Broker localhost not started so using tutorial instead
 INFO | Connector vm://localhost Started
 INFO | Route: route1 started and consuming from: Endpoint[activemq://example.A]
 INFO | Total 1 routes, of which 1 is started.
 INFO | Apache Camel 2.7.1-fuse-00-27 (CamelContext: camel) started in 1.000 seconds
 INFO | Camel Console at http://0.0.0.0:8161/camel
 INFO | ActiveMQ Web Demos at http://0.0.0.0:8161/demo
 INFO | RESTful file access application at http://0.0.0.0:8161/fileserver
 INFO | FUSE Web Console at http://0.0.0.0:8161/console
 INFO | Started SelectChannelConnector@0.0.0.0:8161

Procedure for Unix/Linux/OSX

To start a broker:

  1. Locate the root folder for the broker instance you wish to start.

    To use the default installation, the root folder is InstallDir.

    To use the instance created in ????, the root folder is ~/tutorial.

  2. Open a command prompt at the instance's root folder.

  3. Add the Fuse Message Broker command line tools your path by entering

    % set PATH=$PATH;InstallDir/bin
  4. Locate the configuration file for the broker instance.

    The default location for the configuration file is conf/activemq.xml.

  5. Start the broker instance by entering

    % activemq start xbean:conf/activemq.xml

    Note

    This assumes the default location of the configuration file.

The message Running ActiveMQ Broker... will appear and the command will return without error. The broker is now running as a daemon process.

Tip

To start the broker with a command console use activemq console in place of activemq start.

More information

For details see:

????
Comments powered by Disqus