Search This Blog

Before we go and start creating our first application, I want to show you how to setup your JBoss Developer Studio, create a small application from the quickstart example and then running it on Fuse Integration Service.

I am using JBoss Developer Studio version 9, you can find it here.
After download the

jboss-devstudio-9.0.0.GA-installer-eap.jar

double-click it, and start installing with default values.

After successful installation, we will need install the plugins for Fuse, on JBoss Central view, select software update, select enable early access.

And select JBoss Fuse Development for the plugin,

Click on install, and we are all set to go!

First thing first, we want to create a Fuse project to deploy on the base of Fuse Integration Service, which is OpenShift. If you have not installed it, please go back to my previous post for instructions. So on your JBDS, right click and start creating the project. Select new, maven project, if you have installed the plugin correctly, you should see the "Fuse Tooling Remote Archetype Catalog" under Catalog option, select it.

Select the cdi-mq archetype and for current OpenShift 3.1 make sure it matches the archetype version 2.2.0.redhat-079,

Create the application with

Group ID: com.redhat

Artifact ID: mqservicedemo

The project should be created. The reason we are creating with this archetype is because I want to show you a brilliant idea from Fabric8 that will be very useful. In Fabric8, by using the CDI extension, we can inject service we created in OpenShift to the client by simply specifying the @ServiceName and @Factory in our application. It will automatically locate where the service's clustered Host and Port in our OpenShift environment, since if we are moving to cloud, the server instance will change frequently, so it will be unrealistic to point to real physical location.

Let's start by creating a messaging service named Broker in our Fuse Integration Service, login to OpenShift, which is the base platform of Fuse Integration Service, create a project called demo if you have not already done so.

Add AMQ broker to demo project, we will use the most basic image, choose amq62-basic.

And you will be redirect to a configuration page, set your application name to broker, and set your prefer ID and PWD, click on "Create" button to start create the service.

It'll take a few minute to startup. And you should be able to see the service up and running in the console.

Go back to JBDS, our quickstart application should be created, navigate the project, go to pom.xml, under plugin docker-maven-plugin add the following environment variable. The reason it can pick up this environment variable is because we have injected the configuration through the ActiveMQConfigurer with Object ActiveMQConfig to set the configurations.

<BROKER_AMQ_TCP_USERNAME>YOUR_ID</BROKER_AMQ_TCP_USERNAME

<BROKER_AMQ_TCP_PASSWORD>YOUR_PWD</BROKER_AMQ_TCP_PASSWORD>

In the routing code, you should be able to see Fabric8 API, and it is injecting ActiveMQ component with broker name, and setting the alias for the endpoint, change the service name to broker-amq-tcp

@Inject

@ServiceName("broker-amq-tcp")

@Alias("jms")

ActiveMQComponent activeMQComponent;

We are now ready to deploy our application, we are going to build with S2i method, I talk more about in the upcoming post, for now, just think of it as a way to package our code to a docker image. There are few things we need to make sure it's properly setup before we start deploying, first is the docker settings, to get all the info, go to where your install your vagrant for OpenShift and run

vagrant adbinfo

There you will get all the environment details to set, save it for now,

And alway remember to restart your application after running the adbinfo with

vagrant provision

In command line mode, go to your application directory, can start setting the docker environment variables. And then login to OpenShift with your OpenShift client tool, if you don't have it, you can down load it here.

oc login

You will be prompt to enter your login ID and pwd, please login, then we can start deploying with command

Once you have successfully deploy the application, please go back to the OpenShift console, you should be able to see your mqservicedemo pod running, check the log, and you should see something similar to this:

That's all for this time! Thanks! Here is the detail video of how to do it. Thanks!

Comments

A really nice introduction series to Fuse Integration Services!Unfortunately stops the installation of OpenShift because the VirtualBox images are not available at the specified address, i.e 'http://cdk-builds.usersys.redhat.com/builds/09-Mar-2016/rhel-cdk-kubernetes-7.2-21.x86_64.vagrant-virtualbox.box'.Do you know where they are located?

plz help me mvn -Pf8-local-deployFailed to execute goal org.jolokia:docker-maven-plugin:0.13.6:build (default-cli) on project mqservice: Cannot create docker access object: /root/testopen/.vagrant/machines/default/virtualbox/.docker/key.pem (No such file or directory) -> [Help 1]org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.jolokia:docker-maven-plugin:0.13.6:build (default-cli) on project mqservice: Cannot create docker access object at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288) at org.apache.maven.cli.MavenCli.main(MavenCli.java:199) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)Caused by: org.apache.maven.plugin.MojoExecutionException: Cannot create docker access object at org.jolokia.docker.maven.AbstractDockerMojo.createDockerAccess(AbstractDockerMojo.java:247) at org.jolokia.docker.maven.AbstractDockerMojo.execute(AbstractDockerMojo.java:159) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207) ... 20 moreCaused by: java.io.FileNotFoundException: /root/testopen/.vagrant/machines/default/virtualbox/.docker/key.pem (No such file or directory) at java.io.FileInputStream.open0(Native Method) at java.io.FileInputStream.open(FileInputStream.java:195) at java.io.FileInputStream.(FileInputStream.java:138) at java.io.FileInputStream.(FileInputStream.java:93) at java.io.FileReader.(FileReader.java:58) at org.jolokia.docker.maven.access.KeyStoreUtil.loadPEM(KeyStoreUtil.java:51) at org.jolokia.docker.maven.access.KeyStoreUtil.loadPrivateKey(KeyStoreUtil.java:45) at org.jolokia.docker.maven.access.KeyStoreUtil.createDockerKeyStore(KeyStoreUtil.java:33) at org.jolokia.docker.maven.access.hc.http.HttpClientBuilder.getSslFactoryRegistry(HttpClientBuilder.java:76) at org.jolokia.docker.maven.access.hc.http.HttpClientBuilder.getConnectionFactory(HttpClientBuilder.java:67) at org.jolokia.docker.maven.access.hc.http.HttpClientBuilder.build(HttpClientBuilder.java:56) at org.jolokia.docker.maven.access.hc.DockerAccessWithHcClient.(DockerAccessWithHcClient.java:85) at org.jolokia.docker.maven.AbstractDockerMojo.createDockerAccess(AbstractDockerMojo.java:241) ... 23 more[ERROR] [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles:[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionExceptionhow can I fix it ?

Fuse and A-MQ 6.3 GA has just went out. Maybe, you would think this is just only a minor version release why should I care? Hold your thoughts on that! Because they have done a lot of improvements and also added many new features into this release.

Besides various bug fixes and making sure Fuse Fabric is much more stable. There are two major change in this version update:

New Tooling in JBoss Developer Studio (JBDS) 9.1 GA. Newer Apache Camel version – Camel v2.17.
I was really impressed by the work put in to make developing Camel application much simpler. First is the installation of tooling itself. Now it has a all-in-one installer so you don't need to worry about which plugins you need to check. See the videos below to see the new "Getting Started" of Fuse 6.3.

And If you notice from the above video, the presentation of camel route in JBDS has also updated. It fixed some of the miss representation of logic and making it easier to read.

I just realized that I did not do a getting started for Fuse Integration Service 2.0 Tech preview before I did the pipeline demo, thanks for those of you who reminded me! :)

To get started with FIS 2.0, for people who has just getting to know the technology, here is how I interpret it. Basically, it's divide into two aspect,

1. Integration development, FIS uses Apache Camel as the core technology that creates, orchestrate, compose microservices into a super lightweight thin integration layer, and become the API provider and service orchestrator through exposing RESTful or messaging service endpoints. And you can choose to either package and run it with Spring-Boot or Karaf.

2. Application Deployment and Management, FIS takes advantages of OpenShift platform, and allows you to separately deploy the micro-integration service among distributed environment, at the same time takes care of the failover, high availability, load balancing and service lookup problem for you.