[CONF] Apache Camel > Camel 2.6.0 Release
Camel 2.6.0 Release Page edited by Claus Ibsen Changes (3) ... * Fixed [Jetty] may throw NPE during heavy load. * [JPA] {{JpaTraceEventMessage}} now uses {...@lob}} for fields which may contain a lot of data, such as message body. * Fixed [Bindy] when using quoted CSV records and fixed when using pipeline delimiter.* Fixed [Bindy] when using quoted CSV records and fixed when using pipeline delimiter. * [Throughput logger|Log] now supports logging per interval (timer based). ... * [JMX Component Example] * [Simple Jira Bot] * Spring Web Services Example h3. New [Tutorials] ... Full Content Camel 2.6.0 release (currently in progress) New and Noteworthy Welcome to the 2.6.0 release which approx XXX issues resolved (new features, improvements and bug fixes such as...) Fixed issue in OSGi with refreshing Camel bundles causing a race condition when discovering type converters Introduced ScheduledRoutePolicy with the Quartz component Java DSL RouteBuilder now fails if onException and the likes are not configured before routes, which they must. Easier to debug routes from camel-test using the Debugger Fixed problem installing camel-cxf feature on Apache Karaf. The EIP now supports property placeholders in the String based options (a few spots in Java DSL where its not possible). For example: "String" charset="{{foo.myCharset}}"/> Introduced ScheduledRoutePolicy to allow you to schedule when routes should be active. Introduced stepwise option to FTP component to allow end users to control how to traverse directories of the FTP servers. This allows you to set stepwise=false to return back to the behavior from Camel 2.0 - 2.4. See more at the FTP documentation. Added separator option to FTP component to allow end users to control what path separator to use when uploading files to remote FTP servers. For example if a Windows based FTP server only accept Windows paths, then you can set this option to Windows. Thread names now outputs CamelContext name which makes it easier to differentiate when running multiple Camel applications in the same JVM. Introduced contentCache option to XSLT component to allow easy reloading of stylesheets during development. Improved Camel JMX to always find next free name when registering in JMX and existing name exists (to remedy name clash). This makes it easier when deploying muliple WARs in the same JVM where the Camel applications may have same CamelContext id. In OSGi the name in JMX now has the bundle id as prefix. Fixed BeanShell language Quartz now supports using older versions (eg versions 1.6/1.7) of quartz JARs. The Aggregator EIP will use a synchronous invocation when processing completed aggregated Exchanges, when not running in parallel mode. This ensures no internal task queue is used, which otherwise could stack up tasks and under certain conditions eat up memory. Enable parallelProcessing if you want to use a separate thread for processing completed aggregated Exchanges. LDAP supports paging. CXF and CXFRS use the CXF continuation API when using CXF 2.3.x. You can access the CXF Message from the Camel message header by using the key "CamelCxfMessage" after the CXF consumer. Fixed a rare situation in which an Exchange could be lost during graceful shutdown on the SEDA endpoints, usually more apparent on high volume systems. Improved support for Locale in Bindy for Number and Date formats. Fixed Multicast, Splitter, Recipient List to work as the Pipes and Filters would do, breaking to continue routing if a sub exchange failed and was handled by an Exception Clause. Previously you would have to detect this manually in the AggregationStrategy. Constant fields from Exchange can be referred in the DSL from a String attribute using the class type style. This makes the Java DSL and Spring XML more similar. And you got type safe as Camel throws exception if you had a typo. For example: "Exchange.FILE_NAME">myfile.txt Exchange now contains the creation timestamp when it was created as a java.util.Date object stores as a property with the key Exchange.CREATION_TIMESTAMP Camel fails fast on startup if Load Balancer has been misconfigured, such as configuring two different load balancers in one Fixed markRollbackOnlyLast when used with inner/outer transactions. InterceptStrategy is now default ordered in the order they are added to the CamelContext. However you can dictate the order by implementing the org.apache.camel.util.Ordered interface. Made it easier to load routes from XML files using loadRoutesDefinition method from CamelContext. Added support for custom multipart filters in Jetty. Using Processor or Bean in routes is now al
svn commit: r1055766 - in /camel/trunk/camel-core/src: main/java/org/apache/camel/processor/ThroughputLogger.java test/java/org/apache/camel/component/log/ThroughputLoggerTest.java
Author: davsclaus Date: Thu Jan 6 07:09:32 2011 New Revision: 1055766 URL: http://svn.apache.org/viewvc?rev=1055766&view=rev Log: CAMEL-1902: throughput logger using interval logs number of messages received since last log. Thank to Ben for patch. Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/ThroughputLogger.java camel/trunk/camel-core/src/test/java/org/apache/camel/component/log/ThroughputLoggerTest.java Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/ThroughputLogger.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/ThroughputLogger.java?rev=1055766&r1=1055765&r2=1055766&view=diff == --- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/ThroughputLogger.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/ThroughputLogger.java Thu Jan 6 07:09:32 2011 @@ -78,11 +78,6 @@ public class ThroughputLogger extends Lo Long groupInterval, Long groupDelay, Boolean groupActiveOnly) { super(logName, level); -//initialize the startTime (since no messages may be received before a timer log event) -if (startTime == 0) { -startTime = System.currentTimeMillis(); -} - this.camelContext = camelContext; setGroupInterval(groupInterval); setGroupActiveOnly(groupActiveOnly); @@ -227,13 +222,17 @@ public class ThroughputLogger extends Lo return; } -LOG.trace("ThroughputLogger started"); createGroupIntervalLogMessage(); -LOG.trace("ThroughputLogger complete"); } } protected void createGroupIntervalLogMessage() { + +// this indicates that no messages have been received yet...don't log yet +if (startTime == 0) { +return; +} + int receivedCount = receivedCounter.get(); // if configured, hide log messages when no new messages have been received @@ -254,7 +253,7 @@ public class ThroughputLogger extends Lo groupStartTime = time; groupReceivedCount = receivedCount; -String message = getAction() + ": " + receivedCount + " messages so far. Last group took: " + duration +String message = getAction() + ": " + currentCount + " new messages, with total " + receivedCount + " so far. Last group took: " + duration + " millis which is: " + numberFormat.format(rate) + " messages per second. average: " + numberFormat.format(average); log(message); Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/component/log/ThroughputLoggerTest.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/component/log/ThroughputLoggerTest.java?rev=1055766&r1=1055765&r2=1055766&view=diff == --- camel/trunk/camel-core/src/test/java/org/apache/camel/component/log/ThroughputLoggerTest.java (original) +++ camel/trunk/camel-core/src/test/java/org/apache/camel/component/log/ThroughputLoggerTest.java Thu Jan 6 07:09:32 2011 @@ -52,7 +52,7 @@ public class ThroughputLoggerTest extend public void testSendMessageToLogUsingGroupInterval() throws Exception { context.addRoutes(new RouteBuilder() { public void configure() { - from("seda:in").to("log:hello?groupInterval=200&groupDelay=100&groupActiveOnly=false").delay(50).to("mock:result"); + from("seda:in").to("log:hello?groupInterval=200&groupDelay=400&groupActiveOnly=false").delay(50).to("mock:result"); } }); context.start();
svn commit: r1055698 - /camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/JaxbDataFormat.java
Author: ningjiang Date: Thu Jan 6 01:17:08 2011 New Revision: 1055698 URL: http://svn.apache.org/viewvc?rev=1055698&view=rev Log: Fixed CS error of JaxbDataFormat Modified: camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/JaxbDataFormat.java Modified: camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/JaxbDataFormat.java URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/JaxbDataFormat.java?rev=1055698&r1=1055697&r2=1055698&view=diff == --- camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/JaxbDataFormat.java (original) +++ camel/trunk/components/camel-jaxb/src/main/java/org/apache/camel/converter/jaxb/JaxbDataFormat.java Thu Jan 6 01:17:08 2011 @@ -53,7 +53,7 @@ import org.apache.commons.logging.LogFac */ public class JaxbDataFormat extends ServiceSupport implements DataFormat, CamelContextAware { -private final transient Log LOG = LogFactory.getLog(JaxbDataFormat.class); +private static final transient Log LOG = LogFactory.getLog(JaxbDataFormat.class); private CamelContext camelContext; private JAXBContext context; private String contextPath;
svn commit: r1055691 - /camel/trunk/examples/camel-example-spring-ws/client/camel-example-spring-ws-soapui-project.xml
Author: cmueller Date: Wed Jan 5 23:59:10 2011 New Revision: 1055691 URL: http://svn.apache.org/viewvc?rev=1055691&view=rev Log: added missing license header Modified: camel/trunk/examples/camel-example-spring-ws/client/camel-example-spring-ws-soapui-project.xml Modified: camel/trunk/examples/camel-example-spring-ws/client/camel-example-spring-ws-soapui-project.xml URL: http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-spring-ws/client/camel-example-spring-ws-soapui-project.xml?rev=1055691&r1=1055690&r2=1055691&view=diff == --- camel/trunk/examples/camel-example-spring-ws/client/camel-example-spring-ws-soapui-project.xml (original) +++ camel/trunk/examples/camel-example-spring-ws/client/camel-example-spring-ws-soapui-project.xml Wed Jan 5 23:59:10 2011 @@ -1,4 +1,20 @@ + http://eviware.com/soapui/config";>http://camel.apache.org/example/increment}incrementSoap11"; soapVersion="1_1" anonymous="optional" definition="http://localhost:8080/increment/increment.wsdl"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>http://localhost:8080/increment/increment.wsdl";>http://localhost:8080/increment/increment.wsdl
svn commit: r1055686 - in /camel/trunk/examples: ./ camel-example-spring-ws/ camel-example-spring-ws/client/ camel-example-spring-ws/src/ camel-example-spring-ws/src/main/ camel-example-spring-ws/src/
Author: cmueller Date: Wed Jan 5 23:35:06 2011 New Revision: 1055686 URL: http://svn.apache.org/viewvc?rev=1055686&view=rev Log: CAMEL-3472: Example of Spring Web Services component Thank you Richard Kettelerij for this contribution! Added: camel/trunk/examples/camel-example-spring-ws/ camel/trunk/examples/camel-example-spring-ws/README.txt (with props) camel/trunk/examples/camel-example-spring-ws/client/ camel/trunk/examples/camel-example-spring-ws/client/camel-example-spring-ws-soapui-project.xml (with props) camel/trunk/examples/camel-example-spring-ws/pom.xml (with props) camel/trunk/examples/camel-example-spring-ws/src/ camel/trunk/examples/camel-example-spring-ws/src/main/ camel/trunk/examples/camel-example-spring-ws/src/main/java/ camel/trunk/examples/camel-example-spring-ws/src/main/java/org/ camel/trunk/examples/camel-example-spring-ws/src/main/java/org/apache/ camel/trunk/examples/camel-example-spring-ws/src/main/java/org/apache/camel/ camel/trunk/examples/camel-example-spring-ws/src/main/java/org/apache/camel/example/ camel/trunk/examples/camel-example-spring-ws/src/main/java/org/apache/camel/example/server/ camel/trunk/examples/camel-example-spring-ws/src/main/java/org/apache/camel/example/server/IncrementRoute.java (with props) camel/trunk/examples/camel-example-spring-ws/src/main/java/org/apache/camel/example/server/model/ camel/trunk/examples/camel-example-spring-ws/src/main/java/org/apache/camel/example/server/model/IncrementRequest.java (with props) camel/trunk/examples/camel-example-spring-ws/src/main/java/org/apache/camel/example/server/model/IncrementResponse.java (with props) camel/trunk/examples/camel-example-spring-ws/src/main/java/org/apache/camel/example/server/model/package-info.java (with props) camel/trunk/examples/camel-example-spring-ws/src/main/resources/ camel/trunk/examples/camel-example-spring-ws/src/main/resources/META-INF/ camel/trunk/examples/camel-example-spring-ws/src/main/resources/META-INF/LICENSE.txt (with props) camel/trunk/examples/camel-example-spring-ws/src/main/resources/META-INF/NOTICE.txt (with props) camel/trunk/examples/camel-example-spring-ws/src/main/resources/log4j.properties (with props) camel/trunk/examples/camel-example-spring-ws/src/main/resources/org/ camel/trunk/examples/camel-example-spring-ws/src/main/resources/org/apache/ camel/trunk/examples/camel-example-spring-ws/src/main/resources/org/apache/camel/ camel/trunk/examples/camel-example-spring-ws/src/main/resources/org/apache/camel/example/ camel/trunk/examples/camel-example-spring-ws/src/main/resources/org/apache/camel/example/server/ camel/trunk/examples/camel-example-spring-ws/src/main/resources/org/apache/camel/example/server/model/ camel/trunk/examples/camel-example-spring-ws/src/main/resources/org/apache/camel/example/server/model/jaxb.index (with props) camel/trunk/examples/camel-example-spring-ws/src/main/webapp/ camel/trunk/examples/camel-example-spring-ws/src/main/webapp/WEB-INF/ camel/trunk/examples/camel-example-spring-ws/src/main/webapp/WEB-INF/increment.xsd (with props) camel/trunk/examples/camel-example-spring-ws/src/main/webapp/WEB-INF/lib/ camel/trunk/examples/camel-example-spring-ws/src/main/webapp/WEB-INF/spring-ws-servlet.xml (with props) camel/trunk/examples/camel-example-spring-ws/src/main/webapp/WEB-INF/web.xml (with props) Modified: camel/trunk/examples/pom.xml Added: camel/trunk/examples/camel-example-spring-ws/README.txt URL: http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-spring-ws/README.txt?rev=1055686&view=auto == --- camel/trunk/examples/camel-example-spring-ws/README.txt (added) +++ camel/trunk/examples/camel-example-spring-ws/README.txt Wed Jan 5 23:35:06 2011 @@ -0,0 +1,36 @@ +Camel Spring Web Services Example += + +This example shows how to expose a SOAP-based web service using Camel and Spring Web Services. +It can be run using Maven. + +The web service endpoint address is: + "http://localhost:8080/increment"; + +The WSDL is available at: + "http://localhost:8080/increment/increment.wsdl"; + +You will need to compile this example first: + mvn clean install + +To run the example, you need to start up the server by typing + mvn jetty:run + +To stop the server hit ctrl + c + +You can test the web service using for example SOAP-UI. This excellent tool is freely available from http://www.soapui.org. +There's a ready to use SOAP-UI project available in the "client" directory. + +For the latest & greatest documentation on how to use this example please see + http://camel.apache.org/spring-ws-example.html + +If you hit any problems please talk to us on the Camel Forums + http://camel.apache.org/discussion-forums.html + +Please help us make Apache
[CONF] Apache Camel > sqs
sqs Page edited by Tracy Snell Changes (0) ... |accessKey | null | Shared | Amazon AWS Access Key | |secretKey | null | Shared | Amazon AWS Secret Key | |attributeNames | | | | |defaultVisibilityTimeout | | | | |deleteAfterRead | true | Consumer | Delete message from SQS after it has been read | |maxMessagesPerPoll| | | | |visibilityTimeout | | | | h3. Usage ... Full Content SQS Component Available as of Camel 2.6 The sqs component supports sending and receiving messages to Amazon's SQS service. URI Format sqs://queue-name URI Options Name Default Value Context Description accessKey null Shared Amazon AWS Access Key secretKey null Shared Amazon AWS Secret Key attributeNames defaultVisibilityTimeout deleteAfterRead true Consumer Delete message from SQS after it has been read maxMessagesPerPoll visibilityTimeout Usage Batch Consumer This component implements the Batch Consumer. Exchange Properties, sqs consumer only As the sqs consumer is BatchConsumer it supports batching the messages it polls. By batching it means that Camel will add some properties to the Exchange so you know the number of messages polled the current index in that order. Property Description CamelBatchSize The total number of messages that was polled in this batch. CamelBatchIndex The current index of the batch. Starts from 0. CamelBatchComplete A boolean value indicating the last Exchange in the batch. Is only true for the last entry. This allows you for instance to know how many messages exists in this batch and for instance let the Aggregator aggregate this number of messages. Dependencies Maven users will need to add the following dependency to their pom.xml. pom.xml org.apache.camel camel-aws ${camel-version} where ${camel-version} must be replaced by the actual version of Camel (2.6 or higher). See Also Configuring Camel Component Endpoint Getting Started AWS Component Change Notification Preferences View Online | View Changes | Add Comment
[CONF] Apache Camel > sqs
sqs Page edited by Tracy Snell Changes (3) ... |accessKey | null | Shared | Amazon AWS Access Key | |secretKey | null | Shared | Amazon AWS Secret Key | |attributeNames | | | |defaultVisibilityTimeout | | | |deleteAfterRead | false true | Consumer | Delete message from SQS after it has been read | |maxMessagesPerPoll| | | |visibilityTimeout | | | h3. Usage ... Full Content SQS Component Available as of Camel 2.6 The sqs component supports sending and receiving messages to Amazon's SQS service. URI Format sqs://queue-name URI Options Name Default Value Context Description accessKey null Shared Amazon AWS Access Key secretKey null Shared Amazon AWS Secret Key attributeNames defaultVisibilityTimeout deleteAfterRead true Consumer Delete message from SQS after it has been read maxMessagesPerPoll visibilityTimeout Usage Batch Consumer This component implements the Batch Consumer. Exchange Properties, sqs consumer only As the sqs consumer is BatchConsumer it supports batching the messages it polls. By batching it means that Camel will add some properties to the Exchange so you know the number of messages polled the current index in that order. Property Description CamelBatchSize The total number of messages that was polled in this batch. CamelBatchIndex The current index of the batch. Starts from 0. CamelBatchComplete A boolean value indicating the last Exchange in the batch. Is only true for the last entry. This allows you for instance to know how many messages exists in this batch and for instance let the Aggregator aggregate this number of messages. Dependencies Maven users will need to add the following dependency to their pom.xml. pom.xml org.apache.camel camel-aws ${camel-version} where ${camel-version} must be replaced by the actual version of Camel (2.6 or higher). See Also Configuring Camel Component Endpoint Getting Started AWS Component Change Notification Preferences View Online | View Changes | Add Comment
[CONF] Apache Camel > JiBX
JiBX Page edited by Claus Ibsen Changes (2) h2. JiBX *Available as of Camel 2.6* JiBX is a [Data Format] which uses the [JiBX library|http://jibx.sourceforge.net] to marshal and unmarshal Java objects to and from XML. ... If you use maven you could just add the following to your pom.xml, substituting the version number for the latest & greatest release (see [the download page for the latest versions|Download]). {code:xml} org.apache.camel ... Full Content JiBX Available as of Camel 2.6 JiBX is a Data Format which uses the JiBX library to marshal and unmarshal Java objects to and from XML. // lets turn Object messages into XML then send to MQSeries from("activemq:My.Queue"). marshal().jibx(). to("mqseries:Another.Queue"); Please note that marshaling process can recognize the message type at the runtime. However while unmarshaling message from XML we need to specify target class explicitly. // lets turn XML into PurchaseOrder message from("mqseries:Another.Queue"). unmarshal().jibx(PurchaseOrder.class). to("activemq:My.Queue"); JiBX Spring DSL JiBX data format is also supported by Camel Spring DSL. "camel" xmlns="http://camel.apache.org/schema/spring"> "jibx" unmarshallClass="org.apache.camel.dataformat.jibx.PurchaseOrder"/> "direct:marshal"/> "jibx"/> "mock:result"/> "direct:unmarshal"/> "jibx"/> "mock:result"/> Dependencies To use JiBX in your camel routes you need to add the a dependency on camel-jibx which implements this data format. If you use maven you could just add the following to your pom.xml, substituting the version number for the latest & greatest release (see the download page for the latest versions). org.apache.camel camel-jibx 2.6.0 Change Notification Preferences View Online | View Changes | Add Comment
[CONF] Apache Camel > JiBX
JiBX Page moved by Claus Ibsen From: Apache Camel > Index To: Apache Camel > Data Format Children moved Change Notification Preferences View Online | Add Comment
[CONF] Apache Camel > JiBX
JiBX Page edited by Henryk Konsek Changes (2) ... ... ... Full Content JiBX JiBX is a Data Format which uses the JiBX library to marshal and unmarshal Java objects to and from XML. // lets turn Object messages into XML then send to MQSeries from("activemq:My.Queue"). marshal().jibx(). to("mqseries:Another.Queue"); Please note that marshaling process can recognize the message type at the runtime. However while unmarshaling message from XML we need to specify target class explicitly. // lets turn XML into PurchaseOrder message from("mqseries:Another.Queue"). unmarshal().jibx(PurchaseOrder.class). to("activemq:My.Queue"); JiBX Spring DSL JiBX data format is also supported by Camel Spring DSL. "camel" xmlns="http://camel.apache.org/schema/spring"> "jibx" unmarshallClass="org.apache.camel.dataformat.jibx.PurchaseOrder"/> "direct:marshal"/> "jibx"/> "mock:result"/> "direct:unmarshal"/> "jibx"/> "mock:result"/> Dependencies To use JiBX in your camel routes you need to add the a dependency on camel-jibx which implements this data format. If you use maven you could just add the following to your pom.xml, substituting the version number for the latest & greatest release (see the download page for the latest versions). org.apache.camel camel-jibx 2.6.0 Change Notification Preferences View Online | View Changes | Add Comment
[CONF] Apache Camel > Data Format List
Data Format List Page edited by Henryk Konsek Changes (1) ... ** [XmlBeans] ** [XStream] ** [JiBX] * Object/XML/Webservice marshalling ... Full Content Standard JVM object marshalling Serialization String Object marshalling JSON Protobuf Object/XML marshalling Castor JAXB XmlBeans XStream JiBX Object/XML/Webservice marshalling SOAP Flat data structure marshalling Artix Data Services Bindy CSV EDI Flatpack DataFormat Domain specific marshalling HL7 DataFormat Compression GZip data format Zip DataFormat Security Crypto XMLSecurity DataFormat Misc. TidyMarkup Syslog Change Notification Preferences View Online | View Changes | Add Comment
[CONF] Apache Camel > JiBX
JiBX Page edited by Henryk Konsek Changes (2) ... {code} // lets turn Object messages into XML then send to MQSeries // lets turn XML into PurchaseOrder message from("mqseries:Another.Queue"). unmarshal().jibx(PurchaseOrder.class). ... Full Content JiBX JiBX is a Data Format which uses the JiBX library to marshal and unmarshal Java objects to and from XML. // lets turn Object messages into XML then send to MQSeries from("activemq:My.Queue"). marshal().jibx(). to("mqseries:Another.Queue"); Please note that marshaling process can recognize the message type at the runtime. However while unmarshaling message from XML we need to specify target class explicitly. // lets turn XML into PurchaseOrder message from("mqseries:Another.Queue"). unmarshal().jibx(PurchaseOrder.class). to("activemq:My.Queue"); JiBX Spring DSL JiBX data format is also supported by Camel Spring DSL. "camel" xmlns="http://camel.apache.org/schema/spring"> "jibx" unmarshallClass="org.apache.camel.dataformat.jibx.PurchaseOrder"/> "direct:marshal"/> "jibx"/> "mock:result"/> "direct:unmarshal"/> "jibx"/> "mock:result"/> Dependencies To use JiBX in your camel routes you need to add the a dependency on camel-jibx which implements this data format. If you use maven you could just add the following to your pom.xml, substituting the version number for the latest & greatest release (see the download page for the latest versions). org.apache.camel camel-jibx 2.6.0 Change Notification Preferences View Online | View Changes | Add Comment
[CONF] Apache Camel > JiBX
JiBX Page edited by Henryk Konsek Changes (11) ... JiBX is a [Data Format] which uses the [JiBX library|http://jibx.sourceforge.net] to marshal and unmarshal Java objects to and from XML. {code:xml} // lets turn Object messages into XML then send to MQSeries from("activemq:My.Queue"). marshal().jibx(). to("mqseries:Another.Queue"); {code:xml} Please note that marshaling process can recognize the message type at the runtime. However while unmarshaling message from XML we need to specify target class explicitly. {code} // lets turn Object messages into XML then send to MQSeries from("mqseries:Another.Queue"). unmarshal().jibx(PurchaseOrder.class). to("activemq:My.Queue"); {code} h3. JiBX Spring DSL JiBX data format is also supported by Camel Spring DSL. {code:xml} uri="direct:marshall"/> {code} ... Full Content JiBX JiBX is a Data Format which uses the JiBX library to marshal and unmarshal Java objects to and from XML. // lets turn Object messages into XML then send to MQSeries from("activemq:My.Queue"). marshal().jibx(). to("mqseries:Another.Queue"); Please note that marshaling process can recognize the message type at the runtime. However while unmarshaling message from XML we need to specify target class explicitly. // lets turn Object messages into XML then send to MQSeries from("mqseries:Another.Queue"). unmarshal().jibx(PurchaseOrder.class). to("activemq:My.Queue"); JiBX Spring DSL JiBX data format is also supported by Camel Spring DSL. "camel" xmlns="http://camel.apache.org/schema/spring"> "jibx" unmarshallClass="org.apache.camel.dataformat.jibx.PurchaseOrder"/> "direct:marshal"/> "jibx"/> "mock:result"/> "direct:unmarshal"/> "jibx"/> "mock:result"/> Dependencies To use JiBX in your camel routes you need to add the a dependency on camel-jibx which implements this data format. If you use maven you could just add the following to your pom.xml, substituting the version number for the latest & greatest release (see the download page for the latest versions). org.apache.camel camel-jibx 2.6.0 Change Notification Preferences View Online | View Changes | Add Comment
svn commit: r1055550 - /camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java
Author: davsclaus Date: Wed Jan 5 17:39:02 2011 New Revision: 100 URL: http://svn.apache.org/viewvc?rev=100&view=rev Log: CAMEL-3500: Headers on message and properties on Exchange is now using string interning for Camel keys, to reduce memory consumption. Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java?rev=100&r1=1055549&r2=100&view=diff == --- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java Wed Jan 5 17:39:02 2011 @@ -69,7 +69,7 @@ public final class DefaultExchange imple public DefaultExchange(Endpoint fromEndpoint) { this(fromEndpoint, ExchangePattern.InOnly); } - + public DefaultExchange(Endpoint fromEndpoint, ExchangePattern pattern) { this(fromEndpoint.getCamelContext(), pattern); this.fromEndpoint = fromEndpoint; @@ -113,6 +113,8 @@ public final class DefaultExchange imple public Object getProperty(String name) { if (hasProperties()) { +// use intern String for properties which is Camel* properties +// this reduces memory allocations needed for those common properties if (name.startsWith("Camel")) { name = name.intern(); }
[CONF] Apache Camel > Camel 2.5.0 Release
Camel 2.5.0 Release Page edited by Claus Ibsen Changes (1) ... * Setting a custom TaskExecutor on [JMS] component using Spring 2.5 does not work as {{camel-jms}} is compiled against Spring 3.0. See more at [CAMEL-3286|https://issues.apache.org/activemq/browse/CAMEL-3286] * {{markRollbackOnlyLast}} doesn't remove caused exception, which may affect outer transaction to rollback as well. Likewise the logging of {{TransactionErrorHandler}} may log the inner transaction as being committed, when it was in fact rolled back. * [Splitter] using {{parallelProcessing}} may use a lot of memory during processing, see [CAMEL-3497|https://issues.apache.org/jira/browse/CAMEL-3497] ... Full Content Camel 2.5.0 release New and Noteworthy Welcome to the 2.5.0 release which approx 300 issues resolved (new features, improvements and bug fixes such as...) Added suspend/resume operations to CamelContext for warm restarts, or as the preferred way to temporary stop a running Camel application, and then later resume it. Those operations is also available in JMX. Improved management of routes in JMX. You can now suspend/resume routes which support suspension. There is a new removeRoute to remove a route from JMX. Routes with autoStartup=false is now also listed in JMX, to allow you to start the routes manually. The Asynchronous Routing Engine allows to be forced into synchronous mode for certain components, by specifying synchronous=true in the endpoint uri. FTP now supports MSV file systems. The ftp consumer will now traverse the directory structure using a cd , list files in cur dir pattern, as opposed to a list files style. FTP improved support for consuming using absolute paths. Fixed issue with using multiple HTTP endpoints with the only difference being httpClient parameters. Fixed issue with Stream caching and deleting temporary files on Windows. Server thread pool settings can be configured on Jetty component. Easier to configure general HTTP/SSL socket connector properties on Jetty component. Fixed issue with sending an InOut message to Dead Letter Channel would cause Camel to expect a reply. Now the message will always be send to the DLQ as InOnly. Fixed issue when sending to a JMS destination, the option disableReplyTo was not used. Added two new functions to XPath to leverage Properties component and Simple language. Fixed issue when running Jetty server under heavy load throwing IllegalStateException JMS uses Asynchronous Routing Engine for Request Reply messaging over JMS. Fixed issue with a route could mistakenly pick up a route scoped OnException from another route. Fixed an issue with starting CamelContext after it had been shutdown, leading to routes not properly being re-initialized and started. The File and FTP consumers now support using preMove together with either noop or delete options. Added support for timeout in Recipient List, Splitter and Multicast EIPs when running in parallel mode. Added support for 3rd part UuidGenerator. Reverted back to use ActiveMQ UuidGenerator as default generator. Its faster than the previous JavaUuidGenerator, especially in high concurrent systems. Velocity can now find template files from filesystem/classpath when referring to them from other templates. Fixed issue with multiple CamelContext using same id being mixed as single CamelContext in JMX. Camel now fails to start if existing CamelContext already have been registered in the MBeanServer. The Message Filter EIP now stores a property on the Exchange to indicate if it was filtered or not. FTP supports sending site commands after successful login. Simple language can now compare numeric values which was entered as String types. Fixed limitation where PollEnrich could not poll from a file endpoint if the route started from a file endpoint as well. Fixed limitation with Simple language, before you could only use one and or or operator. Now you can use multiple operators in the same _expression_. Restlet component now supports using { } placeholders in uri, which gets replaced with headers from Exchange. Added dynamicRouter to the DSL to make it easier to do dynamic routing using a Bean to evaluate on-the-fly the next destination(s). When sending a JMS message using InOnly but having a JMSReplyTo header configured, then the JmsProducer will lookup/create the JMS Destination to ensure its a valid JMSReplyTo from the header. Endpoint uris containing password is not logged in plaintext, but is now masked. Properties can now leverage Jasypt allowing you to use encrypted values in your properties files. Trimmed down the size of the Web Console reducing the number of jars and removing the groovy experimental editor. It now requires JDK 1.6 to run
svn commit: r1055545 - in /camel/trunk/camel-core/src/main/java/org/apache/camel: impl/DefaultExchange.java util/CaseInsensitiveMap.java
Author: davsclaus Date: Wed Jan 5 17:32:37 2011 New Revision: 1055545 URL: http://svn.apache.org/viewvc?rev=1055545&view=rev Log: CAMEL-3500: Headers on message and properties on Exchange is now using string interning for Camel keys, to reduce memory consumption. Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java camel/trunk/camel-core/src/main/java/org/apache/camel/util/CaseInsensitiveMap.java Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java?rev=1055545&r1=1055544&r2=1055545&view=diff == --- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java Wed Jan 5 17:32:37 2011 @@ -83,7 +83,9 @@ public final class DefaultExchange imple public Exchange copy() { DefaultExchange exchange = new DefaultExchange(this); -exchange.setProperties(safeCopy(getProperties())); +if (hasProperties()) { +exchange.setProperties(safeCopy(getProperties())); +} safeCopy(exchange.getIn(), getIn()); if (hasOut()) { safeCopy(exchange.getOut(), getOut()); @@ -111,16 +113,16 @@ public final class DefaultExchange imple public Object getProperty(String name) { if (hasProperties()) { +if (name.startsWith("Camel")) { +name = name.intern(); +} return properties.get(name); } return null; } public Object getProperty(String name, Object defaultValue) { -Object answer = null; -if (hasProperties()) { -answer = properties.get(name); -} +Object answer = getProperty(name); return answer != null ? answer : defaultValue; } @@ -149,6 +151,11 @@ public final class DefaultExchange imple } public void setProperty(String name, Object value) { +// use intern String for properties which is Camel* properties +// this reduces memory allocations needed for those common properties +if (name != null && name.startsWith("Camel")) { +name = name.intern(); +} if (value != null) { // avoid the NullPointException getProperties().put(name, value); Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/util/CaseInsensitiveMap.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/util/CaseInsensitiveMap.java?rev=1055545&r1=1055544&r2=1055545&view=diff == --- camel/trunk/camel-core/src/main/java/org/apache/camel/util/CaseInsensitiveMap.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/util/CaseInsensitiveMap.java Wed Jan 5 17:32:37 2011 @@ -55,12 +55,12 @@ public class CaseInsensitiveMap extends public CaseInsensitiveMap(int initialCapacity, float loadFactor) { super(initialCapacity, loadFactor); -originalKeys = new HashMap(initialCapacity); +originalKeys = new HashMap(initialCapacity, loadFactor); } public CaseInsensitiveMap(int initialCapacity) { super(initialCapacity); -originalKeys = new HashMap(); +originalKeys = new HashMap(initialCapacity); } @Override @@ -80,15 +80,32 @@ public class CaseInsensitiveMap extends // invalidate views as we mutate entrySetView = null; String s = assembleKey(key); -originalKeys.put(s, key); +if (key.startsWith("Camel")) { +// use intern String for headers which is Camel* headers +// this reduces memory allocations needed for those common headers +originalKeys.put(s, key.intern()); +} else { +originalKeys.put(s, key); +} return super.put(s, value); } @Override public synchronized void putAll(Map map) { +entrySetView = null; if (map != null && !map.isEmpty()) { for (Map.Entry entry : map.entrySet()) { -put(entry.getKey(), entry.getValue()); +String key = entry.getKey(); +Object value = entry.getValue(); +String s = assembleKey(key); +if (key.startsWith("Camel")) { +// use intern String for headers which is Camel* headers +// this reduces memory allocations needed for those common headers +originalKeys.put(s, key.intern()); +} else { +originalKeys.put(s, key); +} +super.put(s, value); } }
[CONF] Apache Camel > JiBX
JiBX Page edited by Henryk Konsek Changes (4) ... JiBX is a [Data Format] which uses the [JiBX library|http://jibx.sourceforge.net] to marshal and unmarshal Java objects to and from XML. {code:xml} // lets turn Object messages into XML then send to MQSeries from("activemq:My.Queue"). marshal().jibx(). to("mqseries:Another.Queue"); {code:xml} h3. JiBX Spring DSL JiBX data format is also supported by Camel Spring DSL. {code} {code} h3. Dependencies ... Full Content JiBX JiBX is a Data Format which uses the JiBX library to marshal and unmarshal Java objects to and from XML. // lets turn Object messages into XML then send to MQSeries from("activemq:My.Queue"). marshal().jibx(). to("mqseries:Another.Queue"); {code:xml} h3. JiBX Spring DSL JiBX data format is also supported by Camel Spring DSL. h3. Dependencies To use JiBX in your camel routes you need to add the a dependency on *camel-jibx* which implements this data format. If you use maven you could just add the following to your pom.xml, substituting the version number for the latest & greatest release (see [the download page for the latest versions|Download]). org.apache.camel camel-jibx 2.6.0 Change Notification Preferences View Online | View Changes | Add Comment
[CONF] Apache Camel > JiBX
JiBX Page edited by Henryk Konsek Changes (7) h2. XStream JiBX XStream JiBX is a [Data Format] which uses the [XStream library|http://xstream.codehaus.org/] [JiBX library|http://jibx.sourceforge.net] to marshal and unmarshal Java objects to and from XML. {code} // lets turn Object messages into XML then send to MQSeries from("activemq:My.Queue"). marshal().xstream(). marshal().jibx(). to("mqseries:Another.Queue"); {code} h3. XMLInputFactory and XMLOutputFactory [The XStream library|http://xstream.codehaus.org/] uses the {{javax.xml.stream.XMLInputFactory}} and {{javax.xml.stream.XMLOutputFactory}}, you can control which implementation of this factory should be used. The Factory is discovered using this algorithm: 1. Use the {{javax.xml.stream.XMLInputFactory}} , {{javax.xml.stream.XMLOutputFactory}} system property. 2. Use the {{lib/xml.stream.properties}} file in the {{JRE_HOME}} directory. 3. Use the Services API, if available, to determine the classname by looking in the {{META-INF/services/javax.xml.stream.XMLInputFactory}}, {{META-INF/services/javax.xml.stream.XMLOutputFactory}} files in jars available to the JRE. 4. Use the platform default XMLInputFactory,XMLOutputFactory instance. h3. How to set the XML encoding in Xstream DataFormat? From Camel 1.6.3 or Camel 2.2.0, you can set the encoding of XML in Xstream DataFormat by setting the Exchange's property with the key {{Exchange.CHARSET_NAME}}, or setting the encoding property on Xstream from DSL or Spring config. {code} from("activemq:My.Queue"). marshal().xstream("UTF-8"). to("mqseries:Another.Queue"); {code} {snippet:id=e1|lang=xml|url="" h3. Dependencies To use XStream JiBX in your camel routes you need to add the a dependency on *camel-xstream* *camel-jibx* which implements this data format. If you use maven you could just add the following to your pom.xml, substituting the version number for the latest & greatest release (see [the download page for the latest versions|Download]). ... org.apache.camel camel-xstream camel-jibx 1.5.0 2.6.0 {code} Full Content JiBX JiBX is a Data Format which uses the JiBX library to marshal and unmarshal Java objects to and from XML. // lets turn Object messages into XML then send to MQSeries from("activemq:My.Queue"). marshal().jibx(). to("mqseries:Another.Queue"); Dependencies To use JiBX in your camel routes you need to add the a dependency on camel-jibx which implements this data format. If you use maven you could just add the following to your pom.xml, substituting the version number for the latest & greatest release (see the download page for the latest versions). org.apache.camel camel-jibx 2.6.0 Change Notification Preferences View Online | View Changes | Add Comment
[CONF] Apache Camel > jibx
jibx Page added by Henryk Konsek XStream XStream is a Data Format which uses the XStream library to marshal and unmarshal Java objects to and from XML. // lets turn Object messages into XML then send to MQSeries from("activemq:My.Queue"). marshal().xstream(). to("mqseries:Another.Queue"); XMLInputFactory and XMLOutputFactory The XStream library uses the javax.xml.stream.XMLInputFactory and javax.xml.stream.XMLOutputFactory, you can control which implementation of this factory should be used. The Factory is discovered using this algorithm: 1. Use the javax.xml.stream.XMLInputFactory , javax.xml.stream.XMLOutputFactory system property. 2. Use the lib/xml.stream.properties file in the JRE_HOME directory. 3. Use the Services API, if available, to determine the classname by looking in the META-INF/services/javax.xml.stream.XMLInputFactory, META-INF/services/javax.xml.stream.XMLOutputFactory files in jars available to the JRE. 4. Use the platform default XMLInputFactory,XMLOutputFactory instance. How to set the XML encoding in Xstream DataFormat? From Camel 1.6.3 or Camel 2.2.0, you can set the encoding of XML in Xstream DataFormat by setting the Exchange's property with the key Exchange.CHARSET_NAME, or setting the encoding property on Xstream from DSL or Spring config. from("activemq:My.Queue"). marshal().xstream("UTF-8"). to("mqseries:Another.Queue"); "camel" xmlns="http://camel.apache.org/schema/spring"> "xstream-utf8" encoding="UTF-8"/> "xstream-default"/> "direct:in"/> "xstream-default"/> "mock:result"/> "direct:in-UTF-8"/> "xstream-utf8"/> "mock:result"/> Dependencies To use XStream in your camel routes you need to add the a dependency on camel-xstream which implements this data format. If you use maven you could just add the following to your pom.xml, substituting the version number for the latest & greatest release (see the download page for the latest versions). org.apache.camel camel-xstream 1.5.0 Change Notification Preferences View Online | Add Comment
svn commit: r1055489 - in /camel/trunk/camel-core/src: main/java/org/apache/camel/util/CaseInsensitiveMap.java test/java/org/apache/camel/util/CaseInsensitiveMapTest.java
Author: davsclaus Date: Wed Jan 5 15:32:33 2011 New Revision: 1055489 URL: http://svn.apache.org/viewvc?rev=1055489&view=rev Log: CAMEL-3500: Headers on message is now using string interning for Camel keys, to reduce memory consumption. Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/util/CaseInsensitiveMap.java camel/trunk/camel-core/src/test/java/org/apache/camel/util/CaseInsensitiveMapTest.java Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/util/CaseInsensitiveMap.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/util/CaseInsensitiveMap.java?rev=1055489&r1=1055488&r2=1055489&view=diff == --- camel/trunk/camel-core/src/main/java/org/apache/camel/util/CaseInsensitiveMap.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/util/CaseInsensitiveMap.java Wed Jan 5 15:32:33 2011 @@ -65,7 +65,7 @@ public class CaseInsensitiveMap extends @Override public Object get(Object key) { -String s = key.toString().toLowerCase(); +String s = assembleKey(key); Object answer = super.get(s); if (answer == null) { // fallback to lookup by original key @@ -79,7 +79,7 @@ public class CaseInsensitiveMap extends public synchronized Object put(String key, Object value) { // invalidate views as we mutate entrySetView = null; -String s = key.toLowerCase(); +String s = assembleKey(key); originalKeys.put(s, key); return super.put(s, value); } @@ -101,7 +101,7 @@ public class CaseInsensitiveMap extends // invalidate views as we mutate entrySetView = null; -String s = key.toString().toLowerCase(); +String s = assembleKey(key); originalKeys.remove(s); return super.remove(s); } @@ -120,10 +120,20 @@ public class CaseInsensitiveMap extends return false; } -String s = key.toString().toLowerCase(); +String s = assembleKey(key); return super.containsKey(s); } +private static String assembleKey(Object key) { +String s = key.toString().toLowerCase(); +if (s.startsWith("camel")) { +// use intern String for headers which is Camel* headers +// this reduces memory allocations needed for those common headers +s = s.intern(); +} +return s; +} + @Override public synchronized Set> entrySet() { if (entrySetView == null) { Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/util/CaseInsensitiveMapTest.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/util/CaseInsensitiveMapTest.java?rev=1055489&r1=1055488&r2=1055489&view=diff == --- camel/trunk/camel-core/src/test/java/org/apache/camel/util/CaseInsensitiveMapTest.java (original) +++ camel/trunk/camel-core/src/test/java/org/apache/camel/util/CaseInsensitiveMapTest.java Wed Jan 5 15:32:33 2011 @@ -20,9 +20,11 @@ import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; +import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; +import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.CountDownLatch; @@ -476,4 +478,38 @@ public class CaseInsensitiveMapTest exte assertEquals("cheese", map.get("cAKe")); } +public void testCopyMapWithCamelHeadersTest() throws Exception { +Map map = new CaseInsensitiveMap(); +map.put("CamelA", "A"); +map.put("CamelB", "B"); +map.put("CamelC", "C"); + +// retain maps so we can profile that the map doesn't duplicate +// camel keys as they are intern +List maps = new ArrayList(); + +for (int i = 0; i < 1; i++) { +Map copy = new CaseInsensitiveMap(map); +assertEquals(3, copy.size()); +assertEquals("A", copy.get("CamelA")); +assertEquals("B", copy.get("CamelB")); +assertEquals("C", copy.get("CamelC")); + +maps.add(copy); +} + +assertEquals(1, maps.size()); + +assertEquals(3, map.size()); +assertEquals("A", map.get("CamelA")); +assertEquals("B", map.get("CamelB")); +assertEquals("C", map.get("CamelC")); + +// use a memory profiler to see memory allocation +// often you may want to give it time to run so you +// have chance to capture memory snapshot in profiler +// Thread.sleep(999); +} + + } \ No newline at end of file
[CONF] Apache Camel > Add New Component Guide
Add New Component Guide Page edited by Tracy Snell Changes (1) ... h2. 7. Add the wiki page Each component requires its own wiki page to document the component. If you don't have the *karma* to edit the wiki pages, plese refer to [how do I edit the website|http://camel.apache.org/how-do-i-edit-the-website.html]. Add the new component wiki page to the [Components|https://cwiki.apache.org/confluence/display/CAMEL/Components] list by editing [Component List|https://cwiki.apache.org/confluence/display/CAMEL/Component+List] wiki page. Add a reference to the new component to the [Manual|https://cwiki.apache.org/confluence/display/CAMEL/Book+Component+Appendix] wiki page. Update the release notes for the version the development is [in progress|https://cwiki.apache.org/confluence/display/CAMEL/In+Progress]. ... Full Content How to add a new component 1. Open an JIRA issue Open a JIRA issue at https://issues.apache.org/jira/browse/CAMEL, if does not already exist. The issue type should be "New Feature". A sample can be found here: https://issues.apache.org/jira/browse/CAMEL-3468 2. Check the license of all dependencies You have to check whether or not all required dependencies have an Apache compatible license. Please refer to Third-Party Licensing Policy for detailed information and acceptable licenses. This doesn't mean, if one of the dependencies are not compatible with the Apache license we can't accept the component. In this case, we might have to add the component to the Camel-Extra repository. 3. Providing a patch If you would like to contribute a new component as a patch (we love contributions), please refer to Contributing (look for Creating patches) for instructions. 3. Add the new component Add the new component into the components pom modules section (note the alphabetical order of the project names). After that, add the new component to the components folder. 4. Check the sources and resources The source and resources have to follow some Apache/Camel coding rules: Make sure every added source and resource contains the Apache license header. Make sure the new component has an adequate test coverage. Run a build with checkstyle to ensure the sources are conform with the Apache Camel coding rules: Building Camel (look for Building with checkstyle) Make sure the log output is adequate on the INFO log level. 5. Check whether all dependencies are available as OSGI bundles If a dependency is not available as an OSGI bundle, ask the Apache Servicemix guys for an OSGI-fied version of this dependency. You should do this by opening a JIRA issue at https://issues.apache.org/jira/browse/SMX4 The issue type should be "Task". A sample can be found here: https://issues.apache.org/jira/browse/SMX4-723 6. Add a new feature Add a new feature definition for this component to the feature file (under platforms/karaf/features). Next, validate the correctness of this feature file as described in Working with features (look for Working with features) 7. Add the wiki page Each component requires its own wiki page to document the component. If you don't have the karma to edit the wiki pages, plese refer to how do I edit the website. Add the new component wiki page to the Components list by editing Component List wiki page. Add a reference to the new component to the Manual wiki page. Update the release notes for the version the development is in progress. Check whether other sites needs to be updated. 8. Run a complete build To ensure you do not break the build, run a complete build from the new component directory: mvn clean install 9. Add the component to distribution Add the new component to the following files parent/pom.xml apache-camel/src/main/descriptors/common-bin.xml Build the kit by running the following maven goal from the apache-camel directory: mvn clean install Check the generated .zip file in the target folder contains the new component. Change Notification Preferences View Online | View Changes | Add Comment
[CONF] Apache Camel > Add New Component Guide
Add New Component Guide Page edited by Tracy Snell Changes (1) ... h2. 7. Add the wiki page Each component requires its own wiki page to document the component. If you don't have the *karma* to edit the wiki pages, plese refer to [how do I edit the website|http://camel.apache.org/how-do-i-edit-the-website.html]. Add the new component wiki page to the [Component List|https://cwiki.apache.org/confluence/display/CAMEL/Component+List] [Components|https://cwiki.apache.org/confluence/display/CAMEL/Components] by editing [Components|https://cwiki.apache.org/confluence/display/CAMEL/Components] [Component List|https://cwiki.apache.org/confluence/display/CAMEL/Component+List] wiki page. Add a reference to the new component to the [Manual|https://cwiki.apache.org/confluence/display/CAMEL/Book+Component+Appendix] wiki page. Update the release notes for the version the development is [in progress|https://cwiki.apache.org/confluence/display/CAMEL/In+Progress]. ... Full Content How to add a new component 1. Open an JIRA issue Open a JIRA issue at https://issues.apache.org/jira/browse/CAMEL, if does not already exist. The issue type should be "New Feature". A sample can be found here: https://issues.apache.org/jira/browse/CAMEL-3468 2. Check the license of all dependencies You have to check whether or not all required dependencies have an Apache compatible license. Please refer to Third-Party Licensing Policy for detailed information and acceptable licenses. This doesn't mean, if one of the dependencies are not compatible with the Apache license we can't accept the component. In this case, we might have to add the component to the Camel-Extra repository. 3. Providing a patch If you would like to contribute a new component as a patch (we love contributions), please refer to Contributing (look for Creating patches) for instructions. 3. Add the new component Add the new component into the components pom modules section (note the alphabetical order of the project names). After that, add the new component to the components folder. 4. Check the sources and resources The source and resources have to follow some Apache/Camel coding rules: Make sure every added source and resource contains the Apache license header. Make sure the new component has an adequate test coverage. Run a build with checkstyle to ensure the sources are conform with the Apache Camel coding rules: Building Camel (look for Building with checkstyle) Make sure the log output is adequate on the INFO log level. 5. Check whether all dependencies are available as OSGI bundles If a dependency is not available as an OSGI bundle, ask the Apache Servicemix guys for an OSGI-fied version of this dependency. You should do this by opening a JIRA issue at https://issues.apache.org/jira/browse/SMX4 The issue type should be "Task". A sample can be found here: https://issues.apache.org/jira/browse/SMX4-723 6. Add a new feature Add a new feature definition for this component to the feature file (under platforms/karaf/features). Next, validate the correctness of this feature file as described in Working with features (look for Working with features) 7. Add the wiki page Each component requires its own wiki page to document the component. If you don't have the karma to edit the wiki pages, plese refer to how do I edit the website. Add the new component wiki page to the Components by editing Component List wiki page. Add a reference to the new component to the Manual wiki page. Update the release notes for the version the development is in progress. Check whether other sites needs to be updated. 8. Run a complete build To ensure you do not break the build, run a complete build from the new component directory: mvn clean install 9. Add the component to distribution Add the new component to the following files parent/pom.xml apache-camel/src/main/descriptors/common-bin.xml Build the kit by running the following maven goal from the apache-camel directory: mvn clean install Check the generated .zip file in the target folder contains the new component. Change Notification Preferences View Online | View Changes | Add Comment
[CONF] Apache Camel > Add New Component Guide
Add New Component Guide Page edited by Tracy Snell Changes (2) ... h2. 7. Add the wiki page Each component requires its own wiki page to document the component. If you don't have the *karma* to edit the wiki pages, plese refer to [how do I edit the website|http://camel.apache.org/how-do-i-edit-the-website.html]. Add the new component wiki page to the [Component List|https://cwiki.apache.org/confluence/display/CAMEL/Component+List] by editing [Components|https://cwiki.apache.org/confluence/display/CAMEL/Components] wiki page. Add a new wiki page under the [Components|https://cwiki.apache.org/confluence/display/CAMEL/Components] wiki page. Add a reference to the new component to the [Manual|https://cwiki.apache.org/confluence/display/CAMEL/Book+Component+Appendix] wiki page. Update the release notes for the version the development is [in progress|https://cwiki.apache.org/confluence/display/CAMEL/In+Progress]. ... Full Content How to add a new component 1. Open an JIRA issue Open a JIRA issue at https://issues.apache.org/jira/browse/CAMEL, if does not already exist. The issue type should be "New Feature". A sample can be found here: https://issues.apache.org/jira/browse/CAMEL-3468 2. Check the license of all dependencies You have to check whether or not all required dependencies have an Apache compatible license. Please refer to Third-Party Licensing Policy for detailed information and acceptable licenses. This doesn't mean, if one of the dependencies are not compatible with the Apache license we can't accept the component. In this case, we might have to add the component to the Camel-Extra repository. 3. Providing a patch If you would like to contribute a new component as a patch (we love contributions), please refer to Contributing (look for Creating patches) for instructions. 3. Add the new component Add the new component into the components pom modules section (note the alphabetical order of the project names). After that, add the new component to the components folder. 4. Check the sources and resources The source and resources have to follow some Apache/Camel coding rules: Make sure every added source and resource contains the Apache license header. Make sure the new component has an adequate test coverage. Run a build with checkstyle to ensure the sources are conform with the Apache Camel coding rules: Building Camel (look for Building with checkstyle) Make sure the log output is adequate on the INFO log level. 5. Check whether all dependencies are available as OSGI bundles If a dependency is not available as an OSGI bundle, ask the Apache Servicemix guys for an OSGI-fied version of this dependency. You should do this by opening a JIRA issue at https://issues.apache.org/jira/browse/SMX4 The issue type should be "Task". A sample can be found here: https://issues.apache.org/jira/browse/SMX4-723 6. Add a new feature Add a new feature definition for this component to the feature file (under platforms/karaf/features). Next, validate the correctness of this feature file as described in Working with features (look for Working with features) 7. Add the wiki page Each component requires its own wiki page to document the component. If you don't have the karma to edit the wiki pages, plese refer to how do I edit the website. Add the new component wiki page to the Component List by editing Components wiki page. Add a reference to the new component to the Manual wiki page. Update the release notes for the version the development is in progress. Check whether other sites needs to be updated. 8. Run a complete build To ensure you do not break the build, run a complete build from the new component directory: mvn clean install 9. Add the component to distribution Add the new component to the following files parent/pom.xml apache-camel/src/main/descriptors/common-bin.xml Build the kit by running the following maven goal from the apache-camel directory: mvn clean install Check the generated .zip file in the target folder contains the new component. Change Notification Preferences View Online | View Changes | Add Comment
[CONF] Apache Camel > Using getIn or getOut methods on Exchange
Using getIn or getOut methods on Exchange Page edited by Christian Schneider Comment: add diagram of message flow and some short summary of what happens on a route Changes (1) ... h2. Flow of an exchange through a route {gliffy:name=Message flow in Route|align=left|size=L|version=23} - The out message from each step is used as the in message for th next step ... Full Content Messsage exchange patterns and the Exchange object The Camel API is influenced by APIs such as JBI specification, CXF which defines a concept called Message Exchange Patterns (MEP for short). The MEP defines the messaging style used such as one-way (InOnly) or request-reply (InOut), which means you have IN and optionally OUT messages. This closely maps to other APIs such as WS, WSDL, REST, JBI and the likes. The Exchange API provides two methods to get a message, either getIn or getOut. Obviously the getIn gets the IN message, and the getOut gets the OUT message. Flow of an exchange through a route The out message from each step is used as the in message for th next step if there is no out message then the in message is used instead For the InOut MEP the out from the last step in the route is returned to the producer. In case of InOnly the last out is thrown away Beware of getOut to check if there is an out messageexchange.getOut creates an out message if there is none. So if you want to check if there is an out message then you should use exchange.hasOut instead Using getIn or getOut methods on Exchange Now suppose you want to use a Camel Processor to adjust a message. This can be done as follows: public void process(Exchange exchange) throws Exception { String body = exchange.getIn().getBody(String.class); // change the message to say Hello exchange.getOut().setBody("Hello " + body); } This seems intuitive and is what you would expect is the right approach to change a message from a Processor. However there is an big issue - the getOut method will create a new Message, which means any other information from the IN message will not be propagated; which means you will lose that data. To remedy this we'll have to copy the data which is done as follows: public void process(Exchange exchange) throws Exception { String body = exchange.getIn().getBody(String.class); // change the message to say Hello exchange.getOut().setBody("Hello " + body); // copy headers from IN to OUT to propagate them exchange.getOut().setHeaders(exchange.getIn().getHeaders(); } Well that is not all, a Message can also contain attachments so to be sure you need to propagate those as well: public void process(Exchange exchange) throws Exception { String body = exchange.getIn().getBody(String.class); // change the message to say Hello exchange.getOut().setBody("Hello " + body); // copy headers from IN to OUT to propagate them exchange.getOut().setHeaders(exchange.getIn().getHeaders(); // copy attachements from IN to OUT to propagate them exchange.getOut().setAttachments(exchange.getIn().getAttachments()); } Now we ensure that all additional data is propagated on the new OUT message. But its a shame we need 2 code lines to ensure data is propagated. What you can do instead is to change the IN message instead, as shown below: public void process(Exchange exchange) throws Exception { String body = exchange.getIn().getBody(String.class); // change the existing message to say Hello exchange.getIn().setBody("Hello " + body); } Consider using getInAs shown above you most often need to alter the existing IN message, than creating a totally new OUT message. And therefore it's often easier just to adjust the IN message directly. Changing the IN message directly is possible in Camel as it don't mind. Camel will detect that the Exchange has no OUT message and therefore use the IN message instead. About Message Exchange Pattern and getOut If the Exchange is using InOnly as the MEP, then you may think that the Exchange has no OUT message. But you can still invoke the getOut method on Exchange; Camel will not barf. So the example code above is possible for any kind of MEP. The MEP is just a flag on the Exchange which the Consumer and Producer adhere to. You can change the MEP on the Exchange using the setPattern method. And likewise there is DSL to change it as well. Change Notification Preferences View Online | View Changes | Add Comment
[CONF] Apache Camel > Using getIn or getOut methods on Exchange
Using getIn or getOut methods on Exchange File attached by Christian Schneider Message flow in Route (8 kB text/xml) - GLIFFY DIAGRAM, ONLY EDIT IN GLIFFY EDITOR! Change Notification Preferences View Attachments
[CONF] Apache Camel > Using getIn or getOut methods on Exchange
Using getIn or getOut methods on Exchange File attached by Christian Schneider Message flow in Route.png (6 kB image/png) - GLIFFY DIAGRAM IMAGE Change Notification Preferences View Attachments
[CONF] Apache Camel > Batch Consumer
Batch Consumer Page edited by Tracy Snell Changes (1) ... - [iBatis] - [JPA] - [SQS|sqs] h3. Consumer Options ... Full Content Batch Consumer Available as of Camel 2.0 Batch Consumer is basically a Polling Consumer that is capable of polling multiple Exchanges in a pool. What we have done in Camel 2.0 is to standardize this into a org.apache.camel.BatchConsumer interface that a consumer can implement to indicate it support batching as well. The following components supports Batch Consumer by its consumer: File FTP Mail iBATIS JPA SQS Consumer Options The Batch Consumer supports the following options: Option Description maxMessagesPerPoll An integer to define a maximum messages to gather per poll. By default no maximum is set. Can be used to set a limit of e.g. 1000 to avoid when starting up the server that there are thousands of files. Set a value of 0 or negative to disabled it. Exchange Properties The following properties is set on the Exchange for each Exchange polled in the same batch. Property Description CamelBatchSize The total number of Exchanges that was polled in this batch. CamelBatchIndex The current index of the batch. Starts from 0. CamelBatchComplete A boolean indicating the last Exchange in the batch. Is only true for the last entry. See Also Polling Consumer Change Notification Preferences View Online | View Changes | Add Comment
[CONF] Apache Camel > Camel 2.6.0 Release
Camel 2.6.0 Release Page edited by Tracy Snell Changes (1) ... * [Pax-Logging] * [Spring Web Services] * [SQS|sqs] h3. New DSL ... Full Content Camel 2.6.0 release (currently in progress) New and Noteworthy Welcome to the 2.6.0 release which approx XXX issues resolved (new features, improvements and bug fixes such as...) Fixed issue in OSGi with refreshing Camel bundles causing a race condition when discovering type converters Introduced ScheduledRoutePolicy with the Quartz component Java DSL RouteBuilder now fails if onException and the likes are not configured before routes, which they must. Easier to debug routes from camel-test using the Debugger Fixed problem installing camel-cxf feature on Apache Karaf. The EIP now supports property placeholders in the String based options (a few spots in Java DSL where its not possible). For example: "String" charset="{{foo.myCharset}}"/> Introduced ScheduledRoutePolicy to allow you to schedule when routes should be active. Introduced stepwise option to FTP component to allow end users to control how to traverse directories of the FTP servers. This allows you to set stepwise=false to return back to the behavior from Camel 2.0 - 2.4. See more at the FTP documentation. Added separator option to FTP component to allow end users to control what path separator to use when uploading files to remote FTP servers. For example if a Windows based FTP server only accept Windows paths, then you can set this option to Windows. Thread names now outputs CamelContext name which makes it easier to differentiate when running multiple Camel applications in the same JVM. Introduced contentCache option to XSLT component to allow easy reloading of stylesheets during development. Improved Camel JMX to always find next free name when registering in JMX and existing name exists (to remedy name clash). This makes it easier when deploying muliple WARs in the same JVM where the Camel applications may have same CamelContext id. In OSGi the name in JMX now has the bundle id as prefix. Fixed BeanShell language Quartz now supports using older versions (eg versions 1.6/1.7) of quartz JARs. The Aggregator EIP will use a synchronous invocation when processing completed aggregated Exchanges, when not running in parallel mode. This ensures no internal task queue is used, which otherwise could stack up tasks and under certain conditions eat up memory. Enable parallelProcessing if you want to use a separate thread for processing completed aggregated Exchanges. LDAP supports paging. CXF and CXFRS use the CXF continuation API when using CXF 2.3.x. You can access the CXF Message from the Camel message header by using the key "CamelCxfMessage" after the CXF consumer. Fixed a rare situation in which an Exchange could be lost during graceful shutdown on the SEDA endpoints, usually more apparent on high volume systems. Improved support for Locale in Bindy for Number and Date formats. Fixed Multicast, Splitter, Recipient List to work as the Pipes and Filters would do, breaking to continue routing if a sub exchange failed and was handled by an Exception Clause. Previously you would have to detect this manually in the AggregationStrategy. Constant fields from Exchange can be referred in the DSL from a String attribute using the class type style. This makes the Java DSL and Spring XML more similar. And you got type safe as Camel throws exception if you had a typo. For example: "Exchange.FILE_NAME">myfile.txt Exchange now contains the creation timestamp when it was created as a java.util.Date object stores as a property with the key Exchange.CREATION_TIMESTAMP Camel fails fast on startup if Load Balancer has been misconfigured, such as configuring two different load balancers in one Fixed markRollbackOnlyLast when used with inner/outer transactions. InterceptStrategy is now default ordered in the order they are added to the CamelContext. However you can dictate the order by implementing the org.apache.camel.util.Ordered interface. Made it easier to load routes from XML files using loadRoutesDefinition method from CamelContext. Added support for custom multipart filters in Jetty. Using Processor or Bean in routes is now also enlisted in JMX for management. The ObjectName for processor in JMX is now always using the node id it has been assigned in the route. Using a custom Processor or Bean will be enlisted in JMX having its custom attributes/operations listed. For example just use the Spring JMX annotations to easily expose the attributes/operations. See more details here. Fixed some issue with the camel-blueprint component. Added features to camel-blueprint component so its on-par with feature set from Spring XML. Fixed FTP
svn commit: r1055455 - in /camel/trunk/tests/camel-itest-osgi: pom.xml src/test/java/org/apache/camel/itest/osgi/jaxb/JaxbDataFormatTest.java src/test/java/org/apache/camel/itest/osgi/jaxb/ObjectFacto
Author: ningjiang Date: Wed Jan 5 13:26:15 2011 New Revision: 1055455 URL: http://svn.apache.org/viewvc?rev=1055455&view=rev Log: CAMEL-3499 Added a new OSGi unit test for test JAXB runtime Added: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jaxb/JaxbDataFormatTest.java (with props) camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jaxb/ObjectFactory.java (with props) Modified: camel/trunk/tests/camel-itest-osgi/pom.xml Modified: camel/trunk/tests/camel-itest-osgi/pom.xml URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/pom.xml?rev=1055455&r1=1055454&r2=1055455&view=diff == --- camel/trunk/tests/camel-itest-osgi/pom.xml (original) +++ camel/trunk/tests/camel-itest-osgi/pom.xml Wed Jan 5 13:26:15 2011 @@ -98,6 +98,11 @@ org.apache.camel + camel-jaxb + test + + + org.apache.camel camel-jpa test Added: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jaxb/JaxbDataFormatTest.java URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jaxb/JaxbDataFormatTest.java?rev=1055455&view=auto == --- camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jaxb/JaxbDataFormatTest.java (added) +++ camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jaxb/JaxbDataFormatTest.java Wed Jan 5 13:26:15 2011 @@ -0,0 +1,82 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.itest.osgi.jaxb; + +import org.apache.camel.builder.RouteBuilder; +import org.apache.camel.component.mock.MockEndpoint; +import org.apache.camel.converter.jaxb.JaxbDataFormat; +import org.apache.camel.itest.osgi.OSGiIntegrationTestSupport; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.ops4j.pax.exam.Option; +import org.ops4j.pax.exam.junit.Configuration; +import org.ops4j.pax.exam.junit.JUnit4TestRunner; + +import static org.ops4j.pax.exam.CoreOptions.equinox; +import static org.ops4j.pax.exam.CoreOptions.felix; +import static org.ops4j.pax.exam.CoreOptions.options; +import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.profile; +import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.scanFeatures; +import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.workingDirectory; + +...@runwith(JUnit4TestRunner.class) +public class JaxbDataFormatTest extends OSGiIntegrationTestSupport { + +protected RouteBuilder createRouteBuilder() throws Exception { +return new RouteBuilder() { +public void configure() { +JaxbDataFormat person = new JaxbDataFormat("org.apache.camel.itest.osgi.jaxb"); +from("direct:start").unmarshal(person).to("mock:bar"); +} +}; +} + +@Test +public void testSendMessage() throws Exception { +MockEndpoint mock = getMandatoryEndpoint("mock:bar", MockEndpoint.class); +assertNotNull("The mock endpoint should not be null", mock); + +PersonType expected = new PersonType(); +expected.setFirstName("FOO"); +expected.setLastName("BAR"); +mock.expectedBodiesReceived(expected); +mock.expectedHeaderReceived("foo", "bar"); +template.sendBodyAndHeader("direct:start", "FOOBAR", + "foo", "bar"); +assertMockEndpointsSatisfied(); +} + +@Configuration +public static Option[] configure() { +Option[] options = options( + +// install the spring dm profile +profile("spring.dm").version("1.2.0"), +// this is how you set the default log level when using pax logging (logProfile) + org.ops4j.pax.exam.CoreOptions.systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("INFO"), + +// using the features to install the camel components +
[CONF] Apache Camel > Camel 2.6.0 Release
Camel 2.6.0 Release Page edited by Tracy Snell Changes (1) ... * [Pax-Logging] * [Spring Web Services] * [SQS] h3. New DSL ... Full Content Camel 2.6.0 release (currently in progress) New and Noteworthy Welcome to the 2.6.0 release which approx XXX issues resolved (new features, improvements and bug fixes such as...) Fixed issue in OSGi with refreshing Camel bundles causing a race condition when discovering type converters Introduced ScheduledRoutePolicy with the Quartz component Java DSL RouteBuilder now fails if onException and the likes are not configured before routes, which they must. Easier to debug routes from camel-test using the Debugger Fixed problem installing camel-cxf feature on Apache Karaf. The EIP now supports property placeholders in the String based options (a few spots in Java DSL where its not possible). For example: "String" charset="{{foo.myCharset}}"/> Introduced ScheduledRoutePolicy to allow you to schedule when routes should be active. Introduced stepwise option to FTP component to allow end users to control how to traverse directories of the FTP servers. This allows you to set stepwise=false to return back to the behavior from Camel 2.0 - 2.4. See more at the FTP documentation. Added separator option to FTP component to allow end users to control what path separator to use when uploading files to remote FTP servers. For example if a Windows based FTP server only accept Windows paths, then you can set this option to Windows. Thread names now outputs CamelContext name which makes it easier to differentiate when running multiple Camel applications in the same JVM. Introduced contentCache option to XSLT component to allow easy reloading of stylesheets during development. Improved Camel JMX to always find next free name when registering in JMX and existing name exists (to remedy name clash). This makes it easier when deploying muliple WARs in the same JVM where the Camel applications may have same CamelContext id. In OSGi the name in JMX now has the bundle id as prefix. Fixed BeanShell language Quartz now supports using older versions (eg versions 1.6/1.7) of quartz JARs. The Aggregator EIP will use a synchronous invocation when processing completed aggregated Exchanges, when not running in parallel mode. This ensures no internal task queue is used, which otherwise could stack up tasks and under certain conditions eat up memory. Enable parallelProcessing if you want to use a separate thread for processing completed aggregated Exchanges. LDAP supports paging. CXF and CXFRS use the CXF continuation API when using CXF 2.3.x. You can access the CXF Message from the Camel message header by using the key "CamelCxfMessage" after the CXF consumer. Fixed a rare situation in which an Exchange could be lost during graceful shutdown on the SEDA endpoints, usually more apparent on high volume systems. Improved support for Locale in Bindy for Number and Date formats. Fixed Multicast, Splitter, Recipient List to work as the Pipes and Filters would do, breaking to continue routing if a sub exchange failed and was handled by an Exception Clause. Previously you would have to detect this manually in the AggregationStrategy. Constant fields from Exchange can be referred in the DSL from a String attribute using the class type style. This makes the Java DSL and Spring XML more similar. And you got type safe as Camel throws exception if you had a typo. For example: "Exchange.FILE_NAME">myfile.txt Exchange now contains the creation timestamp when it was created as a java.util.Date object stores as a property with the key Exchange.CREATION_TIMESTAMP Camel fails fast on startup if Load Balancer has been misconfigured, such as configuring two different load balancers in one Fixed markRollbackOnlyLast when used with inner/outer transactions. InterceptStrategy is now default ordered in the order they are added to the CamelContext. However you can dictate the order by implementing the org.apache.camel.util.Ordered interface. Made it easier to load routes from XML files using loadRoutesDefinition method from CamelContext. Added support for custom multipart filters in Jetty. Using Processor or Bean in routes is now also enlisted in JMX for management. The ObjectName for processor in JMX is now always using the node id it has been assigned in the route. Using a custom Processor or Bean will be enlisted in JMX having its custom attributes/operations listed. For example just use the Spring JMX annotations to easily expose the attributes/operations. See more details here. Fixed some issue with the camel-blueprint component. Added features to camel-blueprint component so its on-par with feature set from Spring XML. Fixed FTP prod
[CONF] Apache Camel > Batch Consumer
Batch Consumer Page edited by Tracy Snell Changes (1) ... - [iBatis] - [JPA] - [SQS] h3. Consumer Options ... Full Content Batch Consumer Available as of Camel 2.0 Batch Consumer is basically a Polling Consumer that is capable of polling multiple Exchanges in a pool. What we have done in Camel 2.0 is to standardize this into a org.apache.camel.BatchConsumer interface that a consumer can implement to indicate it support batching as well. The following components supports Batch Consumer by its consumer: File FTP Mail iBATIS JPA sqs Consumer Options The Batch Consumer supports the following options: Option Description maxMessagesPerPoll An integer to define a maximum messages to gather per poll. By default no maximum is set. Can be used to set a limit of e.g. 1000 to avoid when starting up the server that there are thousands of files. Set a value of 0 or negative to disabled it. Exchange Properties The following properties is set on the Exchange for each Exchange polled in the same batch. Property Description CamelBatchSize The total number of Exchanges that was polled in this batch. CamelBatchIndex The current index of the batch. Starts from 0. CamelBatchComplete A boolean indicating the last Exchange in the batch. Is only true for the last entry. See Also Polling Consumer Change Notification Preferences View Online | View Changes | Add Comment
[CONF] Apache Camel > sqs
sqs Page edited by Tracy Snell Changes (5) h2. sqs SQS Component *Available as of Camel 2.6* The sqs component supports sending and receiving messages to [Amazon's SQS|http://aws.amazon.com/sqs] service. ... {code} h3. URI Options || Name || Default Value || Context || Description || |accessKey | null | Shared | Amazon AWS Access Key | ... h3. Usage h3. Batch Consumer This component implements the [Batch Consumer]. h4. Exchange Properties, sqs consumer only As the sqs consumer is {{BatchConsumer}} it supports batching the messages it polls. By batching it means that Camel will add some properties to the [Exchange] so you know the number of messages polled the current index in that order. {div:class=confluenceTableSmall} || Property || Description || | {{CamelBatchSize}} | The total number of messages that was polled in this batch. | | {{CamelBatchIndex}} | The current index of the batch. Starts from 0. | | {{CamelBatchComplete}} | A {{boolean}} value indicating the last [Exchange] in the batch. Is only {{true}} for the last entry. | {div} This allows you for instance to know how many messages exists in this batch and for instance let the [Aggregator] aggregate this number of messages. h3. Dependencies Maven users will need to add the following dependency to their pom.xml. ... {code} where {{$\{camel-version\}}} must be replaced by the actual version of Camel (2.1.0 (2.6 or higher). {include:Endpoint See Also} ... Full Content SQS Component Available as of Camel 2.6 The sqs component supports sending and receiving messages to Amazon's SQS service. URI Format sqs://queue-name URI Options Name Default Value Context Description accessKey null Shared Amazon AWS Access Key secretKey null Shared Amazon AWS Secret Key deleteAfterRead false Consumer Delete message from SQS after it has been read Usage Batch Consumer This component implements the Batch Consumer. Exchange Properties, sqs consumer only As the sqs consumer is BatchConsumer it supports batching the messages it polls. By batching it means that Camel will add some properties to the Exchange so you know the number of messages polled the current index in that order. Property Description CamelBatchSize The total number of messages that was polled in this batch. CamelBatchIndex The current index of the batch. Starts from 0. CamelBatchComplete A boolean value indicating the last Exchange in the batch. Is only true for the last entry. This allows you for instance to know how many messages exists in this batch and for instance let the Aggregator aggregate this number of messages. Dependencies Maven users will need to add the following dependency to their pom.xml. pom.xml org.apache.camel camel-aws ${camel-version} where ${camel-version} must be replaced by the actual version of Camel (2.6 or higher). See Also Configuring Camel Component Endpoint Getting Started AWS Component Change Notification Preferences View Online | View Changes | Add Comment
[CONF] Apache Camel > sqs
sqs Page edited by Tracy Snell Changes (3) h2. sqs Component The sqs component supports sending and receiving messages to [Amazon's SQS|http://aws.amazon.com/sqs] service. h3. URI Format {code} ... {include:Endpoint See Also} - [Http component|HTTP] - [Servlet component|Servlet] - [AWS Component|aws] Full Content sqs Component The sqs component supports sending and receiving messages to Amazon's SQS service. URI Format sqs://queue-name Options Name Default Value Context Description accessKey null Shared Amazon AWS Access Key secretKey null Shared Amazon AWS Secret Key deleteAfterRead false Consumer Delete message from SQS after it has been read Usage Dependencies Maven users will need to add the following dependency to their pom.xml. pom.xml org.apache.camel camel-aws ${camel-version} where ${camel-version} must be replaced by the actual version of Camel (2.1.0 or higher). See Also Configuring Camel Component Endpoint Getting Started AWS Component Change Notification Preferences View Online | View Changes | Add Comment
[CONF] Apache Camel > sqs
sqs Page added by Tracy Snell sqs Component URI Format sqs://queue-name Options Name Default Value Context Description accessKey null Shared Amazon AWS Access Key secretKey null Shared Amazon AWS Secret Key deleteAfterRead false Consumer Delete message from SQS after it has been read Usage Dependencies Maven users will need to add the following dependency to their pom.xml. pom.xml org.apache.camel camel-aws ${camel-version} where ${camel-version} must be replaced by the actual version of Camel (2.1.0 or higher). See Also Configuring Camel Component Endpoint Getting Started Http component Servlet component Change Notification Preferences View Online | Add Comment
[CONF] Apache Camel > Component List
Component List Page edited by Tracy Snell Changes (3) ... atom:uri {code} | Working with [Apache Abdera|http://incubator.apache.org/abdera/] for atom integration, such as consuming an atom feed. | {show-to:user=tjsnell} | [SQS] / [camel-aws|aws] {code:xml} sqs://queuename[?options] {code} | SQS stuff herer {show-to} {code} | For Messaging with [Amazon's Simple Queue Service (SQS)|http://aws.amazon.com/sqs/]. | | [Bean] / camel-core {code:xml} ... Full Content Component / ArtifactId / URI Description ActiveMQ / activemq-camel activemq:[topic:]destinationName For JMS Messaging with Apache ActiveMQ ActiveMQ Journal / activemq-core activemq.journal:directory-on-filesystem Uses ActiveMQ's fast disk journaling implementation to store message bodies in a rolling log file AMQP / camel-amqp amqp:[topic:]destinationName For Messaging with AMQP protocol Atom / camel-atom atom:uri Working with Apache Abdera for atom integration, such as consuming an atom feed. SQS / camel-aws sqs://queuename[?options] For Messaging with Amazon's Simple Queue Service (SQS). Bean / camel-core bean:beanName[?method=someMethod] Uses the Bean Binding to bind message exchanges to beans in the Registry. Is also used for exposing and invoking POJO (Plain Old Java Objects). Bean Validation / camel-bean-validator bean-validator:something Validates the payload of a message using the Java Validation API (JSR 303 and JAXP Validation) and its reference implementation Hibernate Validator Browse / camel-core browse:someName Provides a simple BrowsableEndpoint which can be useful for testing, visualisation tools or debugging. The exchanges sent to the endpoint are all available to be browsed. Cache / camel-cache cache://cachename[?options] The cache component facilitates creation of caching endpoints and processors using EHCache as the cache implementation. Class / camel-core class:className[?method=someMethod] Uses the Bean Binding to bind message exchanges to beans in the Registry. Is also used for exposing and invoking POJO (Plain Old Java Objects). Cometd / camel-cometd cometd://host:port/channelname Used to deliver messages using the jetty cometd implementation of the bayeux protocol Crypto (Digital Signatures) / camel-crypto crypto:sign:name[?options] crypto:verify:name[?options] Used to sign and verify exchanges using the Signature Service of the Java Cryptographic Extension. CXF / camel-cxf cxf:address[?serviceClass=...] Working with Apache CXF for web services integration CXF Bean / camel-cxf cxf:bean name Proceess the exchange using a JAX WS or JAX RS annotated bean from the registry. Requires less configuration than the above CXF Component CXFRS / camel-cxf cxfrs:address[?resourcesClasses=...] Working with Apache CXF for REST services integration DataSet / camel-core dataset:name For load & soak testing the DataSet provides a way to create huge numbers of messages for sending to Components or asserting that they are consumed correctly Db4o / camel-db4o in camel-extra db4o://className For using a db4o datastore as a queue via the db4o library Direct / camel-core direct:name Synchronous call to another endpoint EJB / camel-ejb ejb:ejbName[?method=someMethod] Uses the Bean Binding to bind message exchanges to EJBs. It works like the Bean component but just for accessing EJBs. Supports EJB 3.0 onwards. Esper / camel-esper in camel-extra esper:name Working with the Esper Library for Event Stream Processing Event / camel-spring event://default spring-event://default Working with Spring ApplicationEvents EventAdmin / camel-eventadmin eventadmin:topic Receiving OSGi EventAdmin events Exec / camel-exec exec://executable[?options] For executing system commands File / camel-core file://nameOfFileOrDirectory Sending messages to a file or polling a file or directory. Camel 1.x use this link File. Flatpack / camel-flatpack flatpack:[fixed|delim]:configFile Processing fixed width or delimited files or messages using the FlatPack library Freemarker / camel-freemarker freemarker:someTemplateResource Generates a response using a Freemarker template FTP / camel-ftp ftp://host[:port]/fileName Sending and receiving files over FTP. Camel 1.x use this link FTP. FTPS / camel-ftp ftps://host[:port]/fileName Sending and receiving files over FTP Secure (TLS and SSL). GAuth / camel-gae gauth://name[?options] Used by web applications to implement an OAuth consumer. See also Camel Components for Goog
[CONF] Apache Camel > aws
aws Page edited by Tracy Snell Changes (1) h2. Camel Components for Amazon Web Services The Camel Components for [Amazon Web Services|http://aws.amazon.com] provide connectivity to AWS services from Camel. ... Full Content Camel Components for Amazon Web Services The Camel Components for Amazon Web Services provide connectivity to AWS services from Camel. AWS service Camel component Component description Simple Queue Service (SQS) sqs Supports sending and receiving messages using SQS Simple Notification Service (SNS) not supported yet Simple Storage Service (S3) not supported yet SimpleDB not supported yet Relational Database Service (RDS) not supported yet Change Notification Preferences View Online | View Changes | Add Comment
[CONF] Apache Camel > aws
aws Page edited by Tracy Snell Changes (1) ... {div:class=confluenceTableSmall} ||AWS service||Camel component||Component description|| |[Simple Queue Service (SQS)|http://aws.amazon.com/sqs/]|[sqs]|Supports sending and receiving messages using SQS| |[Simple Notification Service (SNS)|http://aws.amazon.com/sns/]| |not supported yet| |[Simple Storage Service (S3)|http://aws.amazon.com/s3]| |not supported yet| |[SimpleDB|http://aws.amazon.com/simpledb]| |not supported yet| |[Relational Database Service (RDS)|http://aws.amazon.com/rds| |not supported yet| Full Content Camel Components for Amazon Web Services The Camel Components for Amazon Web Services provide connectivity to AWS from Camel. AWS service Camel component Component description Simple Queue Service (SQS) sqs Supports sending and receiving messages using SQS Simple Notification Service (SNS) not supported yet Simple Storage Service (S3) not supported yet SimpleDB not supported yet [Relational Database Service (RDS) http://aws.amazon.com/rds not supported yet Change Notification Preferences View Online | View Changes | Add Comment
[CONF] Apache Camel > aws
aws Page edited by Tracy Snell Changes (1) ... |[Simple Storage Service (S3)|http://aws.amazon.com/s3]| |not supported yet| |[SimpleDB|http://aws.amazon.com/simpledb]| |not supported yet| |[Relational Database Service (RDS)|http://aws.amazon.com/rds]| |not supported yet| Full Content Camel Components for Amazon Web Services The Camel Components for Amazon Web Services provide connectivity to AWS from Camel. AWS service Camel component Component description Simple Queue Service (SQS) sqs Supports sending and receiving messages using SQS Simple Notification Service (SNS) not supported yet Simple Storage Service (S3) not supported yet SimpleDB not supported yet Relational Database Service (RDS) not supported yet Change Notification Preferences View Online | View Changes | Add Comment
[CONF] Apache Camel > Using getIn or getOut methods on Exchange
Using getIn or getOut methods on Exchange Page edited by Christian Schneider Comment: add diagram of message flow and some short summary of what happens on a route Changes (3) {gliffy:name=Message flow in Route|align=left|size=L|version=2} h2. Messsage exchange patterns and the Exchange object ... Obviously the {{getIn}} gets the IN message, and the {{getOut}} gets the OUT message. h2. Flow of an exchange through a route {gliffy:name=Message flow in Route|align=left|size=L|version=2} - The out message from each step is used as the in message for th next step - if there is no out message then the in message is used instead - For the InOut MEP the out from the last step in the route is returned to the producer. In case of InOnly the last out is thrown away {tip:title=Beware of getOut to check if there is an out message} exchange.getOut creates an out message if there is none. So if you want to check if there is an out message then you should use exchange.hasOut instead {tip} h2. Using getIn or getOut methods on Exchange ... Full Content Messsage exchange patterns and the Exchange object The Camel API is influenced by APIs such as JBI specification, CXF which defines a concept called Message Exchange Patterns (MEP for short). The MEP defines the messaging style used such as one-way (InOnly) or request-reply (InOut), which means you have IN and optionally OUT messages. This closely maps to other APIs such as WS, WSDL, REST, JBI and the likes. The Exchange API provides two methods to get a message, either getIn or getOut. Obviously the getIn gets the IN message, and the getOut gets the OUT message. Flow of an exchange through a route The out message from each step is used as the in message for th next step if there is no out message then the in message is used instead For the InOut MEP the out from the last step in the route is returned to the producer. In case of InOnly the last out is thrown away Beware of getOut to check if there is an out messageexchange.getOut creates an out message if there is none. So if you want to check if there is an out message then you should use exchange.hasOut instead Using getIn or getOut methods on Exchange Now suppose you want to use a Camel Processor to adjust a message. This can be done as follows: public void process(Exchange exchange) throws Exception { String body = exchange.getIn().getBody(String.class); // change the message to say Hello exchange.getOut().setBody("Hello " + body); } This seems intuitive and is what you would expect is the right approach to change a message from a Processor. However there is an big issue - the getOut method will create a new Message, which means any other information from the IN message will not be propagated; which means you will lose that data. To remedy this we'll have to copy the data which is done as follows: public void process(Exchange exchange) throws Exception { String body = exchange.getIn().getBody(String.class); // change the message to say Hello exchange.getOut().setBody("Hello " + body); // copy headers from IN to OUT to propagate them exchange.getOut().setHeaders(exchange.getIn().getHeaders(); } Well that is not all, a Message can also contain attachments so to be sure you need to propagate those as well: public void process(Exchange exchange) throws Exception { String body = exchange.getIn().getBody(String.class); // change the message to say Hello exchange.getOut().setBody("Hello " + body); // copy headers from IN to OUT to propagate them exchange.getOut().setHeaders(exchange.getIn().getHeaders(); // copy attachements from IN to OUT to propagate them exchange.getOut().setAttachments(exchange.getIn().getAttachments()); } Now we ensure that all additional data is propagated on the new OUT message. But its a shame we need 2 code lines to ensure data is propagated. What you can do instead is to change the IN message instead, as shown below: public void process(Exchange exchange) throws Exception { String body = exchange.getIn().getBody(String.class); // change the existing message to say Hello exchange.getIn().setBody("Hello " + body); } Consider using getInAs shown above you most often need to alter the existing IN message, than creating a totally new OUT message. And therefore it's often easier just to adjust the IN message directly. Changing the IN message directly is possible in Camel as it don't mind. Camel will detect that the Exchange has no OUT message and therefore use t
[CONF] Apache Camel > Using getIn or getOut methods on Exchange
Using getIn or getOut methods on Exchange Page edited by Christian Schneider Changes (1) {gliffy:name=Message flow in Route|align=left|size=L|version=12} h2. Messsage exchange patterns and the Exchange object ... Full Content Messsage exchange patterns and the Exchange object The Camel API is influenced by APIs such as JBI specification, CXF which defines a concept called Message Exchange Patterns (MEP for short). The MEP defines the messaging style used such as one-way (InOnly) or request-reply (InOut), which means you have IN and optionally OUT messages. This closely maps to other APIs such as WS, WSDL, REST, JBI and the likes. The Exchange API provides two methods to get a message, either getIn or getOut. Obviously the getIn gets the IN message, and the getOut gets the OUT message. Using getIn or getOut methods on Exchange Now suppose you want to use a Camel Processor to adjust a message. This can be done as follows: public void process(Exchange exchange) throws Exception { String body = exchange.getIn().getBody(String.class); // change the message to say Hello exchange.getOut().setBody("Hello " + body); } This seems intuitive and is what you would expect is the right approach to change a message from a Processor. However there is an big issue - the getOut method will create a new Message, which means any other information from the IN message will not be propagated; which means you will lose that data. To remedy this we'll have to copy the data which is done as follows: public void process(Exchange exchange) throws Exception { String body = exchange.getIn().getBody(String.class); // change the message to say Hello exchange.getOut().setBody("Hello " + body); // copy headers from IN to OUT to propagate them exchange.getOut().setHeaders(exchange.getIn().getHeaders(); } Well that is not all, a Message can also contain attachments so to be sure you need to propagate those as well: public void process(Exchange exchange) throws Exception { String body = exchange.getIn().getBody(String.class); // change the message to say Hello exchange.getOut().setBody("Hello " + body); // copy headers from IN to OUT to propagate them exchange.getOut().setHeaders(exchange.getIn().getHeaders(); // copy attachements from IN to OUT to propagate them exchange.getOut().setAttachments(exchange.getIn().getAttachments()); } Now we ensure that all additional data is propagated on the new OUT message. But its a shame we need 2 code lines to ensure data is propagated. What you can do instead is to change the IN message instead, as shown below: public void process(Exchange exchange) throws Exception { String body = exchange.getIn().getBody(String.class); // change the existing message to say Hello exchange.getIn().setBody("Hello " + body); } Consider using getInAs shown above you most often need to alter the existing IN message, than creating a totally new OUT message. And therefore it's often easier just to adjust the IN message directly. Changing the IN message directly is possible in Camel as it don't mind. Camel will detect that the Exchange has no OUT message and therefore use the IN message instead. About Message Exchange Pattern and getOut If the Exchange is using InOnly as the MEP, then you may think that the Exchange has no OUT message. But you can still invoke the getOut method on Exchange; Camel will not barf. So the example code above is possible for any kind of MEP. The MEP is just a flag on the Exchange which the Consumer and Producer adhere to. You can change the MEP on the Exchange using the setPattern method. And likewise there is DSL to change it as well. Change Notification Preferences View Online | View Changes | Add Comment
[CONF] Apache Camel > Using getIn or getOut methods on Exchange
Using getIn or getOut methods on Exchange File attached by Christian Schneider Message flow in Route.png (6 kB image/png) - GLIFFY DIAGRAM IMAGE Change Notification Preferences View Attachments
[CONF] Apache Camel > Using getIn or getOut methods on Exchange
Using getIn or getOut methods on Exchange File attached by Christian Schneider Message flow in Route (8 kB text/xml) - GLIFFY DIAGRAM, ONLY EDIT IN GLIFFY EDITOR! Change Notification Preferences View Attachments
[CONF] Apache Camel > Using getIn or getOut methods on Exchange
Using getIn or getOut methods on Exchange File attached by Christian Schneider Message flow in Route (0.1 kB text/xml) - GLIFFY DIAGRAM, ONLY EDIT IN GLIFFY EDITOR! Change Notification Preferences View Attachments
[CONF] Apache Camel > Using getIn or getOut methods on Exchange
Using getIn or getOut methods on Exchange Page edited by Christian Schneider Changes (1) {gliffy:name=Message flow in Route|align=left|size=L|version=1} h2. Messsage exchange patterns and the Exchange object ... Full Content Messsage exchange patterns and the Exchange object The Camel API is influenced by APIs such as JBI specification, CXF which defines a concept called Message Exchange Patterns (MEP for short). The MEP defines the messaging style used such as one-way (InOnly) or request-reply (InOut), which means you have IN and optionally OUT messages. This closely maps to other APIs such as WS, WSDL, REST, JBI and the likes. The Exchange API provides two methods to get a message, either getIn or getOut. Obviously the getIn gets the IN message, and the getOut gets the OUT message. Using getIn or getOut methods on Exchange Now suppose you want to use a Camel Processor to adjust a message. This can be done as follows: public void process(Exchange exchange) throws Exception { String body = exchange.getIn().getBody(String.class); // change the message to say Hello exchange.getOut().setBody("Hello " + body); } This seems intuitive and is what you would expect is the right approach to change a message from a Processor. However there is an big issue - the getOut method will create a new Message, which means any other information from the IN message will not be propagated; which means you will lose that data. To remedy this we'll have to copy the data which is done as follows: public void process(Exchange exchange) throws Exception { String body = exchange.getIn().getBody(String.class); // change the message to say Hello exchange.getOut().setBody("Hello " + body); // copy headers from IN to OUT to propagate them exchange.getOut().setHeaders(exchange.getIn().getHeaders(); } Well that is not all, a Message can also contain attachments so to be sure you need to propagate those as well: public void process(Exchange exchange) throws Exception { String body = exchange.getIn().getBody(String.class); // change the message to say Hello exchange.getOut().setBody("Hello " + body); // copy headers from IN to OUT to propagate them exchange.getOut().setHeaders(exchange.getIn().getHeaders(); // copy attachements from IN to OUT to propagate them exchange.getOut().setAttachments(exchange.getIn().getAttachments()); } Now we ensure that all additional data is propagated on the new OUT message. But its a shame we need 2 code lines to ensure data is propagated. What you can do instead is to change the IN message instead, as shown below: public void process(Exchange exchange) throws Exception { String body = exchange.getIn().getBody(String.class); // change the existing message to say Hello exchange.getIn().setBody("Hello " + body); } Consider using getInAs shown above you most often need to alter the existing IN message, than creating a totally new OUT message. And therefore it's often easier just to adjust the IN message directly. Changing the IN message directly is possible in Camel as it don't mind. Camel will detect that the Exchange has no OUT message and therefore use the IN message instead. About Message Exchange Pattern and getOut If the Exchange is using InOnly as the MEP, then you may think that the Exchange has no OUT message. But you can still invoke the getOut method on Exchange; Camel will not barf. So the example code above is possible for any kind of MEP. The MEP is just a flag on the Exchange which the Consumer and Producer adhere to. You can change the MEP on the Exchange using the setPattern method. And likewise there is DSL to change it as well. Change Notification Preferences View Online | View Changes | Add Comment
svn commit: r1055415 - in /camel/trunk/components/camel-soap/src: main/java/org/apache/camel/dataformat/soap/ main/java/org/apache/camel/dataformat/soap/name/ test/java/org/apache/camel/converter/soap
Author: cschneider Date: Wed Jan 5 11:15:58 2011 New Revision: 1055415 URL: http://svn.apache.org/viewvc?rev=1055415&view=rev Log: CAMEL-3133 support void methods and methods without parameters Modified: camel/trunk/components/camel-soap/src/main/java/org/apache/camel/dataformat/soap/SoapJaxbDataFormat.java camel/trunk/components/camel-soap/src/main/java/org/apache/camel/dataformat/soap/name/MethodInfo.java camel/trunk/components/camel-soap/src/main/java/org/apache/camel/dataformat/soap/name/ServiceInterfaceStrategy.java camel/trunk/components/camel-soap/src/test/java/org/apache/camel/converter/soap/name/ServiceInterfaceStrategyTest.java camel/trunk/components/camel-soap/src/test/java/org/apache/camel/dataformat/soap/CustomerServiceImpl.java camel/trunk/components/camel-soap/src/test/java/org/apache/camel/dataformat/soap/SoapClientTest.java camel/trunk/components/camel-soap/src/test/java/org/apache/camel/dataformat/soap/SoapCxfClientTest.java camel/trunk/components/camel-soap/src/test/resources/org/apache/camel/dataformat/soap/CustomerService.wsdl Modified: camel/trunk/components/camel-soap/src/main/java/org/apache/camel/dataformat/soap/SoapJaxbDataFormat.java URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-soap/src/main/java/org/apache/camel/dataformat/soap/SoapJaxbDataFormat.java?rev=1055415&r1=1055414&r2=1055415&view=diff == --- camel/trunk/components/camel-soap/src/main/java/org/apache/camel/dataformat/soap/SoapJaxbDataFormat.java (original) +++ camel/trunk/components/camel-soap/src/main/java/org/apache/camel/dataformat/soap/SoapJaxbDataFormat.java Wed Jan 5 11:15:58 2011 @@ -32,10 +32,12 @@ import javax.xml.namespace.QName; import javax.xml.ws.WebFault; import org.apache.camel.Exchange; +import org.apache.camel.Message; import org.apache.camel.RuntimeCamelException; import org.apache.camel.component.bean.BeanInvocation; import org.apache.camel.converter.jaxb.JaxbDataFormat; import org.apache.camel.dataformat.soap.name.ElementNameStrategy; +import org.apache.camel.dataformat.soap.name.ServiceInterfaceStrategy; import org.apache.camel.dataformat.soap.name.TypeNameStrategy; import org.xmlsoap.schemas.soap.envelope.Body; import org.xmlsoap.schemas.soap.envelope.Detail; @@ -124,10 +126,9 @@ public class SoapJaxbDataFormat extends * is used. */ public void marshal(Exchange exchange, final Object inputObject, OutputStream stream) throws IOException { - checkElementNameStrategy(exchange); -String soapAction = (String) exchange.getIn().getHeader(Exchange.SOAP_ACTION); +String soapAction = getSoapActionFromExchange(exchange); if (soapAction == null && inputObject instanceof BeanInvocation) { BeanInvocation beanInvocation = (BeanInvocation) inputObject; WebMethod webMethod = beanInvocation.getMethod().getAnnotation(WebMethod.class); @@ -169,21 +170,31 @@ public class SoapJaxbDataFormat extends *for name resolution * @return JAXBElement for the body content */ -@SuppressWarnings("unchecked") +@SuppressWarnings({ "unchecked", "rawtypes" }) private JAXBElement createBodyContentFromObject(final Object inputObject, String soapAction) { -Object graph; +Object paramObject; if (inputObject instanceof BeanInvocation) { BeanInvocation bi = (BeanInvocation) inputObject; -if (bi.getArgs().length > 1) { -throw new RuntimeCamelException( -"SoapDataFormat does not work with Beaninvocations that contain more than 1 parameter"); +if (bi.getArgs() == null || bi.getArgs().length == 0) { +paramObject = null; +} else if (bi.getArgs().length == 1) { +paramObject = bi.getArgs()[0]; +} else { +throw new RuntimeCamelException("SoapDataFormat does not work with " ++ "Beaninvocations that contain more than 1 parameter"); } -graph = (bi.getArgs().length == 1) ? bi.getArgs()[0] : null; } else { -graph = inputObject; +paramObject = inputObject; +} +if (paramObject == null) { +return null; } -QName name = elementNameStrategy.findQNameForSoapActionOrType(soapAction, graph.getClass()); -return new JAXBElement(name, graph.getClass(), graph); +QName name = elementNameStrategy.findQNameForSoapActionOrType(soapAction, paramObject.getClass()); +if (name == null) { +// This can happen if a method has no parameter or return type +return null; +} +return new JAXBElement(name, paramObject.getClass(), paramObject); } /** @@ -213,6 +224,7 @@ public class SoapJaxbDataFormat extends
[CONF] Apache Camel > Camel 2.6.0 Release
Camel 2.6.0 Release Page edited by Claus Ibsen Changes (1) ... * Fixed [Jetty] may throw NPE during heavy load. * [JPA] {{JpaTraceEventMessage}} now uses {...@lob}} for fields which may contain a lot of data, such as message body. * Fixed [Bindy] when using quoted CSV records and fixed when using pipeline delimiter. ... Full Content Camel 2.6.0 release (currently in progress) New and Noteworthy Welcome to the 2.6.0 release which approx XXX issues resolved (new features, improvements and bug fixes such as...) Fixed issue in OSGi with refreshing Camel bundles causing a race condition when discovering type converters Introduced ScheduledRoutePolicy with the Quartz component Java DSL RouteBuilder now fails if onException and the likes are not configured before routes, which they must. Easier to debug routes from camel-test using the Debugger Fixed problem installing camel-cxf feature on Apache Karaf. The EIP now supports property placeholders in the String based options (a few spots in Java DSL where its not possible). For example: "String" charset="{{foo.myCharset}}"/> Introduced ScheduledRoutePolicy to allow you to schedule when routes should be active. Introduced stepwise option to FTP component to allow end users to control how to traverse directories of the FTP servers. This allows you to set stepwise=false to return back to the behavior from Camel 2.0 - 2.4. See more at the FTP documentation. Added separator option to FTP component to allow end users to control what path separator to use when uploading files to remote FTP servers. For example if a Windows based FTP server only accept Windows paths, then you can set this option to Windows. Thread names now outputs CamelContext name which makes it easier to differentiate when running multiple Camel applications in the same JVM. Introduced contentCache option to XSLT component to allow easy reloading of stylesheets during development. Improved Camel JMX to always find next free name when registering in JMX and existing name exists (to remedy name clash). This makes it easier when deploying muliple WARs in the same JVM where the Camel applications may have same CamelContext id. In OSGi the name in JMX now has the bundle id as prefix. Fixed BeanShell language Quartz now supports using older versions (eg versions 1.6/1.7) of quartz JARs. The Aggregator EIP will use a synchronous invocation when processing completed aggregated Exchanges, when not running in parallel mode. This ensures no internal task queue is used, which otherwise could stack up tasks and under certain conditions eat up memory. Enable parallelProcessing if you want to use a separate thread for processing completed aggregated Exchanges. LDAP supports paging. CXF and CXFRS use the CXF continuation API when using CXF 2.3.x. You can access the CXF Message from the Camel message header by using the key "CamelCxfMessage" after the CXF consumer. Fixed a rare situation in which an Exchange could be lost during graceful shutdown on the SEDA endpoints, usually more apparent on high volume systems. Improved support for Locale in Bindy for Number and Date formats. Fixed Multicast, Splitter, Recipient List to work as the Pipes and Filters would do, breaking to continue routing if a sub exchange failed and was handled by an Exception Clause. Previously you would have to detect this manually in the AggregationStrategy. Constant fields from Exchange can be referred in the DSL from a String attribute using the class type style. This makes the Java DSL and Spring XML more similar. And you got type safe as Camel throws exception if you had a typo. For example: "Exchange.FILE_NAME">myfile.txt Exchange now contains the creation timestamp when it was created as a java.util.Date object stores as a property with the key Exchange.CREATION_TIMESTAMP Camel fails fast on startup if Load Balancer has been misconfigured, such as configuring two different load balancers in one Fixed markRollbackOnlyLast when used with inner/outer transactions. InterceptStrategy is now default ordered in the order they are added to the CamelContext. However you can dictate the order by implementing the org.apache.camel.util.Ordered interface. Made it easier to load routes from XML files using loadRoutesDefinition method from CamelContext. Added support for custom multipart filters in Jetty. Using Processor or Bean in routes is now also enlisted in JMX for management. The ObjectName for processor in JMX is now always using the node id it has been assigned in the route. Using a custom Processor or Bean will be enlisted in JMX having its custom attributes/operations listed. For example just use the Spring JMX annotations to easily expose the attributes/o
svn commit: r1055373 - in /camel/trunk/components/camel-bindy/src: main/java/org/apache/camel/dataformat/bindy/csv/ test/java/org/apache/camel/dataformat/bindy/csv/ test/java/org/apache/camel/dataform
Author: davsclaus Date: Wed Jan 5 09:29:12 2011 New Revision: 1055373 URL: http://svn.apache.org/viewvc?rev=1055373&view=rev Log: CAMEL-3489: Fixed bindy when using quoted csv records, now it will unquote each token properly. Fixed issue with using pipeline as delimiter as well. Added: camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindyInlinedQuotesCsvUnmarshallTest.java camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindyPipeDelimiterTest.java camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindySingleQuotesCsvUnmarshallTest.java - copied, changed from r1055343, camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindyDoubleQuotesCsvUnmarshallTest.java camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/simple/pipeline/ camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/model/simple/pipeline/MyData.java camel/trunk/components/camel-bindy/src/test/resources/org/apache/camel/dataformat/bindy/csv/BindyInlinedQuotesCsvUnmarshallTest-context.xml camel/trunk/components/camel-bindy/src/test/resources/org/apache/camel/dataformat/bindy/csv/BindySingleQuotesCsvUnmarshallTest-context.xml - copied, changed from r1055343, camel/trunk/components/camel-bindy/src/test/resources/org/apache/camel/dataformat/bindy/csv/BindyDoubleQuotesCsvUnmarshallTest-context.xml Modified: camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/csv/BindyCsvDataFormat.java camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindyDoubleQuotesCsvUnmarshallTest.java Modified: camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/csv/BindyCsvDataFormat.java URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/csv/BindyCsvDataFormat.java?rev=1055373&r1=1055372&r2=1055373&view=diff == --- camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/csv/BindyCsvDataFormat.java (original) +++ camel/trunk/components/camel-bindy/src/main/java/org/apache/camel/dataformat/bindy/csv/BindyCsvDataFormat.java Wed Jan 5 09:29:12 2011 @@ -149,21 +149,12 @@ public class BindyCsvDataFormat extends // Create POJO where CSV data will be stored model = factory.factory(); -// Added for camel- jira ticket -// We will remove the first and last character of the line -// when the separator contains quotes, double quotes -// e.g. ',' or "," ... -// REMARK : We take the assumption that the data fields are -// quoted or double quoted like that -// e.g : "1 ", "street 1, NY", "USA" -if (separator.length() > 1) { -String tempLine = line.substring(1, line.length() - 1); -line = tempLine; -} // Split the CSV record according to the separator defined in // annotated class @CSVRecord String[] tokens = line.split(separator, -1); List result = Arrays.asList(tokens); +// must unquote tokens before use +result = unquoteTokens(result); if (result.size() == 0 || result.isEmpty()) { throw new java.lang.IllegalArgumentException("No records have been defined in the CSV !"); @@ -207,6 +198,23 @@ public class BindyCsvDataFormat extends } +/** + * Unquote the tokens, by removing leading and trailing quote chars + */ +private List unquoteTokens(List result) { +List answer = new ArrayList(result.size()); +for (String s : result) { +if (s.startsWith("\"") || s.startsWith("'")) { +s = s.substring(1); +} +if (s.endsWith("\"") || s.endsWith("'")) { +s = s.substring(0, s.length() - 1); +} +answer.add(s); +} +return answer; +} + protected BindyAbstractFactory createModelFactory(PackageScanClassResolver resolver) throws Exception { return new BindyCsvFactory(resolver, getPackages()); } Modified: camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindyDoubleQuotesCsvUnmarshallTest.java URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-bindy/src/test/java/org/apache/camel/dataformat/bindy/csv/BindyDoubleQuotesCsvUnmarshallTest.java?rev=1055373&r1=1055372&r2=1055373&view=diff == --- camel/tru
[CONF] Apache Camel > Camel 2.6.0 Release
Camel 2.6.0 Release Page edited by Claus Ibsen Changes (3) ... * [Web console] now displays some basic route statistics if [JMX|Camel JMX] is enabled. * Fixed [Jetty] may throw NPE during heavy load. * [JPA] {{JpaTraceEventMessage}} now uses {...@lob}} for fields which may contain a lot of data, such as message body. ... * One may encounter build errors in camel-ftp with java versions older than "1.5.0_24" * Dozer does not work in OSGi * {{camel-script}} which uses {{ScriptEngineManager}} from the JDK, cannot load script engines from packages outside the JDK.* {{camel-script}} which uses {{ScriptEngineManager}} from the JDK, cannot load script engines from packages outside the JDK. ... * The {{mediaSize}} option on [Printer] now uses exact same constants as the Java Printer API. Which means it uses underscores instead of hyphens in the constants. * [JMS] producer has been improved to support {{JMSReplyTo}} for [Exchange] with {{InOnly}} MEP. The {{JMSReplyTo}} will now be provided in the send JMS message. * [JPA] {{JpaTraceEventMessage}} now uses {...@lob}} for fields which may contain a lot of data, such as message body. h2. Getting the Distributions ... Full Content Camel 2.6.0 release (currently in progress) New and Noteworthy Welcome to the 2.6.0 release which approx XXX issues resolved (new features, improvements and bug fixes such as...) Fixed issue in OSGi with refreshing Camel bundles causing a race condition when discovering type converters Introduced ScheduledRoutePolicy with the Quartz component Java DSL RouteBuilder now fails if onException and the likes are not configured before routes, which they must. Easier to debug routes from camel-test using the Debugger Fixed problem installing camel-cxf feature on Apache Karaf. The EIP now supports property placeholders in the String based options (a few spots in Java DSL where its not possible). For example: "String" charset="{{foo.myCharset}}"/> Introduced ScheduledRoutePolicy to allow you to schedule when routes should be active. Introduced stepwise option to FTP component to allow end users to control how to traverse directories of the FTP servers. This allows you to set stepwise=false to return back to the behavior from Camel 2.0 - 2.4. See more at the FTP documentation. Added separator option to FTP component to allow end users to control what path separator to use when uploading files to remote FTP servers. For example if a Windows based FTP server only accept Windows paths, then you can set this option to Windows. Thread names now outputs CamelContext name which makes it easier to differentiate when running multiple Camel applications in the same JVM. Introduced contentCache option to XSLT component to allow easy reloading of stylesheets during development. Improved Camel JMX to always find next free name when registering in JMX and existing name exists (to remedy name clash). This makes it easier when deploying muliple WARs in the same JVM where the Camel applications may have same CamelContext id. In OSGi the name in JMX now has the bundle id as prefix. Fixed BeanShell language Quartz now supports using older versions (eg versions 1.6/1.7) of quartz JARs. The Aggregator EIP will use a synchronous invocation when processing completed aggregated Exchanges, when not running in parallel mode. This ensures no internal task queue is used, which otherwise could stack up tasks and under certain conditions eat up memory. Enable parallelProcessing if you want to use a separate thread for processing completed aggregated Exchanges. LDAP supports paging. CXF and CXFRS use the CXF continuation API when using CXF 2.3.x. You can access the CXF Message from the Camel message header by using the key "CamelCxfMessage" after the CXF consumer. Fixed a rare situation in which an Exchange could be lost during graceful shutdown on the SEDA endpoints, usually more apparent on high volume systems. Improved support for Locale in Bindy for Number and Date formats. Fixed Multicast, Splitter, Recipient List to work as the Pipes and Filters would do, breaking to continue routing if a sub exchange failed and was handled by an Exception Clause. Previously you would have to detect this manually in the AggregationStrategy. Constant fields from Exchange can be referred in the DSL from a String attribute using the class type style. This makes the Java DSL and Spring XML more similar. And you got type safe as Camel throws exception if you had a typo. For example: "Exchange.FILE_NAME">myfile.txt Exchange now contains the creation timestamp when it was created as a java.util.Date object stores as
svn commit: r1055348 - /camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/processor/interceptor/jpa/JpaTraceEventMessage.java
Author: davsclaus Date: Wed Jan 5 08:20:27 2011 New Revision: 1055348 URL: http://svn.apache.org/viewvc?rev=1055348&view=rev Log: CAMEL-3488: JpaTraceEventMessage uses @Lob for fields which can contain a lot of data. Thanks to Marco for patch. Modified: camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/processor/interceptor/jpa/JpaTraceEventMessage.java Modified: camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/processor/interceptor/jpa/JpaTraceEventMessage.java URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/processor/interceptor/jpa/JpaTraceEventMessage.java?rev=1055348&r1=1055347&r2=1055348&view=diff == --- camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/processor/interceptor/jpa/JpaTraceEventMessage.java (original) +++ camel/trunk/components/camel-jpa/src/main/java/org/apache/camel/processor/interceptor/jpa/JpaTraceEventMessage.java Wed Jan 5 08:20:27 2011 @@ -21,6 +21,7 @@ import java.util.Date; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; +import javax.persistence.Lob; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; @@ -126,6 +127,7 @@ public class JpaTraceEventMessage implem this.exchangePattern = exchangePattern; } +@Lob public String getProperties() { return properties; } @@ -134,6 +136,7 @@ public class JpaTraceEventMessage implem this.properties = properties; } +@Lob public String getHeaders() { return headers; } @@ -142,6 +145,7 @@ public class JpaTraceEventMessage implem this.headers = headers; } +@Lob public String getBody() { return body; } @@ -158,6 +162,7 @@ public class JpaTraceEventMessage implem this.bodyType = bodyType; } +@Lob public String getOutBody() { return outBody; } @@ -174,6 +179,7 @@ public class JpaTraceEventMessage implem this.outBodyType = outBodyType; } +@Lob public String getOutHeaders() { return outHeaders; } @@ -182,6 +188,7 @@ public class JpaTraceEventMessage implem this.outHeaders = outHeaders; } +@Lob public String getCausedByException() { return causedByException; }