[CONF] Apache Camel: EDI (page created)
Page Created : CAMEL : EDI EDI has been created by Claus Ibsen (Aug 17, 2008). Content: EDI DataFormat This component ships with a EDI dataformat that can be used to format from an InputStream (could be String) to XML. marshal = currently not support by Smmoks unmarshal = from stream to XML (can be used when reading EDI files) The EDIDataFormat must be configued with either a: setSmooksConfig(configfile) = a fully smooks configuration file setMappingModel(modelfile) = just the mapping model xml file and Camel will use a default smooks configuration To use the data format simply instantiate an instance, invoke on of the appropriate setter and invoke the unmarshl operation in the route builder: DataFormat edi = new EDIDataFormat(); edi.setMappingModel("my-order-mapping.xml"); ... from("file://edi/in").unmarshal(edi).to("jms:queue:edi"); And you can also provide the full smooks configuration file where you can configure Smooks as you want, in case the default configuration isn't useful: DataFormat edi = new EDIDataFormat(); edi.setSmooksConfig(my-smooks-config.xml"); ... from("file://edi/in").unmarshal(edi).to("jms:queue:edi"); The default configuration file is provided as a resource in the jar in the location: org/apache/camel/dataformat/edi/default-smooks-config.xml Powered by Atlassian Confluence (Version: 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature request Unsubscribe or edit your notifications preferences
svn commit: r686606 - in /activemq/camel/trunk/camel-core/src: main/java/org/apache/camel/builder/DataFormatClause.java main/java/org/apache/camel/model/MarshalType.java test/java/org/apache/camel/com
Author: ningjiang Date: Sun Aug 17 06:15:54 2008 New Revision: 686606 URL: http://svn.apache.org/viewvc?rev=686606view=rev Log: Fixed the CS errors of the camel-core Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/DataFormatClause.java activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/MarshalType.java activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileDeleteRouteTest.java Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/DataFormatClause.java URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/DataFormatClause.java?rev=686606r1=686605r2=686606view=diff == --- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/DataFormatClause.java (original) +++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/DataFormatClause.java Sun Aug 17 06:15:54 2008 @@ -20,8 +20,8 @@ import org.apache.camel.model.dataformat.ArtixDSContentType; import org.apache.camel.model.dataformat.ArtixDSDataFormat; import org.apache.camel.model.dataformat.CsvDataFormat; -import org.apache.camel.model.dataformat.HL7DataFormat; import org.apache.camel.model.dataformat.DataFormatType; +import org.apache.camel.model.dataformat.HL7DataFormat; import org.apache.camel.model.dataformat.JaxbDataFormat; import org.apache.camel.model.dataformat.SerializationDataFormat; import org.apache.camel.model.dataformat.StringDataFormat; Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/MarshalType.java URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/MarshalType.java?rev=686606r1=686605r2=686606view=diff == --- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/MarshalType.java (original) +++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/model/MarshalType.java Sun Aug 17 06:15:54 2008 @@ -26,8 +26,8 @@ import org.apache.camel.Processor; import org.apache.camel.model.dataformat.ArtixDSDataFormat; import org.apache.camel.model.dataformat.CsvDataFormat; -import org.apache.camel.model.dataformat.HL7DataFormat; import org.apache.camel.model.dataformat.DataFormatType; +import org.apache.camel.model.dataformat.HL7DataFormat; import org.apache.camel.model.dataformat.JaxbDataFormat; import org.apache.camel.model.dataformat.SerializationDataFormat; import org.apache.camel.model.dataformat.StringDataFormat; Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileDeleteRouteTest.java URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileDeleteRouteTest.java?rev=686606r1=686605r2=686606view=diff == --- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileDeleteRouteTest.java (original) +++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileDeleteRouteTest.java Sun Aug 17 06:15:54 2008 @@ -48,4 +48,4 @@ } } -} \ No newline at end of file +}
[CONF] Apache Camel: CXF (page edited)
Page Edited : CAMEL : CXF CXF has been edited by willem jiang (Aug 17, 2008). Change summary: CAMEL-829 (View changes) Content: CXF Component The cxf: component provides integration with Apache CXF for connecting to JAX-WS services hosted in CXF. Maven users will need to add the following dependency to their pom.xml for this component: dependency groupIdorg.apache.camel/groupId artifactIdcamel-cxf/artifactId versionx.x.x/version !-- use the same version as your Camel core version -- /dependency URI format cxf://address?options Where address represents the CXF endpoint's address cxf:bean:cxfEndpoint Where cxfEndpoint represents the spring bean's name which presents the CXF endpoint For either style above, you can append options to the URI as follows: cxf:bean:cxfEndpoint?wsdlURL=wsdl/hello_world.wsdldataFormat=PAYLOAD Options Name Description Example Required? default value wsdlURL The location of the WSDL. file://local/wsdl/hello.wsdl or wsdl/hello.wsdl No WSDL is obtained from endpoint address by default serviceClass The name of the SEI(Service Endpoint Interface) implementation class. This class can have but does not require JSR181 annotations. org.apache.camel.Hello Yes for CXF provider, for CXF Consumer only if POJO dataFormat option is used serviceName The service name this service is implementing, it maps to the wsdl:[EMAIL PROTECTED] {http://org.apache.camel} ServiceName Only if more than one serviceName in WSDL present portName The port name this service is implementing, it maps to the wsdl:[EMAIL PROTECTED] {http://org.apache.camel} PortName Only if more than one portName under the serviceName is present dataFormat Which data type messages the CXF endpoint supports POJO, PAYLOAD, MESSAGE No POJO wrapped Which kind of operation that CXF endpoint producer will invoke true, false No false setDefaultBus Will set the default bus when CXF endpoint create a bus by itself true, false No false The serviceName and portName are QNames, so if you provide them be sure to prefix them with their {namespace} as shown in the examples above. The descriptions of the dataformats DataFormat Description POJO POJOs (Plain old Java objects) are the Java parameters to the method being invoked on the target server. PAYLOAD PAYLOAD is the message payload (the contents of the soap:body) after message configuration in the CXF endpoint is applied. MESSAGE MESSAGE is the raw message that is received from the transport layer. Configure the CXF endpoints with spring You can configure the CXF endpoint with the below spring configuration file, and you can also embed the endpoint into the camelContext tags. beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cxf="http://activemq.apache.org/camel/schema/cxfEndpoint" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://activemq.apache.org/camel/schema/cxfEndpoint http://activemq.apache.org/camel/schema/cxf/cxfEndpoint.xsd http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd " cxf:cxfEndpoint id="routerEndpoint" address="http://localhost:9003/CamelContext/RouterPort" serviceClass="org.apache.hello_world_soap_http.GreeterImpl"/ cxf:cxfEndpoint id="serviceEndpoint" address="http://localhost:9000/SoapContext/SoapPort" wsdlURL="testutils/hello_world.wsdl" serviceClass="org.apache.hello_world_soap_http.Greeter" endpointName="s:SoapPort" serviceName="s:SOAPService" xmlns:s="http://apache.org/hello_world_soap_http" / camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring" route from uri="cxf:bean:routerEndpoint" / to uri="cxf:bean:serviceEndpoint" / /route /camelContext /beans Be sure to include the JAX-WS schemaLocation attribute specified on the root beans element. This allows CXF to validate the file and is required. Also note the namespace declarations at the end of the cxf:cxfEndpoint/ tag--these are required because the combined "{namespace}localName" syntax is presently not supported for this tag's attribute values. The cxf:cxfEndpoint element supports many additional attributes: Name Value PortName The endpoint name this service is implementing, it maps to the wsdl:[EMAIL PROTECTED] In the format of "ns:PORT_NAME" where ns is a namespace prefix valid at this scope. serviceName The service name this service is implementing, it maps to the wsdl:[EMAIL PROTECTED]
[CONF] Apache Camel: Flatpack (page edited)
Page Edited : CAMEL : Flatpack Flatpack has been edited by Claus Ibsen (Aug 17, 2008). Change summary: CAMEL-731 (View changes) Content: Flatpack Component The Flatpack component supports fixed width and delimited file parsing via the FlatPack library. URI format flatpack:[delim|fixed]:flatPackConfig.pzmap.xml or for a delimited file handler with no configuration file just use flatpack:someName Examples flatpack:fixed:foo.pzmap.xml creates a fixed width endpoint using the foo.pzmap.xml file configuration flatpack:delim:bar.pzmap.xml creates a delimited endpoint using the bar.pzmap.xml file configuration flatpack:foo creates a delimited endpoint called foo with no file configuration URI Options Name Default Value Description delimiter ',' the default character delimiter for delimited files textQualifier '"' the text qualifier delimited files ignoreFirstRecord true whether the first line is ignored for delimited files (for the column headers) Header and Trailer records In Camel 1.5 onwards the header and trailer notions in Flatpack is supported. However it is required that you must use a fixed record id names header for the header record (must be lowercase) trailer for the trailer record (must be lowercase) The example below illustrates this fact that we have a header and a trailer. You can omit one or both of them if not needed. RECORD id="header" startPosition="1" endPosition="3" indicator="HBT" COLUMN name="INDICATOR" length="3"/ COLUMN name="DATE" length="8"/ /RECORD COLUMN name="FIRSTNAME" length="35" / COLUMN name="LASTNAME" length="35" / COLUMN name="ADDRESS" length="100" / COLUMN name="CITY" length="100" / COLUMN name="STATE" length="2" / COLUMN name="ZIP" length="5" / RECORD id="trailer" startPosition="1" endPosition="3" indicator="FBT" COLUMN name="INDICATOR" length="3"/ COLUMN name="STATUS" length="7"/ /RECORD Using the endpoint A common use case is sending a file to this endpoint for further processing in a separate route. For example... camelContext xmlns="http://activemq.apache.org/camel/schema/spring" route from uri="file://someDirectory"/ to uri="flatpack:foo"/ /route route from uri="flatpack:foo"/ ... /route /camelContext You can also convert the payload of each message created to a Map for easy Bean Integration See Also Configuring Camel Component Endpoint Getting Started Powered by Atlassian Confluence (Version: 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature request Unsubscribe or edit your notifications preferences
svn commit: r686614 - in /activemq/camel/trunk/components/camel-flatpack/src: main/java/org/apache/camel/component/flatpack/ test/data/headerandtrailer/ test/java/org/apache/camel/component/flatpack/
/components/camel-flatpack/src/test/data/headerandtrailer/PEOPLE-HeaderAndTrailer.txt -- svn:keywords = Rev Date Copied: activemq/camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/HeaderAndTrailerTest.java (from r686454, activemq/camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthTest.java) URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/HeaderAndTrailerTest.java?p2=activemq/camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/HeaderAndTrailerTest.javap1=activemq/camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthTest.javar1=686454r2=686614rev=686614view=diff == --- activemq/camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/FixedLengthTest.java (original) +++ activemq/camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/HeaderAndTrailerTest.java Sun Aug 17 07:28:36 2008 @@ -33,21 +33,28 @@ * @version $Revision$ */ @ContextConfiguration -public class FixedLengthTest extends AbstractJUnit38SpringContextTests { -private static final transient Log LOG = LogFactory.getLog(FixedLengthTest.class); +public class HeaderAndTrailerTest extends AbstractJUnit38SpringContextTests { +private static final transient Log LOG = LogFactory.getLog(HeaderAndTrailerTest.class); @EndpointInject(uri = mock:results) protected MockEndpoint results; protected String[] expectedFirstName = {JOHN, JIMMY, JANE, FRED}; -public void testCamel() throws Exception { -results.expectedMessageCount(4); +public void testHeaderAndTrailer() throws Exception { +results.expectedMessageCount(6); results.assertIsSatisfied(); int counter = 0; ListExchange list = results.getReceivedExchanges(); -for (Exchange exchange : list) { + +// assert header +Map header = list.get(0).getIn().getBody(Map.class); +assertEquals(HBT, header.get(INDICATOR)); +assertEquals(20080817, header.get(DATE)); + +// assert body +for (Exchange exchange : list.subList(1, 5)) { Message in = exchange.getIn(); Map body = in.getBody(Map.class); assertNotNull(Should have found body as a Map but was: + ObjectHelper.className(in.getBody()), body); @@ -56,6 +63,10 @@ counter++; } +// assert trailer +Map trailer = list.get(5).getIn().getBody(Map.class); +assertEquals(FBT, trailer.get(INDICATOR)); +assertEquals(SUCCESS, trailer.get(STATUS)); } -} +} \ No newline at end of file Propchange: activemq/camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/HeaderAndTrailerTest.java -- svn:eol-style = native Propchange: activemq/camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/HeaderAndTrailerTest.java -- svn:keywords = Rev Date Propchange: activemq/camel/trunk/components/camel-flatpack/src/test/java/org/apache/camel/component/flatpack/HeaderAndTrailerTest.java -- svn:mergeinfo = Copied: activemq/camel/trunk/components/camel-flatpack/src/test/resources/PEOPLE-HeaderAndTrailer.pzmap.xml (from r686454, activemq/camel/trunk/components/camel-flatpack/src/test/resources/INVENTORY-Delimited.pzmap.xml) URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-flatpack/src/test/resources/PEOPLE-HeaderAndTrailer.pzmap.xml?p2=activemq/camel/trunk/components/camel-flatpack/src/test/resources/PEOPLE-HeaderAndTrailer.pzmap.xmlp1=activemq/camel/trunk/components/camel-flatpack/src/test/resources/INVENTORY-Delimited.pzmap.xmlr1=686454r2=686614rev=686614view=diff == --- activemq/camel/trunk/components/camel-flatpack/src/test/resources/INVENTORY-Delimited.pzmap.xml (original) +++ activemq/camel/trunk/components/camel-flatpack/src/test/resources/PEOPLE-HeaderAndTrailer.pzmap.xml Sun Aug 17 07:28:36 2008 @@ -1,9 +1,22 @@ ?xml version='1.0'? -!DOCTYPE PZMAP SYSTEM - flatpack.dtd +!DOCTYPE PZMAP SYSTEM flatpack.dtd + PZMAP - COLUMN name=ITEM_DESC / - COLUMN name=IN_STOCK / - COLUMN name=PRICE / - COLUMN name=LAST_RECV_DT / -/PZMAP +RECORD id=header startPosition=1 endPosition=3 indicator=HBT +COLUMN name=INDICATOR length=3/ +COLUMN name
[CONF] Apache Camel: Tutorial-Example-ReportIncident-Part4 (page created)
Page Created : CAMEL : Tutorial-Example-ReportIncident-Part4 Tutorial-Example-ReportIncident-Part4 has been created by Claus Ibsen (Aug 17, 2008). Content: Part 4 TODO Powered by Atlassian Confluence (Version: 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature request Unsubscribe or edit your notifications preferences
[CONF] Apache Camel: Tutorial-Example-ReportIncident-Part4 (attachment added)
New files attached to: CAMEL : Tutorial-Example-ReportIncident-Part4 Tutorial-Example-ReportIncident-Part4 by Claus Ibsen . Attached file(s): tutorial_reportincident_route_1.png (image/png, 5 kb) Powered by Atlassian Confluence (Version: 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature request Unsubscribe or edit your notifications preferences