0

I have installed jboss-fuse-karaf-6.3.0 and created a project in developer studio. I'm not able to figure out certain concepts around it.

  1. In Apache Fuse how Karaf and Fabric containers are related ? What I understood is Karaf provides runtime environment for the project to run. Fabric is for managing deployments. Is that correct ?
  2. I have started Karaf container by running FuseInstall/bin/start.bat . How to start the fabric container ?
  3. Is http://localhost:8181/hawtio is fabric console ?
  4. Is there a way to directly deploy a project to Karaf container using maven ? or we need to deploy the project to fabric ?

Thanks !

gtonic
  • 2,295
  • 1
  • 24
  • 32
Habin
  • 792
  • 1
  • 11
  • 21

2 Answers2

2
  1. Fuse is an ESB product by Redhat. And yes, you understood it correctly that Karaf provides an OSGI runtime whereas Fabric is for managing multi-container deployments.

  2. You don't start a fabric container. You need a Fabric agent or something similar for that. Not very familiar with it, but you can refer Fuse's documentation here and here regarding this.

  3. Hawtio is basically a visual management console for various containers.

  4. You can definitely deploy your OSGI bundle directly into a Karaf container. There are various commands such as :osgi:install " OR placing the bundle at FuseInstallDir/deploy. The Documentation it explains much better.

arshad.xyz
  • 21
  • 1
  • 3
  • Thank for your answer. In point-4 I have already gone through the docs, I'm looking for deployment using maven. Just want to understand if there exists any maven plugin by which project can be deployed to karaf. – Habin Dec 08 '16 at 13:43
  • You can specify the location of your jar in the maven repo, as an argument to the osgi:install command. The command would look something like "osgi:install -s mvn:/somepath/myproject.jar". -s for starting it post installing. – arshad.xyz Dec 08 '16 at 13:47
  • @Habin - Go through [this](https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Fuse/6.0/html/Deploying_into_the_Container/files/DeployBundle-Manual.html) and the link at the end "Mvn URL Handler" for understanding the maven part. – arshad.xyz Dec 08 '16 at 13:49
  • Thank you Signorsayyed. What I understood is that osgi:install has to be fired from fuse terminal (with MVN url handler), not from maven (pom.xml). I want to deploy my route project by running the pom. Could you please provide some pointers around it , if possible? – Habin Dec 08 '16 at 18:21
  • I guess that would be possible using fabric only. See [this](https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Fuse/6.1/html/Fabric_Guide/F8Plugin-Using.html) – arshad.xyz Dec 09 '16 at 06:44
  • 1
    On a side note, you can also automate the build and deployment into fuse by writing a basic shell/batch script for the same. Once maven generates the bundle for you, connect to your karaf console, uninstall your existing bundle and install the new one using osgi commands. (Fuse provide ssh access for connecting to the karaf console.) – arshad.xyz Dec 09 '16 at 06:49
1
  1. A Fabric is just a group of commonly managed Karaf containers. It lets you manage your containers using Profiles instead of just features and bundles.

  2. Once you have started a Karaf container you can CREATE a Fabric. Follow these instructions: https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Fuse/6.2.1/html-single/Fabric_Guide/index.html#Deploy-Fabric-Create . Any other Karaf containers you start will then be JOINED to the existing Fabric.

  3. Once the Fabric has been created, localhost:8181/hawtio will have Fabric specific content

  4. If you are using Fabric, then you can use the fabric8 Maven plugin to deploy your application to a Profile directly. See more details here: https://fabric8.io/gitbook/mavenPlugin.html . Basically you can just run mvn fabric8:deploy and it will update the fabric to use your new code. Be careful here as this will tell Fabric where to find your new code in its list of Maven repos. If you have not deployed your code to a central or shared repo and it is only on your local machine, and the container that is getting the deployment is on a separate machine, it will not work.

Be sure to read up on how profiles work as well, because adding your code to a profile does not add it to a container unless that container is already set up to include the profile you are updating. The fabric guide I linked first explains this well.

R. Stroop
  • 31
  • 2