Thursday, 24 April 2014

Getting started with Fuse 6.1 and fabric8

Just a very quick followup to my previous post.  Since writing it the Fuse upstream project fabric8 has been released and also JBoss Fuse 6.1.

fabric8 is the upstream community project for JBoss Fuse which is available in Maven Central.  With it comes a sleek new website with documentation that lives with the code on GitHub.

http://fabric8.io

Don't miss new features being added by following the fabric8 project on GitHub.  It's never been easier to get involved, start contributing and benefitting from you efforts...its Open Source after all!

Below are a few of the new features (some are tech preview) in 6.1 that I've been really looking forward to...

  • fabric plugin for hawtio - this is the consolidation of FMC inside hawtio and much much more
  • fabric8:deploy - awesome new maven plugin that aids continuous delivery and working with OpenShift
  • Gateways - discovery, load balancing and failover of TCP, HTTP and HTTPs traffic
  • New broker topologies including Replicated level-db
  • Git to version all configuration*
  • Kibana and elastic search for powerful searching of logs within a fabric.
  • new Camel version 2.12.0
  • new ActiveMQ version 5.9.0

* Instead of importing properties and broker configuration from the files into your fabric you can now commit them directly to the Git repo.  

In 6.1 you still need to initially create a fabric from the CLI.  Once in a fabric, from hawtio (available by default in 6.1 @ http://localhost:8181/hawtio/) navigate to the containers section.  On the right hand side is a URL tab, select this and you will find the Git repo for ZK configuration.  Copy this, clone the repo and you can navigate to find the profiles where you can commit your properties and broker.xml and other configuration.

There are many many more new features, even if you're completely familiar with Fuse I really recommend reading the fabric8 docs.  I guarantee there will be something that you say "well I didn't know that" or "now that's cool!"

What's after 6.1 and in fabric8 that I'm excited about?

  1. Docker - extreme lightweight containers that share and reuse resources with other containers whist appearing as individual servers.  I've being playing with docker for a couple of month now, this will change everything and Red Hat are working with Docker on their main products. For example checkout Paolo's GitHub repo where he has scripts that can recreate an entire production Fabric cluster including 3 fabric servers and multiple worker nodes all on a single Linux OS.
  2. Micro Services - you just have to check this out! fabric8's answer to http://martinfowler.com/articles/microservices.html
  3. Process Manager - I haven't had time to properly look at this yet but after reading it you know it's going to be big!

Monday, 11 November 2013

Getting started with Fuse

For my first blog post I wanted to do a small brain dump of links that I've found useful when working with Fuse.  Fuse is made up of a number of Apache projects which can feel a bit overwhelming when starting out.  It's the same with learning anything new, half the battle is knowing where to find help.  Well the good news is there is a wealth of information available that will support the novice right through to the expert.

Get the product

Download the distributions from jboss.org here

There is a huge amount of information on the RedHat sites.  Even if you think you know the products I highly recommend reviewing these as the documentation is improved from version to version.

https://access.redhat.com/site/documentation/JBoss_A-MQ/
https://access.redhat.com/site/documentation/JBoss_Fuse/

Recommended Reading

The transition from J2EE application servers to working with OSGi is something that developers can struggle with.  Combine that with understanding the different error handling options in Camel and configurations for ActiveMQ, starting out can be time consuming.  For this reason and many more as you will find out, I highly recommend the following books.

ActiveMQ in Action
Camel In Action
Enterprise OSGi InAction
Instant Apache Camel Message Routing

An essential reference book that all development teams and architects should have access to is Enterprise Integration Patterns.


Where to start

Archetypes

A great way to start development is by using an archetype, I normally start with the camel-blueprint but there are many others.

$ mvn archetype:generate -Dfilter=camel

You will need to point Maven to the repo http://repo.fusesource.com/nexus/content/groups/public/


Once you have your bundle you will want to deploy it.  The archetype mentioned above will use maven plugins described below to build you a bundle.  Once you have build it using $ mvn install the artifact will reside in your local .m2 directory.  Fuse by default knows about this location so you are now able to instruct Fuse to install your bundle.  There is a readme that will explain all this and the steps you should take.  Very quickly you should be able to have a running bundle in Fuse.

Examples

There are a number of quickstarts that get overlooked in the Fuse distribution.  These quickstarts cover general EIPs, WebServices, JMS and error handling.  There is also the FuseByExample GitHib repository.

https://github.com/jboss-fuse/quickstarts
https://github.com/FuseByExample


Where to find help

I've broken down the core components that make up the Fuse distribution...

Camel - Integration framework and implementation of the EIP book mentioned above.  For me the best way to understand how a camel component works is to look at the unit tests.  All code can be cloned from GitHub.

ActiveMQ - The message broker and backbone of the ESB.

CXF - WebService implementation in Fuse.

Karaf OSGi runtime and console.  There are also a number of Maven plugins that help with the generation of offline repositories and describing features for provisioning.  These plugins can work together to enable Continuous Delivery.  More on this in a future post.

Provisioning
Generating offline repositories
Creating features


Felix Apache Implementation of the OSGi spec

The following plugin is essential to building OSGi bundles that can be easily described in a feature or deployed directly into Karaf.  There is a lot of information here and its extremely useful.  If you have a number on non OSGi-ified bundles that you need to deploy and encapsulate then look at building an uber jar using the embed dependency option in this plugin.  This style is used to wrap these non OSGi bundles, expose their packages to the uber bundle classpath and control what is exported or registered services.

Maven bundle plugin

Aries / Blueprint -  Implementation of the Enterprise OSGi spec including Web container, Transaction, JNDI and JPA.

Dependency injection in Fuse
Camel route testing


Fabric - This is my personal favourite component of Fuse.  Being able to manage all configurations, containers, logs, features and brokers backed by a highly available distributed registry using command line, scripts or hawt web consoles is pretty cool.

View Docs - Fuse
Deploying into the container


Hawtio - What happens inside an ESB?  This is sometimes the hardest area when adopting a new technology, enabling and empowering developers, test and support teams.  From JBoss Fuse 6.0 there is a new webconsole called hawtio.  The aim is to consolidate the various consoles available to manage queues, configuration, view logs, camel routes trace / debug messages and much more.  With 6.1 hawtio also includes the Fuse Management Console and ties into Fabric.  This now provides us with the ability to search across our entire Fabric (cluster)

Demo link from the hawtio site

Forums

If you're struggling and considering that workaround that you know you will be ridiculed for then ask the community.  This is one of the main reasons that Fuse is such an awesome technology... because it's backed by a community that wants to help others.

JBoss Fuse
Camel mailing list 
Search the old Fusesource website

IRC

This is a great way to communicate and interact with the communities.  Below are a list of channels that are useful.

irc.freenode.net
#hawtio
#fusefabric
#fusesource