Riding a Camel through the JEEHara -...

80
Riding a Camel through the JEEHara Markus Eisele, @myfear Developer Advocate [email protected] October, 2015

Transcript of Riding a Camel through the JEEHara -...

Page 1: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

Riding a Camel through the JEEHara

Markus Eisele, @myfearDeveloper [email protected], 2015

Page 2: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a
Page 3: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a
Page 4: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a
Page 5: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

Gregor Hohpe (@ghohpe) and Bobby Wolf

Page 6: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

camel.apache.org/eip

Page 7: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

Why Camel?

Page 8: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

Service Bus Messaging Data Virt

Legacy App Legacy App Data

App

Mic

ros

erv

ice

Mic

ros

erv

ice

Mic

ros

erv

ice

Mic

ros

erv

ice

Mic

ros

erv

ice

Legacy AppLegacy App Legacy App

App

App

App

App

Page 9: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

1

1) More Services Produced- Legacy Apps- Newly Designed- Infrastructure Level

- Different Protocols- Custom and Standard Apps

Page 10: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

2

2) More Services Consumed- More Apps- Decentralized- Chained Services

- Lightweight Connectors- Standardized Protocols- EAI Problems move to

apps- Monitoring- Distributed Responsibility

Page 11: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

Easy & Lightweight

Applications are done by Developers. So, pleeeeaaasssseee ...

Page 12: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

Therefore Camel!

Page 13: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

• Open source integration library

• Simple lightweight, use in any JVM or application

server

• Can be programmed and not sketched

• Connects to anything

• 100s of components connecting to databases, file

systems, messaging systems, big data, SaaS

providers, social media, ...

• Tooling

Page 14: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

How? Show me!

Page 15: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a
Page 16: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

package org.javaee.why;

import javax.annotation.Resource;import javax.ejb.MessageDriven;import javax.jms.Connection;import javax.jms.ConnectionFactory;import javax.jms.DeliveryMode;import javax.jms.JMSException;import javax.jms.Message;import javax.jms.MessageListener;import javax.jms.MessageProducer;import javax.jms.Queue;import javax.jms.Session;import javax.jms.TextMessage;

@MessageDrivenpublic class SortOrdersBean implements MessageListener {

@Resourceprivate ConnectionFactory connectionFactory;

@Resource(name = “WidgetQueue")private Queue widget;

@Resource(name = “TheRestQueue")private Queue theRest

public void onMessage(Message message) {try {

final TextMessage order = (TextMessage) message;final String type = order.getText();

if (“widget".equals(type)) {

respond("widget", message);} else {

respond("rest", message);}

} catch (JMSException e) {throw new IllegalStateException(e);

}}

private void respond(String type, Message message) throws JMSException {

Connection connection = null;Session session = null;

try {connection = connectionFactory.createConnection();connection.start();

// Create a Sessionsession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

// Create a MessageProducer from the Session to the Topic or QueueMessageProducer producer = session.createProducer(widget);producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);

// Create a messageTextMessage message = session.createTextMessage(text);

// Tell the producer to send the messageproducer.send(message);

} finally {// Clean upif (session != null) session.close();if (connection != null) connection.close();

}}

}

• It’s Java EE 6 (7 is simpler)

• Where’s my routing logic?

• Introspecting messages

• .

• .

• .

• Sigh.

Page 17: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

from newOrderchoice

Page 18: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

from newOrderchoice

when isWidget to widget

Page 19: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

from newOrderchoice

when isWidget to widgetotherwise to theRest

Page 20: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

from (newOrder)choice

when (isWidget) to (widget)otherwise to (theRest)

Page 21: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

from (newOrder).choice()

.when(isWidget).to(widget)

.otherwise().to(theRest);

Page 22: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

from (newOrder).choice()

.when(isWidget).to(widget)

.otherwise().to(theRest);.end();

Endpoint newOrder = endpoint(“jms:incomming");Predicate isWidget = xpath("/order/product/type = 'widget'");Endpoint widget = endpoint(“jms:widget");Endpoint gadget = endpoint(“jms:theRest");

Page 23: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

import org.apache.camel.Endpoint;import org.apache.camel.Predicate;import org.apache.camel.builder.RouteBuilder;

public class MyRoute extends RouteBuilder {

public void configure() throws Exception {Endpoint newOrder = endpoint(“jms:incomming");Predicate isWidget = xpath("/order/product/type = 'widget'");Endpoint widget = endpoint(“jms:widget");Endpoint gadget = endpoint(“jms:theRest");

from(newOrder).choice().when(isWidget).to(widget).otherwise().to(theRest)

.end();}

}

Ja

va

co

de

Page 24: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

Coool!

Page 25: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

import org.apache.camel.builder.RouteBuilder;

public class MyRoute extends RouteBuilder {

public void configure() throws Exception {

from("jms:incomming").choice().when(xpath("/order/product/type = 'widget'"))

.to("jms:widget").otherwise().to("jms:theRest")

.end();}

}

Ja

va

DS

L

Page 26: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

<route><from uri="jms:newOrder" /><choice>

<when><xpath>/order/product/type='widget'</xpath><to uri="jms:widget"/>

</when><otherwise>

<to uri="jms:theRest"/></otherwise>

</choice></route>

XM

L D

SL

Page 27: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

Gro

ov

y D

SL

import org.apache.camel.builder.RouteBuilder;

public class MyRoute extends RouteBuilder {

public void configure() throws Exception {

from("jms:incomming").choice()

.when({ it.in.header('zipcode') ==~ /\d+/ }).to("jms:widget")

.otherwise().to("jms:theRest")}

}

Page 28: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

Sc

ala

DS

L class FilterRoute {def createMyFilterRoute = new RouteBuilder {

from("direct:start").filter(_.in("gold") == "true").to("mock:gold")

}}

Page 29: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

import org.apache.camel.builder.RouteBuilder;

public class MyRoute extends RouteBuilder {

public void configure() throws Exception {

from("file:inbox/orders?delete=true").choice().when(xpath("/order/product/type = 'widget'"))

.to("jms:widget").otherwise().to("jms:theRest")

.end();}

}

Co

nfi

gu

re E

nd

po

ints

as

UR

Is

Page 30: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a
Page 31: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

http://camel.apache.org/component.html

150+ Components

Page 32: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

http://fineartamerica.com/featured/apache-camel-components-poster-gliesian-llc.html

Page 33: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

rest("/user").description("User rest service").consumes("application/json").produces("application/json")

.get("/{id}").description("Find user by id").outType(User.class).to("bean:userService?method=getUser(${header.id})")

.put().description("Updates or create a user").type(User.class).to("bean:userService?method=updateUser")

.get("/findAll").description("Find all users").outTypeList(User.class).to("bean:userService?method=listUsers");

Page 34: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

http://blog.eisele.net/2014/12/camel-on-java-ee-7-rest-services-swagger-api-doc.html

Page 35: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

http://camel.apache.org/data-format.html

19 Data Formats

Page 36: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

// JSON Data Format// lets turn Object messages into json (Xstream) then send to MQSeriesfrom("activemq:My.Queue").marshal().json().to("mqseries:Another.Queue");

/** Alternative Librariesmarshal().json(JsonLibrary.Jackson)marshal().json(JsonLibrary.Gson).

**/

// Camel RSS Data Format// only entries with Camel in the title will get through the filterfrom("rss:file:src/test/data/rss20.xml?splitEntries=true&consumer.delay=100")

.marshal()

.rss()

.filter().xpath("//item/title[contains(.,'Camel')]").to("mock:result");

Page 37: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

http://camel.apache.org/languages.html

15 Expression Languages

Page 38: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

// lets route if a line item is over $100from("queue:foo").filter(groovy("request.lineItems.any { i -> i.value > 100 }")).to("queue:bar")

// route exchanges from admin users to a special queue.from("direct:start")

.choice().when().javaScript("request.headers.get(&#39;user&#39;) == &#39;admin&#39;").to("seda:adminQueue")

.otherwise().to("seda:regularQueue");

Page 39: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

Wow!

Page 40: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

• Integration Framework• Enterprise Integration Patterns (EIP)• Routing DSLs• Endpoint as URIs• Just Java or XML code (or even more)• No Container Dependency• A hell lot of ready made components• Expressions and Date-Formats

Page 41: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

FTW!

Page 42: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

Deploying Camel

Page 43: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

camel-core.jar = 2.8 MB!

Page 44: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

• Deployment Options• Standalone• Spring• Java EE• OSGi

Page 45: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

• Containers• Apache ActiveMQ• Apache Karaf• Apache ServiceMix• Apache Tomcat• Fabric8• JBoss AS / WildFly• JBoss Fuse• JBoss Fuse Service Works• Jetty• WebLogic• Glassfish • WebSphere

Page 46: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

Camel & Java EE

Page 47: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

@Singleton@Startuppublic class Bootstrap {

@InjectCdiCamelContext context;

@PostConstructpublic void init() {

// create routes

// Start Camel Contextcontext.start();

}

@PreDestroypublic void shutdown() {

// Graceful Shutdown Camel Contextcontext.stop();

}

http://blog.eisele.net/2014/08/bootstrapping-apache-camel-in-java-ee7.html

#1

Ca

me

l CD

I

Page 48: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

• Not all components are working as expected• Deployment gets really large• Easy to run into classloading issues

Ke

ep

in M

ind

!

Page 49: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

#2

Cu

sto

m M

od

ule

https://sourcevirtues.wordpress.com/2013/11/25/add-apache-camel-and-spring-as-jboss-module-in-wildfly/

• Create a Spring Module• Create a Camel Module

Page 50: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

• The module dependencies have to be correct.• Need to reference modules from

jboss-deployment-structure.xml• No pre-build list / no support

Ke

ep

in M

ind

!

Page 51: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

#3

Ca

me

l Su

bsy

ste

m

https://github.com/wildfly-extras/wildfly-camel

• Simply apply the wildfly-camel-patch to a compatible wildfly version

• wildflyext/wildfly-camel docker distribution

Page 52: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

@Startup@ApplicationScoped@ContextName("jms-camel-context")public class JmsRouteBuilder extends RouteBuilder {

@Resource(mappedName = "java:jboss/DefaultJMSConnectionFactory")private ConnectionFactory connectionFactory;

@Overridepublic void configure() throws Exception {JmsComponent component = new JmsComponent();component.setConnectionFactory(connectionFactory);

getContext().addComponent("jms", component);

from("timer://sendJMSMessage?fixedRate=true&period=10000").transform(constant("<?xml version='1.0><message><greeting>hello

world</greeting></message>")).to("jms:queue:WildFlyCamelQueue").log("JMS Message sent");

}}

Page 53: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

• Not all components contained so far• Still under development• Growing component base

http://wildflyext.gitbooks.io/wildfly-camel/content/

Ke

ep

in M

ind

!

Page 54: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

Camel and JavaEE

are awesome!

Page 55: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a
Page 56: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

What users are telling us

Page 57: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

• Camel rocks in development• very easy to get started and create small projects

• can I have more tooling?• need help scaling to 1000s of services and • need help moving integration solutions through

Deployment pipeline

Page 58: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

Something is missing

Page 59: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a
Page 60: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

http://fabric8.io/

Page 61: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

• an open source integration platform

• designed to make it easy to deploy, manage and scale

integration solutions

• helps move integration solutions from

dev -> test -> prod

Page 62: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

What does it do?

Page 63: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

• provision, configure and manage services

• perform incremental and rolling upgrades of

changes

• discovery and load balancing of services

• elastic scaling of services

Page 64: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

How does that look like?

Page 65: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

• Implemented with Zookeeper and git

• Intended to be used with a dynamic JVM/Apache Karaf

• Profiles store configuration, metadata, end-state deployments

• Networking, JVM isolation, orchestration, auto-scaling, health checks, cloud deployments: all up to you

Fabric8 V1.x

Page 66: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

• Registry

• Where configs are stored, everything centrally managed

• Profiles

• Description of end-state deployment of a server

• Agent

• Listens on the server that can respond to registry changes/profile updates

Fabric8 V1.x

Page 67: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

CamelApp

Configuration

Fabric8

Instance 1 App SpecConf

Instance 2 App SpecConf

Instance 3 App SpecConf

Instance 4 App SpecConf

Instance … App SpecConf

Instance n App SpecConf

Profile

DeveloperPC

Networking

Orchestration

Auto-Scaling

Health Checks

Console

Maven

Versioning

Deployment

Distribution

Page 68: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

• Implemented with Docker and Kubernetes

• Use any JVM (or any technology)

• Docker images, encourage static, well-defined, well-tested deployments

• Provides networking, JVM isolation, orchestration, auto-scaling, health checks, cloud deployments

• Still in community!

• Will support OpenShift v3

Fabric8 V2

Page 69: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

V1 vs. V2• Profiles

• Runtime Registry

• Configuration

Repository

• Tooling

• Profiles

• Docker

• Kubernetes

• PODs

• Labels

• Services

• Apps

• App Zips

• Builds

Page 70: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

http://camel.apache.org/download.html

http://www.jboss.org/products/devstudio/overview/

Do

wn

loa

d a

nd

inst

all

http://fabric8.io/v2/

Page 71: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a
Page 72: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

Wanna know more ?

Page 73: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

http://camel.apache.org/examples

Page 74: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a
Page 75: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

http://camel.apache.org/mailing-lists.html

http://stackoverflow.com/questions/tagged/apache-camel

http://camel.apache.org/irc-room.html

http://fabric8.io/v2/

Page 76: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

What else ?

Page 77: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

http://camel.apache.org/commercial-camel-offerings.html

+

Page 78: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

http://bit.ly/virtualJBUG

@vJBUG

Page 79: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a

http://developers.redhat.com/promotions/distributed-javaee-architecture

Page 80: Riding a Camel through the JEEHara - Huihoodocs.huihoo.com/.../2015/CON1715-Riding-a-Camel-Through-the-JEE… · Riding a Camel through the JEEHara Markus Eisele, ... // Create a