O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.
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
enric...
RED HAT CONFIDENTIAL | ADD NAME4
Data Transformation
XML
CSV
JSON
POJO
Transform
Marshal/Unmarshal
Processor
Bean
Format
F...
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”
co...
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.TradeO...
RED HAT CONFIDENTIAL | ADD NAME9
Transform
Constant
xquery
simple
javascript
Expression
<constant>Harry Potter</constant>
...
RED HAT CONFIDENTIAL | ADD NAME10
Processor
package org.blogdemo.transformation;
import org.apache.camel.Exchange;
import ...
RED HAT CONFIDENTIAL | ADD NAME11
Processor
<bean id="DataProcessor" class="org.blogdemo.transformation.DataProcessor"/>
<...
RED HAT CONFIDENTIAL | ADD NAME12
Bean
package org.blogdemo.transformation;
public class ConvertBean {
public static Strin...
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
Norma...
RED HAT CONFIDENTIAL | ADD NAME16
My 2nd Camel Ride
Stock
purchase
XML
JSON
POJO
Another
Vendor
Próximos SlideShares
Carregando em…5
×

JBoss Fuse Workshop 101 part 2

7.607 visualizações

Publicada em

You had a go on building your first camel application, now it's time to look at how data can configured to transformed in the blink of an eye! Part 2 of the workshop is all about message transformation!

Publicada em: Tecnologia
  • Seja o primeiro a comentar

JBoss Fuse Workshop 101 part 2

  1. 1. JBoss Fuse 101 Getting Started workshop Christina Lin JBoss Technology Evangelist clin@redhat.com
  2. 2. RED HAT CONFIDENTIAL | ADD NAME2 Message Transformation
  3. 3. RED HAT CONFIDENTIAL | ADD NAME3 Message Transformation Format / Type Transformation Metadata update Message Content enrichment/reduction
  4. 4. RED HAT CONFIDENTIAL | ADD NAME4 Data Transformation XML CSV JSON POJO Transform Marshal/Unmarshal Processor Bean Format FileString Text Date Type
  5. 5. RED HAT CONFIDENTIAL | ADD NAME5 Marshal Component Component XML CVS JSON POJO
  6. 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. 7. RED HAT CONFIDENTIAL | ADD NAME7 Unmarshal Component Component XML CVS JSON POJO
  8. 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. 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. 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. 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. 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. 13. RED HAT CONFIDENTIAL | ADD NAME13 Bean
  14. 14. RED HAT CONFIDENTIAL | ADD NAME14 META DATA Update Body Header Change or remove properties here
  15. 15. RED HAT CONFIDENTIAL | ADD NAME15 Message content enrichment Content Enricher Resequencer Claim Check Content Filter Normalizer
  16. 16. RED HAT CONFIDENTIAL | ADD NAME16 My 2nd Camel Ride Stock purchase XML JSON POJO Another Vendor

×