JBoss Fuse 101
Getting Started workshop
Christina Lin
JBoss Technology Evangelist
clin@redhat.com
RED HAT CONFIDENTIAL | ADD NAME2
Message Transformation
RED HAT CONFIDENTIAL | ADD NAME3
Message Transformation
Format / Type
Transformation
Metadata update
Message Content
enrichment/reduction
RED HAT CONFIDENTIAL | ADD NAME4
Data Transformation
XML
CSV
JSON
POJO
Transform
Marshal/Unmarshal
Processor
Bean
Format
FileString
Text
Date
Type
RED HAT CONFIDENTIAL | ADD NAME5
Marshal
Component Component
XML
CVS
JSON
POJO
RED HAT CONFIDENTIAL | ADD NAME6
Marshal
<marshal>
<xmljson/>
</marshal>
<marshal>
<jaxb partClass=“example.TradeOrder”
contextPath=“example"/>
</marshal>
<marshal>
<bindy classtype=”example.Product" type="Csv">
</marshal>
<marshal>
<serialization/>
</marshal>
RED HAT CONFIDENTIAL | ADD NAME7
Unmarshal
Component Component
XML
CVS
JSON
POJO
RED HAT CONFIDENTIAL | ADD NAME8
Unmarshal
<unmarshal>
<xmljson/>
</unmarshal>
<unmarshal>
<jaxb partClass=“example.TradeOrder”
contextPath=“example"/>
</unmarshal>
<unmarshal>
<bindy classtype=”example.Product" type="Csv">
</unmarshal>
<unmarshal>
<serialization/>
</unmarshal>
RED HAT CONFIDENTIAL | ADD NAME9
Transform
Constant
xquery
simple
javascript
Expression
<constant>Harry Potter</constant>
<xquery>
For $/bookstore/book
where $x/price>30
return $x/title
</xquery>
<simple> <books>${in.body} <books>
</simple>
<javaScript>
request.body.toLowerCase()
</javaScript>
RED HAT CONFIDENTIAL | ADD NAME10
Processor
package org.blogdemo.transformation;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
public class DataProcessor implements Processor {
@Override
public void process(Exchange exchange) throws Exception {
String incomingData = exchange.getIn().getBody(String.class);
incomingData = "Hello"+incomingData;
exchange.getIn().setBody(incomingData);
}
}
Processor
RED HAT CONFIDENTIAL | ADD NAME11
Processor
<bean id="DataProcessor" class="org.blogdemo.transformation.DataProcessor"/>
<camelContext trace="false" id="blueprintContext"
xmlns="http://camel.apache.org/schema/blueprint">
<route>
<from uri="file://somewhere?delete=true"/>
<process ref="DataProcessor"/>
<to uri="file://elsewhere"/>
</route>
</camelContext> Calling processor
RED HAT CONFIDENTIAL | ADD NAME12
Bean
package org.blogdemo.transformation;
public class ConvertBean {
public static String addHello(String inputContent) {
return "Hellp "+inputContent;
}
}
<bean id="ConvertBean" class="org.blogdemo.transformation.ConvertBean"/>
<camelContext trace="false" id="blueprintContext"
xmlns="http://camel.apache.org/schema/blueprint">
<route>
<from uri="file://somewhere?delete=true"/>
<bean method="addHello" ref="ConvertBean"/>
<to uri="file://elsewhere"/>
</route>
</camelContext>
Calling bean
RED HAT CONFIDENTIAL | ADD NAME13
Bean
RED HAT CONFIDENTIAL | ADD NAME14
META DATA Update
Body
Header
Change or remove
properties here
RED HAT CONFIDENTIAL | ADD NAME15
Message content enrichment
Content Enricher
Resequencer
Claim Check
Content Filter
Normalizer
RED HAT CONFIDENTIAL | ADD NAME16
My 2nd Camel Ride
Stock
purchase
XML
JSON
POJO
Another
Vendor

JBoss Fuse Workshop 101 part 2

  • 1.
    JBoss Fuse 101 GettingStarted workshop Christina Lin JBoss Technology Evangelist clin@redhat.com
  • 2.
    RED HAT CONFIDENTIAL| ADD NAME2 Message Transformation
  • 3.
    RED HAT CONFIDENTIAL| ADD NAME3 Message Transformation Format / Type Transformation Metadata update Message Content enrichment/reduction
  • 4.
    RED HAT CONFIDENTIAL| ADD NAME4 Data Transformation XML CSV JSON POJO Transform Marshal/Unmarshal Processor Bean Format FileString Text Date Type
  • 5.
    RED HAT CONFIDENTIAL| ADD NAME5 Marshal Component Component XML CVS JSON POJO
  • 6.
    RED HAT CONFIDENTIAL| ADD NAME6 Marshal <marshal> <xmljson/> </marshal> <marshal> <jaxb partClass=“example.TradeOrder” contextPath=“example"/> </marshal> <marshal> <bindy classtype=”example.Product" type="Csv"> </marshal> <marshal> <serialization/> </marshal>
  • 7.
    RED HAT CONFIDENTIAL| ADD NAME7 Unmarshal Component Component XML CVS JSON POJO
  • 8.
    RED HAT CONFIDENTIAL| ADD NAME8 Unmarshal <unmarshal> <xmljson/> </unmarshal> <unmarshal> <jaxb partClass=“example.TradeOrder” contextPath=“example"/> </unmarshal> <unmarshal> <bindy classtype=”example.Product" type="Csv"> </unmarshal> <unmarshal> <serialization/> </unmarshal>
  • 9.
    RED HAT CONFIDENTIAL| ADD NAME9 Transform Constant xquery simple javascript Expression <constant>Harry Potter</constant> <xquery> For $/bookstore/book where $x/price>30 return $x/title </xquery> <simple> <books>${in.body} <books> </simple> <javaScript> request.body.toLowerCase() </javaScript>
  • 10.
    RED HAT CONFIDENTIAL| ADD NAME10 Processor package org.blogdemo.transformation; import org.apache.camel.Exchange; import org.apache.camel.Processor; public class DataProcessor implements Processor { @Override public void process(Exchange exchange) throws Exception { String incomingData = exchange.getIn().getBody(String.class); incomingData = "Hello"+incomingData; exchange.getIn().setBody(incomingData); } } Processor
  • 11.
    RED HAT CONFIDENTIAL| ADD NAME11 Processor <bean id="DataProcessor" class="org.blogdemo.transformation.DataProcessor"/> <camelContext trace="false" id="blueprintContext" xmlns="http://camel.apache.org/schema/blueprint"> <route> <from uri="file://somewhere?delete=true"/> <process ref="DataProcessor"/> <to uri="file://elsewhere"/> </route> </camelContext> Calling processor
  • 12.
    RED HAT CONFIDENTIAL| ADD NAME12 Bean package org.blogdemo.transformation; public class ConvertBean { public static String addHello(String inputContent) { return "Hellp "+inputContent; } } <bean id="ConvertBean" class="org.blogdemo.transformation.ConvertBean"/> <camelContext trace="false" id="blueprintContext" xmlns="http://camel.apache.org/schema/blueprint"> <route> <from uri="file://somewhere?delete=true"/> <bean method="addHello" ref="ConvertBean"/> <to uri="file://elsewhere"/> </route> </camelContext> Calling bean
  • 13.
    RED HAT CONFIDENTIAL| ADD NAME13 Bean
  • 14.
    RED HAT CONFIDENTIAL| ADD NAME14 META DATA Update Body Header Change or remove properties here
  • 15.
    RED HAT CONFIDENTIAL| ADD NAME15 Message content enrichment Content Enricher Resequencer Claim Check Content Filter Normalizer
  • 16.
    RED HAT CONFIDENTIAL| ADD NAME16 My 2nd Camel Ride Stock purchase XML JSON POJO Another Vendor

Editor's Notes

  • #3 Reduces the pain of integrating disparate applications (on-premise, cloud or hybrid)
  • #4 Reduces the pain of integrating disparate applications (on-premise, cloud or hybrid)
  • #5 The data format of the message body is transformed from one form to another. For example, a CSV record is formatted as XML.
  • #6 Reduces the pain of integrating disparate applications (on-premise, cloud or hybrid)
  • #7 marshaling process is provided in ready-to-use components known as data formats.
  • #8 Reduces the pain of integrating disparate applications (on-premise, cloud or hybrid)
  • #9 marshaling process is provided in ready-to-use components known as data formats.
  • #10 Scripting languages as expressions in Camel
  • #11 Reduces the pain of integrating disparate applications (on-premise, cloud or hybrid)
  • #12 Reduces the pain of integrating disparate applications (on-premise, cloud or hybrid)
  • #13 Reduces the pain of integrating disparate applications (on-premise, cloud or hybrid)
  • #14 Reduces the pain of integrating disparate applications (on-premise, cloud or hybrid)
  • #15 Reduces the pain of integrating disparate applications (on-premise, cloud or hybrid)
  • #17 Reduces the pain of integrating disparate applications (on-premise, cloud or hybrid)