SlideShare a Scribd company logo
 
Fuse Technology Presentation
Charles Moulliard (@cmoulliard)
Agenda
What is Fuse Technology
Integration Platform
Routing & Mediation : Apache Camel, CXF
Modular Container : Apache Karaf
Management & Provisioning : Fabric8, Hawtio
Security Policy Management : ApiMan, Keycloak
Demo
Who
Principal Solution Architect & Fuse Expert
Blog:
Twitter: @cmoulliard
Email:
Committer on Apache Camel, Karaf, Fabric8, Hawtio … & PMC
Technology evangelist
Mountain Biker, Blogger
http://cmoulliard.github.io
cmoulliard@redhat.com
Long History behind Fuse
Fuse Integration Technology
Integration platform
Manage Complex use cases
correlation, orchestration, routing,
mediation, transformation
Provide BUS exchange
messages
Designed around different specs:
JBI, SCA
 
 

ESB & JBI
Services & Components
communicate using NMR
bus
Packaged as zip (=SU) in a
big zip (=SA) including xml
config, target service
Constraint : messages
formated as XML
    EIP not included in the
spec

Apache Camel
Java Integration Framework
Implements Domain Specific Language
Supports Enterprise Integration Patterns

Enterprise Patterns
implemented
and more : Loadbalancer, Throttler, Delayer, …
> 50 patterns
Key concepts
Component
Endpoint
Consumer
Producer
Route, processor
Camel project Collection of routes
Route Processor(s) + Interceptor(s)
Producing or consuming Messages/Exchanges


Interceptor
To trace, log, capture business events
Convert Type
Type Converter Strategy
Allow to convert the body payloads from one
type to another
To and From these types
File
String
byte[] and ByteBuffer
InputStream and OutputStream
Reader and Writer
Data Format
Data Transformation for complex use case
Marshalling : Object XML (JAXB)
Unmarshalling : XML Object (JAXB)
packagemy.cool.demo;
importjava.io.InputStream;
importjava.io.OutputStream;
importorg.apache.camel.Exchange;
publicinterfaceDataFormat{
voidmarshal(Exchangeexchange,Objectgraph,OutputStreamstream)throwsException;
Objectunmarshal(Exchangeexchange,InputStreamstream)throwsException;
}


Data Format supported
> 20 Data Format
Components
Fire / Forget pattern
Request / Reply pattern
How To
Pattern
Result
from("activemq:queue:quotes"")
.choice()
.when().xpath("/quotes/product='widget'")
.to("direct:b")
.when().xpath("/quotes/product='gadget'")
.to("direct:c");
How To
How To
How To
How To
How To
publicvoidconfigure()throwsException{
EndpointA=endpoint("activemq:queue:all");
EndpointB=endpoint("activemq:widget");
PredicateisWidget=xpath("/quote/product='widget'");
from(A).filter(isWidget).toB);
}
Java DSL
Fluent API
importorg.apache.camel.builder.RouterBuilder;
publicclassFilterRouteextendsRouteBuilder{
publicvoidconfigure()throwsException{
EndpointA=endpoint("activemq:queue:all");
EndpointB=endpoint("activemq:widget");
PredicateisWidget=xpath("/quote/product='widget'");
from(A).filter(isWidget).to(B);
}
}
XML DSL
Spring, Blueprint
<?xmlversion="1.0"encoding="UTF-8"?>
<beansxmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsd
http://camel.apache.org/schema/springhttp://camel.apache.org/schema/spring/camel-spring.xsd
">
<beanid="quotesService"class="my.cool.demo.camel.QuotesService"/>"
<camelContext xmlns="http://camel.apache.org/schema/spring">
<route>
<fromuri="activemq:queue:all"/>
<filter>
<xpath>"/quote/product/='widget"</xpath>
<beanid="quotesService"method="widget"/>
</filter>
</route>
</camelContext>
Container
Routes/Endpoints
registered CamelContext
Policy
Security
Lifecycle
Tracing
JMX
Threads can be configured

Communication
Cross
communication
not allowed
between
context
Communication
Facts
In-Memory bus
Support Object : XML, File, Stream, Bytes
Predicate & Expression language (xslt, xpath, …)
Sync/Async exchanges
Threads Management
Tx Architecture
Error & Exception handling
Policy driven
Container Agnostic
Apache Karaf
Java OSGI Runtime
Offer modularity for Integration
Multi-Technology platform
Architecture
Technology     Camel, CXF, ActiveMQ, Spring, Fabric, …
Modular platform     deploy or remove container/libraries


Core features
SSH server
Allow to administrate/create instances
Provide provisioning solution features
Hot deployment
Configure & manage instances
JAAS Security layer
Role Base Access Control (RBAC)
Integration container
Camel routes isolated from each other (classloader)
Bundle CamelContext boundary acting as a Local BUS
Camel routes can have different SLA (Threads, Policies, …)
 

Integration container
Camel routes can be started/stopped/updated
Simplify maintenance process
Integration container
New routes can be hot deployed
Like also "Beans/POJO, Web Services, …"
(Cloud) Deployment
Fabric8 v1
Opensource integration project -
Mission simplify management & deployment java integration services on
different machines & JVMs
http://fabric8.io

Features
Manage container creation (locally, remotely, cloud, openshift, docker, …)
Visualise what is running into JVM to understand your platform
Monitor whats running and easily scaling up or down
Support Upgrade via Version changes and Rollback
Virtualize services (endpoints), processes
Search and storage engine for logs, camel, messages, metrics
Karaf limitations
Karaf can create new instances
(locally) & administrate them (locally
or remotely)
Instances are not cloned
Configurations must be managed (manually, script)
Fabric extends the possibilities
Coordinating System : Zoo
Rely on Zookeeper server (ensemble of 1,3, 5 or servers)
Coordinating distributed systems in a reliable way (electing leaders,
implementing master/slave, sharding or federation of services).
 
Fabric Agents
Are the clients of the Zookeeper server(s)
They will communicate with Zk server to :
register container info (ports, services, endpoints, processes)
get their provisioning


Profiles
Behavior of a container
Envelope(s) containing artifacts to be deployed, parameters (system, jvm,
services) to be configured
Can be versioned, facilitate mngt - rollback
Virtualization & Load balancing
Goal Create virtual endpoints, to scale services (WS/REST, A-MQ)
New topologies
New topologies (Replicated - LevelDB storage, NPlus1),
Broker discovery
Metrics
Fabric Insight Technology    
NoSQL storage for JSon documents
Based on ElasticSearch

Dashboard
Kibana is the web front end
Full Text Search features    
Info collected
Logs, Camel metrics, JMX metrics, your own
data/JSON metrics
importorg.apache.camel.Header;
importorg.fusesource.insight.storage.StorageService;
importjava.sql.Timestamp;
importjava.util.Date;
publicclassStoreService{
privatestaticStringES_TYPE="insight-tweet";
privatestaticStorageServicestorageService;
publicstaticvoidstore(@Header("tweet-full")Stringdata){
storageService.store(ES_TYPE,generateTimeStamp(),data);
}
Analyzed using kibana
Insight Camel
Hawt.io
OpenSource project - Apache License
Pluggable & modular web console for managing Java MBeans
JMX Tools
JConsole, VisualVM
Developers tool ( )
Proprietary comprotocol
(RMI/IIOP)
Command line tools jmxclient, jmxterm, mx4j
Not so user friendly :




Jolokia ?
Command line tools jmx4perl, j4psh
JMX / HTTP Bridge
REST API : read attributes, execute
operations


Modern HTML5 Architecture
Hawtio = A combination of the most powerful web technologies
Front end : HTML5 with AngularJS & JSON / REST
Backend : Java Servlet & Jolokia JMX gateway
   
Communication …
Web client communicates to Jolokia agent over HTTP(S)
Send Messages represented in JSON Format to Jolokia REST Servlet
Jolokia translates the request/response & map the JSON payload with JMX
Calls
Domain
JMX Domain / context
java.lang,
com.sun.management,
java.util
org.apache.camel
io.hawt
…
Attributes & operations
Plugin
What is a plugin ?
Collection of UI
JSON
request(s)/response(s)
JS lib to do the
rendering

Plugin Front
Mix of HTML tags & angular directives ng-*
Angular ng-controller defined within HTML <div> tag
<divclass="row-fluid"ng-controller="Tomcat.TomcatController">
<divclass="row-fluid">
<divclass="pull-left">
<formclass="form-inlineno-bottom-margin">
<fieldset>
<divclass="controlscontrol-groupinline-blockcontrols-row">
<divclass="btn-group">
<buttonng-disabled="selected.length==0"class="btn"ng-click="start()"title="Start"
class="icon-play-circle"></i></button>
<buttonng-disabled="selected.length==0"class="btn"ng-click="stop()"title="Stop">
class="icon-off"></i></button>
<buttonng-disabled="selected.length==0"class="btn"ng-click="reload()"title="Refresh"
class="icon-refresh"></i></button>
<buttonng-disabled="selected.length==0"class="btn"ng-click="uninstallDialog.open()"
class="icon-eject"></i></button>
</div>
</div>
</fieldset>
</form>
1
1
Plugin Controller
Map HTTP request with applicationsHTML page
Idem for the connectorspage
moduleTomcat{
varpluginName='tomcat';
exportvar_module=angular.module(pluginName,['bootstrap','ngResource','ui.bootstrap.dialog',
_module.config(["$routeProvider",($routeProvider)=>{
$routeProvider.
when('/tomcat/server',{templateUrl:'app/tomcat/html/server.html'}).
when('/tomcat/apps',{templateUrl:'app/tomcat/html/apps.html'}).
when('/tomcat/connectors',{templateUrl:'app/tomcat/html/connectors.html'}).
when('/tomcat/sessions',{templateUrl:'app/tomcat/html/sessions.html'});
}]);
1
2
1
2
Jolokia Request
Javascript function called to execute a GET request of type execor read
Mbean & Attributes OR Operation are passed as parameters
onSuccess calls function for the rendering
jolokia.request({
type:'exec',
mbean:id,
operation:op,
arguments:null
},
onSuccess($scope.onResponse,{error:$scope.onResponse}));
Jolokia Search
Search operation is supported
Find MBeans according to a search querybased on the type of the MBean
to find
A search query to find the type Connector
Anoter search query for mbeans based on the type
"*:j2eeType=WebModule,*"
functionloadData(){
varconnectors=jolokia.search("*:type=Connector,*");
if(connectors){
varfound=false;
angular.forEach(connectors,function(key,value){
varmbean=key;
if(!found){
vardata=jolokia.request({type:"read",mbean:mbean,attribute:["port","scheme","protocol"
...
jolokia.search("*:j2eeType=WebModule,*",onSuccess(render));
}
1
2
1
2
Jolokia Response
Response rendered & parsed
JSON result mapped with angular objects $scope.*
functionrender(response){
response=Tomcat.filerTomcatOrCatalina(response);
$scope.webapps=[];
$scope.mbeanIndex={};
$scope.selected.length=0;
functiononAttributes(response){
varobj=response.value;
if(obj){
obj.mbean=response.request.mbean;
varmbean=obj.mbean;
//computetheurlforthewebapp,andwewanttousehttpasscheme
varhostname=Core.extractTargetUrl($location,$scope.httpScheme,$scope.httpPort);
obj.url=hostname+obj['path'];
1
2
1
2
Plugins
Plug-an-play architecture ( > 25 plugins )
UI updated in real time
Some are Packaged : jvm, threads, dashboard, camel, activemq, …
Some are Server side : git, maven, aether, log
Some are External : insight, elasticsearch, kibana
Reusable for developers (branding, datatable, forms, ide, perspective, tree,
ui)
What Front looks like
Discover your camel routes
Manage your brokers
Integration & Mediation Platform
> 100 components : file, jms, ftp, …
> 50 EIP Patterns : content based router, splitter, aggregator, …
Messaging Broker Platform
Support : JMS, AMQP, MQTT, STOMP, Websocket
iPaas (Openshift cartridges - v2)
Broker Architecture
Point-to-Point Messaging
Producer sends message(s) to queue using JMS API
Consumer listens for message(s) from queue
Messages stored until read or expired
Messages can be persisted, are read only once
Load Balancing
Workload can be distributed between connected clients
Round-robin algorithm used
Publish and Subscribe
Client sends message to topic
Broker sends message to all currently connected subscribers
Messages are consumed x times (1-to-many)
Durable Subscriber
Messages usually expire when subscriber(s) not connected
Supports connection/disconnection
DurableSubscriberproperty = unique client ID registered to broker
Subscriber client ID controls messages delivered to broker
Request/Reply
Producer sets 2 properties to send message
JMSReplyTo: Destination for response message
JMSCorrelationID: Unique ID matches/correlates messages
(request/response)
Consumer replies to JMSReplyTodestination using JMSCorrelationIDin
message
Network of Brokers
Created when one broker establishes network connection to another broker:
Supports multiple connectors
To define as bi-directional, use duplex=true:
Big picture
Future - Fuse 7
Fabric8 - V2
More integrated Openshift v3, Kubernetes & Docker
Service Management & Governance : ApiMan
OAuth2 Server, IDM : KeyCloak

JBoss Fuse in action
DEMO
Design REST Service using Camel
Deploy on JBoss Fuse using a profile
Create container & expose REST Service using Fabric
Define Security Policy for the endpoint
Authenticate the user (BASIC - static realm)
Authorize using Oauth2
Rest DSL in Action :
Camel & Mobile :

https://github.com/FuseByExample/rest-dsl-in-action
https://github.com/cmoulliard/feedhenry-camel
Questions
Twitter :
More info
www.jboss.org/products/fuse.html
@cmoulliard

http://www.redhat.com/en/technologies/jboss-middleware

More Related Content

Fuse technology-2015