Lab 9 - Fabric

RH_Icon_Compass_Shiny.png In this lab you will create a Fuse Fabric, and configure Insight to view distributed logs from a central view.
general_info_polished.png Fuse Fabric is a lightweight runtime environment that focuses on centralizing provisioning and configuration spanning from small environments, limited to a few JVMs or systems, to larger production environments which utilize an open hybrid cloud consisting of containers on both cloud services and physical hosts. The Fuse Fabric technology layer supports the scalable deployment of JBoss Fuse containers across a network, and it enables a variety of advanced features, such as remote installation and provisioning of containers, phased rollout of new versions of libraries and applications, load-balancing, and failover of deployed endpoints.
  1. In JBDS, make sure the Fuse v6.2 server is running.
  2. Click on the Shell tab.
  3. Create a new Fabric by executing: “fabric:create --wait-for-provisioning”

general_info_polished.png Fuse Fabric is a technology layer that allows a group of containers to form a cluster that shares a common set of configuration information and a common set of repositories from which to access runtime artifacts. Fabric containers are managed by a Fabric Agent that installs a set of bundles that are specified in the profiles assigned to the container. The agent requests artifacts from the Fabric Ensemble. The ensemble has a list of repositories that it can access. These repositories are managed using a Maven proxy and include a repository that is local to the ensemble.
  1. Open a browser and go to http://localhost:8181
  2. Login as admin/admin
  3. Notice the UI has changed, because now we’ve created a Fabric ensemble, and a default root container.

  1. Click on the icon next to the root container.
  2. If a “Connect to root?” popup appears, click Connect.

  1. A new tab will open for the root container, look at the log, click on any log line to view its details.
  2. Click on the ActiveMQ tab.
  3. Click on the Create button.

  1. Enter “lab9” as the name, and “Queue” as the type.
  2. Click on the “Create Queue” button.
  3. Close the root container tab in the browser, and go back to the Fabric browser tab.
  4. Click on the Containers tab, and the Create button.
  5. Enter “els” as the Container Name.
  6. In the Profiles text box, enter: “insight”.
  7. From the list of available profiles, check “elasticsearch.datastore” and “elasticsearch.node”.

  1. Click on the “Create and start container” button.
  2. Click on the Profiles tab.
  3. In the “filter profiles” text box, enter “insight”.

  1. Select “insight-console”, “insight-camel” and “insight-elasticsearch.node” profiles.
  2. Click on the Assign button.

  1. Click on the root container, and then on the Assign button.

  1. Back in JBDS, create a new Fuse Project (File-> New -> Fuse Project).
  2. Enter “Lab9” as project name.
  3. Select the “camel-archetype-blueprint”.
  4. Click Finish.

  1. Right-click on “com.mycompany.camel.blueprint” package under src/main/java and click Delete.
  2. Right-click on “com.mycompany.camel.blueprint” package under src/test/java and click Delete.
  3. Double-click on the blueprint.xml file under “Camel Contexts”.
  4. Click on Routes -> Delete Route.
  5. Save the file (Ctrl+S).
  6. Drag and drop an ActiveMQ, Log, and File component to the canvas.
  7. Create a link between the ActiveMQ and Log component.
  8. Create a link between the Log and File component.
  9. Click on the ActiveMQ node, and click on the Properties tab.

  10. In the Generic tab, enter “amq:lab9” as the URI.

  1. Click on the Log node.

  2. Enter “New message: ${body}” as Message.

  1. Click on the File node, Properties-> Advanced -> Path tab.

  2. Enter “OutputDir” as Directory Name.

  1. Save the file (Ctrl+S).
  2. Click on the Source tab and delete the <bean> element.
  3. Save the file (Ctrl+S).
  4. Double-click on the pom.xml file.
  5. Click on the last tab (pom.xml).
  6. Scroll to the end of the file, and locate the </plugins> element.
  7. Copy and paste the following XML code before the </plugins> element:
<plugin> <groupId>io.fabric8</groupId> <artifactId>fabric8-maven-plugin</artifactId> <version>1.0.0.redhat-379</version> <configuration> <profile>lab9profile</profile> <parentProfiles>feature-camel</parentProfiles> <features>mq-fabric-camel</features> </configuration> </plugin>
general_info_polished.png The fabric8-maven-plugin comes out of the box with Fuse and it plugs in into your maven lifecycle with a few configuration lines in your project’s pom.xml.
  1. Save the file (Ctrl+S).
  2. Click on Window->Preferences.
  3. Look for Maven->User Settings.

  1. Click on the “open file” link.
  2. Close the Preferences dialog.
  3. In settings.xml file, click on the Source tab.
  4. Locate the </settings> element.
  5. Copy and paste the following XML code before the </settings> element:
<servers>
general_info_polished.png This configuration allows the fabric8-maven-plugin to identify the Fuse fabric location.
  1. Save the file (Ctrl+S) and close it.
  2. Right-click on the Lab9 project and click on “Run As -> Maven build …”
  3. Enter “fabric8:deploy” in the Goals field.
  4. Click Apply, and Run.
  5. Check the outcome of the deployment in the Console tab.
  6. If the build is successful, go back to the browser.
  7. Click on the Containers tab.
  8. Click on the Create button.
  9. Enter “lab9container” as the Container Name.
  10. Enter “2” as the number of containers.

  1. In the Profiles filter text box, enter “lab”.
  2. Select the lab9profile.
  3. In the Profiles filter text box, enter “insight”.
  4. Select the “camel”, “logs.elasticsearch” and “metrics.elasticsearch” profiles.

  1. Click on the “Create and start container” button.
general_info_polished.png The Insight plugin enables to centrally manage logs and metrics for multiple containers in a fabric. The Insight plugin is a set of profiles that uses Elasticsearch and Kibana technology to collect log messages and events from multiple containers in one or more data stores. You then access and analyze the messages from the Insight perspective of the Fuse Management Console.
  1. Click on the Containers tab.
  2. Click on the icon, next to the root container.
  3. In the root container tab, click on the ActiveMQ tab.
  4. Click on the lab9 queue.
  5. Click on the Send button.

  1. Select “Plain Text” as payload format and enter any text in the textbox.
  2. click on the Send Message button.

  1. Repeat these steps with a different message and send it.
  2. Close the root container tab.
  3. Back to the Fabric tab, switch to the Insight perspective.

  1. In the log section, you should find the two log messages produced by the two executions of the camel route in two different containers, processing the ActiveMQ messages.

  1. Click on the “Camel Events” tab.
  2. Expand the existing camel events to view their details.

results matching ""

    No results matching ""