Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

JBoss Fuse - Fuse workshop EAP container


Published on

JBoss Fuse allow you to have flexibility to deploy your Camel application on two most popular java container standards, OSGi and JavaEE, this workshop walks you through how to develop your application on JBoss EAP

Published in: Technology
  • Be the first to comment

JBoss Fuse - Fuse workshop EAP container

  1. 1. JBoss Fuse Running on EAP Christina Lin JBoss Technology Evangelist
  2. 2. RED HAT CONFIDENTIAL | ADD NAME2 Containers, What do we have? OSGi Container Blueprint AriesSpring Features Features Features
  3. 3. RED HAT CONFIDENTIAL | ADD NAME3 Another Option – on EAP JavaEE Container Spring CDI subsystem component component component component component
  4. 4. RED HAT CONFIDENTIAL | ADD NAME4 Two step to make your FUSE ready JBoss EAP Step 1. Install JBoss EAP JBoss Fuse fuse-eap-installer-6.2.1.redhat-xxx.jar Step 2. Patch camel subsystem java -jar fuse-eap-installer-6.2.1.redhat-xxx.jar location_of_EAP
  5. 5. RED HAT CONFIDENTIAL | ADD NAME5 Fuse Ready EAP JBoss EAP Standalone standalone-camel.xml standalone-full-camel.xml Domain domain-camel.xml Modules Fuse SOA
  6. 6. RED HAT CONFIDENTIAL | ADD NAME6 Subsystem <jboss umlns="urn:jboss:1.0"> <jboss-camel xmlns="urn:jboss:jboss-camel:1.0”> <component name="camel-cxf"/> <component-module name="org.apache.camel.component.rss"/> </jboss-camel> </jboss> XML ConfigurationCamel Route (Static Camel) Component Component Modules META-INF/ jboss-all.xml WEB-INF/ jboss-all.xml
  7. 7. RED HAT CONFIDENTIAL | ADD NAME7 Managing Camel in EAP JBoss EAP Fuse App Fuse App Fuse App JMX Hawtio http://YOUR_IP:8080/hawtio
  8. 8. RED HAT CONFIDENTIAL | ADD NAME8 Creating Camel Application on EAP - Repositories Fuse Repository JBoss Repository Setting.xml <repository> <id></id> <name>Fuse Release Repository</name> <url> content/repositories/releases</url> ……. </repository> <repository> <id>jboss-public-repository</id> <url> content/repositories/public/</url> ……. </repository>
  9. 9. RED HAT CONFIDENTIAL | ADD NAME9 Creating Camel Application on EAP Spring Context CDI Context Camel Route Context
  10. 10. RED HAT CONFIDENTIAL | ADD NAME10 Spring Context WAR Create using archetype wildfly-camel-archetype-spring pom.xml maven dependency camel-core META-INF Camel Route Spring Context *-camel-context.xml
  11. 11. RED HAT CONFIDENTIAL | ADD NAME11 CDI Context WAR Create using archetype wildfly-camel-archetype-cdi pom.xml maven dependency •  camel-core •  camel-cdi java/src Camel Route Java DSL •  extend RouteBuilder.class •  @Startup •  @ApplicationScope •  @ContextName(“cdi-context”) WEB-INF beans.xml
  12. 12. RED HAT CONFIDENTIAL | ADD NAME12 Camel Context WAR Create using archetype Any WAR archetype pom.xml maven dependency •  camel-core •  camel-servletlistener resource WEB-INF/web.xml •  Listener •  org.apache.camel.component.s ervletlistener.JndiCamelServlet ContextListener •  routeBuilder-MyRoute •  classpath:myfisrtcamel.xml •  Name •  MyCamel Camel Context Same as routeBuilder
  13. 13. RED HAT CONFIDENTIAL | ADD NAME13 Setup Servlet Endpoint in EAP JBoss EAP Servlet ONLY WEB-INF/web.xml <servlet>                  <servlet-­‐name>camel</servlet-­‐name>                  <servlet-­‐class>org.apache.camel.component.servlet.CamelH7pTransportServlet</servlet-­‐ class>                  <load-­‐on-­‐startup>1</load-­‐on-­‐startup>       </servlet>       <servlet-­‐mapping>                  <servlet-­‐name>camel</servlet-­‐name>                <url-­‐pa7ern>/services/*</url-­‐pa7ern>       </servlet-­‐mapping>   Camel App servlet:/currencies?servletName=camel
  14. 14. RED HAT CONFIDENTIAL | ADD NAME14 Look up DataSource in Camel JBoss EAP Spring Context Register in Camel Context <bean  id="currencyconvertor"   class="com.redhat.demo01.CurrencyConvertor"/>   CDI Context Register in CDI context @Named(”xxName")   Class  xxClass{…}   Camel Context Register bean by implementing CamelContextLifecycle registry.bind("currencyconvertor",currencyConvertor);  
  15. 15. RED HAT CONFIDENTIAL | ADD NAME15 Referencing Java Bean JBoss EAP DataSource Spring Context Lookup JNDI <jee:jndi-­‐lookup  id=“xx”  jndi-­‐name=“java:jboss/xx/xx”>   CDI Context Inject Data Source from JNDI to CDI context @Resource(lookup=“java:jboss:/xx/xx”)   @Produces   Camel Context Lookup JNDI in component
  16. 16. RED HAT CONFIDENTIAL | ADD NAME16 Deploying Fuse Application Camel Application JBoss EAP Console FolderCommand Line
  17. 17. RED HAT CONFIDENTIAL | ADD NAME17 JBoss on EAP Exercise