Fuse - how to create custom fuse commands - jbossfuse

In fuse we can add profiles to the container by using command fabric:container-add-profile.When we have deployed an application,how can we define application specific commands , for example : command to export application properties?

Fuse is based on Karaf. The karaf documentation will show you how to create commands: http://karaf.apache.org/manual/latest/developers-guide/extending.html
Note: Don't forget to target the same version of Karaf as Fuse is using.
Good luck!

Related

Keycloak.X (quarkus based) on CloudFoundry

we want to deploy keycloak.X to cloudfoundry. I found older approaches (How to deploy keycloak to cloudfoundry) with two options:
wrapping it as a Spring application (the corresponding stuff on github seems abandoned, guess this is because keycloak switched to quarkus?)
using the docker image (diego_dockeris disabled in my target environment)
So I am stuck with the Quarkus distribution.
Ideally, I dont want to change too much on the application itself (risk assessment ...) but only wrap it for cloud foundry.
The start script targets a class named QuarkusEntryPoint, but I don't know how to put it into a buildpack.

How Karaf and Fabric containers are related?

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.
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 ?
I have started Karaf container by running FuseInstall/bin/start.bat . How to start the fabric container ?
Is http://localhost:8181/hawtio is fabric console ?
Is there a way to directly deploy a project to Karaf container using maven ? or we need to deploy the project to fabric ?
Thanks !
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.
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.
Hawtio is basically a visual management console for various containers.
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.
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.
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.
Once the Fabric has been created, localhost:8181/hawtio will have Fabric specific content
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.

MongoDB datasource configuration in jbossas

I am using Openshift JBOSS server. I would like to configure external MongoDB in JBOSS.
Is it possible to configure MongoDB as a datasource in JBOSS server ?
You could try taking a look at this quickstart: https://github.com/openshift-quickstart/jbossas-mongoDB-quickstart. I was able to create a JBoss application with mongodb following the instructions listed there.
If you don't want to create a new application from scratch you should be able to borrow some of the code and apply it to your application and then just add the mongodb cartridge.

Managing deployments for nodes running Camel routes

I have an enterprise application that uses Camel routes and need to be able to provision/start/stop nodes running these Camel routes on multiple machines.
I am looking at Apache Karaf and JBoss Switchyard as 2 solutions to help me deploy and manage these routes. I think I understand the value of Apache Karaf since it is a osgi container and I can un/deploy new routes into it. Will JBoss Switchyard also help me for this issue?
JBoss Fuse
JBoss Fuse which includes Fuse Fabric can manage and provision containers in a cluster / cloud / etc.
http://fuse.fusesource.org/fabric/
JBoss Fuse uses Karaf as the container. So what you can do with Karaf you can do as well with JBoss Fuse.
On top of that Fuse Fabric brings to the table, all the cluster provisioning and management. And with a distributed registry for HA et all.
With JBoss Fuse you can deploy and manage your Camel routes in a cluster. And perform rolling upgrades / downgrades across the nodes in the cluster, and much more. And to go along with that you have commands in the Karaf Shell to perform actions, and as well a web console UI based on http://hawt.io/.
Short answer: Yes JBoss Fuse can manage and provision your Camel routes in a cluster.
SwitchYard
In terms of JBoss SwitchYard, then it uses JBoss Application Server / WildFly as its container (at this time of writing SY does not yet support OSGi). So SY leverages the clustering and management support from JBoss Application Server.
Yes with Apache Karaf you'll be able to deploy/undeploy routes by either installing the appropriate bundle or by installing the corresponding blueprint.xml (containing the route) as Karaf supports deploying of various xml files (which are generated to bundles at runtime). This will give you an easy way of deploying / Developing. Also available with karaf is the def:watch command, it'll help you with developing Bundles cause it will watch your file/maven-repo location for updates and will install those immediately in the container.
For distributing your routes throughout a cluster there is also Apache Karaf - Cellar, a subproject for maintaining Cluster ability for the Karaf container.
take a look at Zookeeper and its support for distributed route policies...
also, check out these master election examples
http://www.systemmobile.com/?p=399
http://frommyworkshop.blogspot.com/2013/06/leader-election-of-camel-router-through.html

Webspher Deployment using terminal

I am trying to learn how to deploy ear files in WebSphere v 7 using terminal,
I know how to deploy ear files using administration console but I want to learn how to deploy using terminal.
my searches did not help
Any advice
Thanks a lots.
You should be using the AdminApp object in wsadmin