Red Hat Training

A Red Hat training course is available for Red Hat Fuse

Chapter 6. To Deploy a Camel Project to Red Hat JBoss Fuse

Abstract

This tutorial walks you through the process of deploying a camel project into Red Hat JBoss Fuse. It assumes that you have an instance of Red Hat JBoss Fuse installed on the same machine on which you are running the Red Hat JBoss Fuse Tooling.

Goals

In this tutorial you will:
  • start up Red Hat JBoss Fuse 6.x Server
  • deploy your project into Red Hat JBoss Fuse 6.x Server
  • check whether your project was successfully built and deployed
  • uninstall your deployed bundle

Prerequisites

To complete this tutorial you will need

Starting up Red Hat JBoss Fuse 6.x Server

To start up the server:
  1. In Fuse Integration perspective, click the Servers tab in the lower, right pane to open the Servers view.
  2. Click the link No servers are available. Click this link to create a new server... to open the Define a New Server page.
  3. Expand the JBoss Fuse node to expose the available server options as shown in Figure 6.1.

    Figure 6.1. Define a New Server page

    New server selection
  4. Click JBoss Fuse 6.1 Server.
  5. Accept the defaults for Server's host name (localhost) and Server name (JBoss Fuse 6.1 Server at localhost), and then click Next to open the JBoss Fuse Runtime page.
  6. In Installation directory, enter the path where the JBoss Fuse 6.1 installation is located, or click the Browse to search for it, and then click Next to open the New Server> JBoss Fuse server configuration details page.

    Figure 6.2. New server configuration

    New server configuration details
  7. Accept the defaults for Host Name (0.0.0.0) and Port Number (8101).
  8. In User name, enter the name used to log into the server.
    This is a user name stored in Red Hat JBoss Fuse's installDir/etc/users.properties file.
    If one has not been set, you can either add one to that file using the format user=password,role (for example, admin=admin,admin), or you can set one using the karaf jaas command set:
    • jaas:realms—to list the realms
    • jaas:manage --index 1—to edit the first (server) realm
    • jaas:useradd <username> <password>—to add a user and associated password
    • jaas:roleadd <username> admin—to specify the new user's role
    • jaas:update—to update the realm with the new user information
    If a jaas realm has already been selected for the server, you can discover the user name by issuing the command JBossFuse:karaf@root>jaas:users.
  9. In Password, enter the password required for User name to log into the server.
    This is the password set either in Red Hat JBoss Fuse's installDir/etc/users.properties file or by the karaf jaas commands.
  10. Click Next, and then click Finish.
    jboss-fuse-6.1.0.redhat-xxx [stopped] appears in Servers view.
  11. In Servers view, right-click jboss-fuse-6.1.0.redhat-xxx to open the context menu, and then click Start.
    Important
    If the warning that the remote host identification has changed appears, click yes to delete the old key and insert the new key, only if the JBoss Fuse 6.1 server runtime is installed on the same machine where the Red Hat JBoss Fuse Tooling is running! Otherwise click no and contact your system administrator.
    Wait a few seconds for JBoss Fuse 6.1 Server to start up. When it does, JBoss Fuse [xxx] is added to the Fuse JMX Navigator tree under the Local Processes node, but you need to expand the Local Processes node to see it.
    The JBoss Fuse console also starts up in Shell view, as shown in Figure 6.3:

    Figure 6.3. JBoss Fuse console

    JBoss Fuse console
  12. In Fuse JMX Navigator, right-click JBoss Fuse [xxx] to open the context menu, and then click Connect.
  13. In Fuse JMX Navigator, expand the JBoss Fuse [xxx] node to see its tree structure.
    Now you're ready to deploy your project.

Deploying a project to Red Hat JBoss Fuse

To deploy a camel project to JBoss Fuse:
  1. From Project Explorer, drag the simple-route root project over to Fuse JMX Navigator and drop it on JBoss Fuse [xxx].
    Note
    The Deploy to... tool provides an alternative to the drag and drop method of deployment. For details, see Deploying Projects to a Container in the Red Hat JBoss Fuse Tooling: JBoss Fuse Tooling User Guide.
    Console view chronicles the process as the tooling builds the simple-route project, runs the tests, and then installs the project as a bundle inside JBoss Fuse [xxx].
  2. In Fuse JMX Navigator, right-click JBoss Fuse [xxx] to open the context menu, and then click Refresh.
    Note
    You may have to repeat the Refresh operation before your project appears in Fuse JMX Navigator under JBoss Fuse [xxx}Camel as <bundleIdentifier>-camel-#. (Camel generates and appends an ID number to the end of the node name to ensure that every camel context is uniquely identified.)
    In the mean time, you can verify whether your project's bundle was installed by clicking the Bundles node under JBoss Fuse [xxx] to display, in Properties view, all installed bundles. Start typing tutorial in Properties view's Search tool to quickly determine whether your project's tutorial.simple-route bundle is included in the list.
    Once your project appears in Fuse JMX Navigator, you can start tracing on it, as described in Chapter 4, To Trace a Message Through a Route.

Uninstalling your project's bundle

To uninstall your project from JBoss Fuse 6.1 server:
  1. Switch to the JBoss Fuse console in Shell view.
  2. At the JBoss Fuse console command line, type uninstall <bundleIdentifier>

Further reading

To learn more about deploying applications to external containers, see:
  • Deploying Projects to a Container in the Red Hat JBoss Fuse Tooling: JBoss Fuse Tooling User Guide