Camel 1.5.0 release
New and NoteworthyWelcome to the 1.5.0 release which approx 266 issues resolved (new features, improvements and bug fixes such as...)
New Enterprise Integration PatternsNew Components
New DSLNew Annotations
New Data FormatsNew Languages
New ExamplesAPI breakings
Known Issues
Important changes to consider when upgradingProducerTemplateThe ProducerTemplate has refined its sendBody and requestBody methods to throw RuntimeCamelException, with the caused exception wrapper, in case the Exchange failed with an exception. Also if the exchange has set an FAULT message then the FAULT message is returned. The old behavior in Camel 1.4 or older was just plain wrong! JMXOption usePlatformMBeanServer has changed its default value from false to true. TypeConverterAn implementation of TypeConverter should now throw a NoTypeConversionAvailableException if conversion is not possible. The semantical ambiguity of null (both valid result and indication of no conversion) is now resolved, but this may impact existing code in that it should now catch the exception instead of checking for null. setHeader element in Spring DSL changedYou can no longer use a 'value' attribute like this to set a header to a constant: <route> <from uri="seda:a"/> <setHeader headerName="theHeader" value="the value"> <expression/> </setHeader> <to uri="mock:b"/> </route> Now, you can use a Constant expression to do the same thing: <route> <from uri="seda:a"/> <setHeader headerName="theHeader"> <constant>the value</constant> </setHeader> <to uri="mock:b"/> </route> Notice that this constant expression is also possible in the Java DSL: .setHeader("theHeader", constant("the value")) redeliveryPolicy specification in Spring DSL changedInstead of <redeliveryPolicy> <maximumRedeliveries>1</maximumRedeliveries> ... </redeliveryPolicy> You now set redelivery policy settings with attributes
<redeliveryPolicy maximumRedeliveries="1" .../>
Data format specification in Spring DSL changedThe way you specify data formats in the Spring DSL has changed. You could do this in Camel 1.4: <camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring"> <jaxb id="myJaxb" prettyPrint="true" contextPath="org.apache.camel.example"/> <xstream id="xs" prettyPrint="true"/> <route> <from uri="direct:start"/> <marshal ref="myJaxb"/> <to uri="direct:marshalled"/> </route> ... Now, you specify the same as: <camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring"> <dataFormats> <jaxb id="myJaxb" prettyPrint="true" contextPath="org.apache.camel.example"/> <xstream id="xs" prettyPrint="true"/> </dataFormats> <route> <from uri="direct:start"/> <marshal ref="myJaxb"/> <to uri="direct:marshalled"/> </route> ... CXF ProducerThe result of CXF producer has changed to use MessageContentsList instead of Object array to hold the response. CXF Producer before Camel 1.5
Object[] oldResult = (Object[])oldExchange.getOut().getBody();
BankQuote oldQuote = (BankQuote) oldResult[0];
CXF Produer in Camel 1.5
BankQuote oldQuote = oldExchange.getOut().getBody(BankQuote.class);
Now the CXF Producer(in Camel 1.5) will throw the exception after the CXF client gets the exception, in this way you can leverage the Camel errorHandler for handling the exception. You can do it with DSL
protected RouteBuilder createRouteBuilder() {
return new RouteBuilder() {
public void configure() {
errorHandler(noErrorHandler());
from(routerEndpointURI).to("log:org.apache.camel?level=DEBUG").to(serviceEndpointURI);
}
};
}
Or Spring <cxf:cxfEndpoint id="routerEndpoint" address="http://localhost:9003/CamelContext/RouterPort" serviceClass="org.apache.hello_world_soap_http.GreeterImpl"/> <cxf:cxfEndpoint id="serviceEndpoint" address="http://localhost:9000/SoapContext/SoapPort" wsdlURL="testutils/hello_world.wsdl" serviceClass="org.apache.hello_world_soap_http.Greeter" endpointName="s:SoapPort" serviceName="s:SOAPService" xmlns:s="http://apache.org/hello_world_soap_http" /> <camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring"> <route errorHandlerRef="noErrorHandler"> <from uri="cxf:bean:routerEndpoint" /> <to uri="cxf:bean:serviceEndpoint" /> </route> </camelContext> <bean id="noErrorHandler" class="org.apache.camel.builder.NoErrorHandlerBuilder"/> FTP componentThe option consumer.recursive has changed the default value from true to false. Now throws FtpOperationFailedException with the FTP error code and reason. For instance error code 530 is not authorized. This applies for both consumer and producer. The consumer will now also regard failing move or rename operations as a severe error throw a FtpOperationFailedException instead of WARN logging. As a consumer you will not receive an Exchange, as opposed to the situation in Camel 1.4.0. Bottom line: all the FTP operations should succeed before the consumer will process the Exchange. File ConsumerThe option consumer.recursive has changed the default value from true to false. Http ProducerNow the http producer will throw a HttpOperationFailedException if the response code is not 1xx or 2xx. You can get the status code, status line and location for the exception. Http producer has better algorithm to compute if either GET or POST should be used. camel-minaIn Camel 1.5 the sync option has changed its default value from false to true, as we felt it was confusing for end-users when they used Mina to call remote servers and Camel wouldn't wait for the response. To remedy this you had to add the sync=true option before it worked, we want this to work out-of-the-box without having to specify this option. camel-mailIn Camel 1.5 the following default options has changed in camel-mail:
removeOutHeader DSL method removedSince any exchange coming into the removeOutHeader processor would have an IN message only, this method was useless and so was removed. Aggregator and AggregationCollectionThe AggregationCollection used by Aggregator is changed to an interface instead of a class. This allows end-users to provide their own collections that isn't a subclass of the default. The old AggregationCollection class is renamed to DefaultAggregationCollection. Aggregator must be configured directly on the consumer:
Event componentThe event name (scheme) has been renamed to spring-event Getting the DistributionsBinary Distributions
Source Distributions
Getting the Binaries using Maven 2To use this release in your maven project, the proper dependency configuration that you should use in your Maven POM is: <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-core</artifactId> <version>1.5.0</version> </dependency> SVN Tag Checkout
svn co http://svn.apache.org/repos/asf/activemq/camel/tags/camel-1.5.0
ChangelogFor a more detailed view of new features and bug fixes, see: |
