[CONF] Apache Camel ETL Example

2013-10-25 Thread Babak Vahdat (Confluence)







ETL Example
Page edited by Babak Vahdat


 Changes (2)
 




...
{code} @Converter 
public final class CustomerTransformer { 
 private static final Logger LOG = LoggerFactory.getLogger(CustomerTransformer.class);  
private CustomerTransformer() { }  
/**  * A transformation method to convert a person document into a customer 
...


Full Content

Extract Transform Load (ETL) Example 

The ETL (Extract, Transform, Load) example shows how to load data into a database using Camel. In this example we will poll for files, transform them and then store them in the database via the JPA component.

Overview

This example lives in the examples/camel-example-etl directory and will poll for XML files in the child src/data directory. When the files are detected, they are converted, using the fallback JAXB Type Converter to a PersonDocument class. This POJO is then transformed using a custom Type Converter into a CustomerEntity bean using the CustomerTransformer class. Then this bean is stored in the database via the JPA component.

The code for this example is as follows




 Java Class 
 Purpose 


 CustomerEntity 
 The JPA entity bean (i.e. a POJO with @Entity) 


 PersonDocument 
 The JAXB2 POJO used to parse the XML 


 CustomerTransformer 
 The custom Type Converter used to convert a PersonDocument into a CustomerEntity 


 EtlRoutes 
 The Camel routing DSL to define the flow from the files to the converter to the JPA endpoint 





The there is the spring configuration file in src/resources/META-INF/services/camel-context.xml which defines the JPA template and tells Camel to look in the org.apache.camel.example.etl package to find its routes.

Code walkthrough 

So lets start with the route definition in EtlRoutes



public class EtlRoutes extends SpringRouteBuilder {
public void configure() throws Exception {

from("file:src/data?noop=true")
.convertBodyTo(PersonDocument.class)
.to("jpa:org.apache.camel.example.etl.CustomerEntity");

// the following will dump the database to files
from("jpa:org.apache.camel.example.etl.CustomerEntity?consumeDelete=falsedelay=3000consumeLockEntity=false")
.setHeader(Exchange.FILE_NAME, el("${in.body.userName}.xml"))
.to("file:target/customers");
}
}



The above sets up a route from the src/data directory. Notice we're using the noop mode of the File component so that the files are not moved or deleted when they are processed (so when the tool is restarted they will be processed again).

We're converting the body of the message to a PersonDocument which since this POJO as an @XmlRootElement annotation from JAXB will kick in the Type Converter to use JAXB to unmarshall the object.

Then we send the message with a PersonDocument body to the JPA endpoint. Notice how this endpoint specifies the expected type. So the Type Converter is gonna try convert the PersonDocument to a CustomerEntity. Here Camel will find the CustomerTransformer class which has an @Converter method



@Converter
public final class CustomerTransformer {

private static final Logger LOG = LoggerFactory.getLogger(CustomerTransformer.class);

private CustomerTransformer() {
}

/**
 * A transformation method to convert a person document into a customer
 * entity
 */
@Converter
public static CustomerEntity toCustomer(PersonDocument doc, Exchange exchange) throws Exception {
EntityManager entityManager = exchange.getIn().getHeader(JpaConstants.ENTITYMANAGER, EntityManager.class);
TransactionTemplate transactionTemplate = exchange.getContext().getRegistry().lookupByNameAndType("transactionTemplate", TransactionTemplate.class);

String user = doc.getUser();
CustomerEntity customer = findCustomerByName(transactionTemplate, entityManager, user);

// let's convert information from the document into the entity bean
customer.setUserName(user);
customer.setFirstName(doc.getFirstName());
customer.setSurname(doc.getLastName());
customer.setCity(doc.getCity());

LOG.info("Created object customer: {}", customer);
return customer;
}

/**
 * Finds a customer for the given username
 */
private static CustomerEntity findCustomerByName(TransactionTemplate transactionTemplate, final EntityManager entityManager, final String userName) throws Exception {
return transactionTemplate.execute(new TransactionCallbackCustomerEntity() {
public CustomerEntity doInTransaction(TransactionStatus status) {
entityManager.joinTransaction();
ListCustomerEntity list = 

git commit: fixed CS error

2013-10-25 Thread bvahdat
Updated Branches:
  refs/heads/camel-2.12.x 1c17f496a - 5e7c6adbd


fixed CS error


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/5e7c6adb
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/5e7c6adb
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/5e7c6adb

Branch: refs/heads/camel-2.12.x
Commit: 5e7c6adbd00dc7acf01af297c10e47dc783cc8f9
Parents: 1c17f49
Author: cmueller cmuel...@apache.org
Authored: Thu Oct 24 21:19:25 2013 +0200
Committer: Babak Vahdat bvah...@apache.org
Committed: Fri Oct 25 08:10:35 2013 +0200

--
 .../java/org/apache/camel/example/etl/CustomerTransformer.java  | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/5e7c6adb/examples/camel-example-etl/src/main/java/org/apache/camel/example/etl/CustomerTransformer.java
--
diff --git 
a/examples/camel-example-etl/src/main/java/org/apache/camel/example/etl/CustomerTransformer.java
 
b/examples/camel-example-etl/src/main/java/org/apache/camel/example/etl/CustomerTransformer.java
index 06b9c0e76..5f2daff 100644
--- 
a/examples/camel-example-etl/src/main/java/org/apache/camel/example/etl/CustomerTransformer.java
+++ 
b/examples/camel-example-etl/src/main/java/org/apache/camel/example/etl/CustomerTransformer.java
@@ -38,10 +38,13 @@ import 
org.springframework.transaction.support.TransactionTemplate;
  */
 // START SNIPPET: example
 @Converter
-public class CustomerTransformer {
+public final class CustomerTransformer {
 
 private static final Logger LOG = 
LoggerFactory.getLogger(CustomerTransformer.class);
 
+private CustomerTransformer() {
+}
+
 /**
  * A transformation method to convert a person document into a customer
  * entity



[CONF] Apache Camel ETL Example

2013-10-25 Thread Babak Vahdat (Confluence)







ETL Example
Page edited by Babak Vahdat


 Changes (1)
 




...
| [EtlRoutes|https://github.com/apache/camel/blob/master/examples/camel-example-etl/src/main/java/org/apache/camel/example/etl/EtlRoutes.java] | The Camel routing [DSL] to define the flow from the files to the converter to the [JPA] endpoint |  
Then there is the spring configuration file in [src/resources/META-INF/services/camel-context.xml|https://github.com/apache/camel/blob/master/examples/camel-example-etl/src/main/resources/META-INF/spring/camel-context.xml] which defines the JPA template and tells Camel to look in the *org.apache.camel.example.etl* package to find its routes. 
 h3. Code walkthrough  
...


Full Content

Extract Transform Load (ETL) Example 

The ETL (Extract, Transform, Load) example shows how to load data into a database using Camel. In this example we will poll for files, transform them and then store them in the database via the JPA component.

Overview

This example lives in the examples/camel-example-etl directory and will poll for XML files in the child src/data directory. When the files are detected, they are converted, using the fallback JAXB Type Converter to a PersonDocument class. This POJO is then transformed using a custom Type Converter into a CustomerEntity bean using the CustomerTransformer class. Then this bean is stored in the database via the JPA component.

The code for this example is as follows




 Java Class 
 Purpose 


 CustomerEntity 
 The JPA entity bean (i.e. a POJO with @Entity) 


 PersonDocument 
 The JAXB2 POJO used to parse the XML 


 CustomerTransformer 
 The custom Type Converter used to convert a PersonDocument into a CustomerEntity 


 EtlRoutes 
 The Camel routing DSL to define the flow from the files to the converter to the JPA endpoint 





Then there is the spring configuration file in src/resources/META-INF/services/camel-context.xml which defines the JPA template and tells Camel to look in the org.apache.camel.example.etl package to find its routes.

Code walkthrough 

So lets start with the route definition in EtlRoutes



public class EtlRoutes extends SpringRouteBuilder {
public void configure() throws Exception {

from("file:src/data?noop=true")
.convertBodyTo(PersonDocument.class)
.to("jpa:org.apache.camel.example.etl.CustomerEntity");

// the following will dump the database to files
from("jpa:org.apache.camel.example.etl.CustomerEntity?consumeDelete=falsedelay=3000consumeLockEntity=false")
.setHeader(Exchange.FILE_NAME, el("${in.body.userName}.xml"))
.to("file:target/customers");
}
}



The above sets up a route from the src/data directory. Notice we're using the noop mode of the File component so that the files are not moved or deleted when they are processed (so when the tool is restarted they will be processed again).

We're converting the body of the message to a PersonDocument which since this POJO as an @XmlRootElement annotation from JAXB will kick in the Type Converter to use JAXB to unmarshall the object.

Then we send the message with a PersonDocument body to the JPA endpoint. Notice how this endpoint specifies the expected type. So the Type Converter is gonna try convert the PersonDocument to a CustomerEntity. Here Camel will find the CustomerTransformer class which has an @Converter method



@Converter
public final class CustomerTransformer {

private static final Logger LOG = LoggerFactory.getLogger(CustomerTransformer.class);

private CustomerTransformer() {
}

/**
 * A transformation method to convert a person document into a customer
 * entity
 */
@Converter
public static CustomerEntity toCustomer(PersonDocument doc, Exchange exchange) throws Exception {
EntityManager entityManager = exchange.getIn().getHeader(JpaConstants.ENTITYMANAGER, EntityManager.class);
TransactionTemplate transactionTemplate = exchange.getContext().getRegistry().lookupByNameAndType("transactionTemplate", TransactionTemplate.class);

String user = doc.getUser();
CustomerEntity customer = findCustomerByName(transactionTemplate, entityManager, user);

// let's convert information from the document into the entity bean
customer.setUserName(user);
customer.setFirstName(doc.getFirstName());
customer.setSurname(doc.getLastName());
customer.setCity(doc.getCity());

LOG.info("Created object customer: {}", customer);
return customer;
}

/**
 * Finds a customer for the given username
 */
private static CustomerEntity findCustomerByName(TransactionTemplate transactionTemplate, final EntityManager entityManager, 

svn commit: r884031 - in /websites/production/camel/content: cache/main.pageCache etl-example.html

2013-10-25 Thread buildbot
Author: buildbot
Date: Fri Oct 25 06:19:52 2013
New Revision: 884031

Log:
Production update by buildbot for camel

Modified:
websites/production/camel/content/cache/main.pageCache
websites/production/camel/content/etl-example.html

Modified: websites/production/camel/content/cache/main.pageCache
==
Binary files - no diff available.

Modified: websites/production/camel/content/etl-example.html
==
--- websites/production/camel/content/etl-example.html (original)
+++ websites/production/camel/content/etl-example.html Fri Oct 25 06:19:52 2013
@@ -99,7 +99,7 @@
 /div
 
 
-pThe there is the spring configuration file in a shape=rect 
class=external-link 
href=https://github.com/apache/camel/blob/master/examples/camel-example-etl/src/main/resources/META-INF/spring/camel-context.xml;
 rel=nofollowsrc/resources/META-INF/services/camel-context.xml/a which 
defines the JPA template and tells Camel to look in the 
borg.apache.camel.example.etl/b package to find its routes./p
+pThen there is the spring configuration file in a shape=rect 
class=external-link 
href=https://github.com/apache/camel/blob/master/examples/camel-example-etl/src/main/resources/META-INF/spring/camel-context.xml;
 rel=nofollowsrc/resources/META-INF/services/camel-context.xml/a which 
defines the JPA template and tells Camel to look in the 
borg.apache.camel.example.etl/b package to find its routes./p
 
 h3a shape=rect name=ETLExample-Codewalkthrough/aCode walkthrough 
/h3
 
@@ -132,10 +132,13 @@ public class EtlRoutes extends SpringRou
 div class=code panel style=border-width: 1px;div class=codeContent 
panelContent
 script class=theme: Default; brush: java; gutter: false 
type=syntaxhighlighter![CDATA[
 @Converter
-public class CustomerTransformer {
+public final class CustomerTransformer {
 
 private static final Logger LOG = 
LoggerFactory.getLogger(CustomerTransformer.class);
 
+private CustomerTransformer() {
+}
+
 /**
  * A transformation method to convert a person document into a customer
  * entity




[1/2] git commit: Depedendency upgrades

2013-10-25 Thread davsclaus
Updated Branches:
  refs/heads/camel-2.12.x 5e7c6adbd - 2dc879348
  refs/heads/master 599cf88bf - bd0218121


Depedendency upgrades


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/bd021812
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/bd021812
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/bd021812

Branch: refs/heads/master
Commit: bd0218121202629f9980d90248c836443478daeb
Parents: 599cf88
Author: Claus Ibsen davscl...@apache.org
Authored: Fri Oct 25 09:00:35 2013 +0200
Committer: Claus Ibsen davscl...@apache.org
Committed: Fri Oct 25 09:00:35 2013 +0200

--
 parent/pom.xml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/bd021812/parent/pom.xml
--
diff --git a/parent/pom.xml b/parent/pom.xml
index 7a74270..e2635bb 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -36,7 +36,7 @@
 !-- dependency versions --
 abdera-version1.1.3/abdera-version
 !-- Note that activemq dependency is only used for testing! --
-activemq-version5.8.0/activemq-version
+activemq-version5.9.0/activemq-version
 ahc-version1.7.20/ahc-version
 ant-bundle-version1.7.0_6/ant-bundle-version
 antlr-bundle-version3.4_1/antlr-bundle-version
@@ -176,7 +176,7 @@
 hbase-version0.94.10/hbase-version
 hbase-bundle-version0.94.6_1/hbase-bundle-version
 hibernate-validator-version5.0.1.Final/hibernate-validator-version
-hibernate-version4.2.6.Final/hibernate-version
+hibernate-version4.2.7.Final/hibernate-version
 httpunit-version1.7/httpunit-version
 httpcore4-version4.3/httpcore4-version
 httpclient4-version4.3.1/httpclient4-version
@@ -339,7 +339,7 @@
 rhino-version1.7R2/rhino-version
 rome-bundle-version1.0_3/rome-bundle-version
 rome-version1.0/rome-version
-rxjava-version0.14.5/rxjava-version
+rxjava-version0.14.6/rxjava-version
 saaj-impl-version1.3.2_2/saaj-impl-version
 saxon-bundle-version9.5.1-1_1/saxon-bundle-version
 saxon-version9.5.1-2/saxon-version



[2/2] git commit: Depedendency upgrades

2013-10-25 Thread davsclaus
Depedendency upgrades


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/2dc87934
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/2dc87934
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/2dc87934

Branch: refs/heads/camel-2.12.x
Commit: 2dc8793485603d50740427f196f0f1c0864fffa8
Parents: 5e7c6ad
Author: Claus Ibsen davscl...@apache.org
Authored: Fri Oct 25 09:00:35 2013 +0200
Committer: Claus Ibsen davscl...@apache.org
Committed: Fri Oct 25 09:01:48 2013 +0200

--
 parent/pom.xml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/2dc87934/parent/pom.xml
--
diff --git a/parent/pom.xml b/parent/pom.xml
index b7b0fae..49d4650 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -36,7 +36,7 @@
 !-- dependency versions --
 abdera-version1.1.3/abdera-version
 !-- Note that activemq dependency is only used for testing! --
-activemq-version5.8.0/activemq-version
+activemq-version5.9.0/activemq-version
 ahc-version1.7.20/ahc-version
 ant-bundle-version1.7.0_6/ant-bundle-version
 antlr-bundle-version3.4_1/antlr-bundle-version
@@ -176,7 +176,7 @@
 hbase-version0.94.10/hbase-version
 hbase-bundle-version0.94.6_1/hbase-bundle-version
 hibernate-validator-version5.0.1.Final/hibernate-validator-version
-hibernate-version4.2.6.Final/hibernate-version
+hibernate-version4.2.7.Final/hibernate-version
 httpunit-version1.7/httpunit-version
 httpcore4-version4.2.4/httpcore4-version
 httpclient4-version4.2.5/httpclient4-version
@@ -336,7 +336,7 @@
 rhino-version1.7R2/rhino-version
 rome-bundle-version1.0_3/rome-bundle-version
 rome-version1.0/rome-version
-rxjava-version0.14.5/rxjava-version
+rxjava-version0.14.6/rxjava-version
 saaj-impl-version1.3.2_2/saaj-impl-version
 saxon-bundle-version9.5.1-1_1/saxon-bundle-version
 saxon-version9.5.1-2/saxon-version



svn commit: r884036 [2/3] - in /websites/production/camel/content: book-component-appendix.html book-in-one-page.html cache/main.pageCache jms.html

2013-10-25 Thread buildbot
Modified: websites/production/camel/content/book-in-one-page.html
==
--- websites/production/camel/content/book-in-one-page.html (original)
+++ websites/production/camel/content/book-in-one-page.html Fri Oct 25 07:19:34 
2013
@@ -30876,7 +30876,7 @@ In Camel 2.8 onwards, the default settin
 div class=confluenceTableSmall/div
 div class=table-wrap
 table class=confluenceTabletbodytrth colspan=1 rowspan=1 
class=confluenceTh Option /thth colspan=1 rowspan=1 
class=confluenceTh Default Value /thth colspan=1 rowspan=1 
class=confluenceTh Description /th/trtrtd colspan=1 rowspan=1 
class=confluenceTd ttacceptMessagesWhileStopping/tt /tdtd colspan=1 
rowspan=1 class=confluenceTd ttfalse/tt /tdtd colspan=1 
rowspan=1 class=confluenceTd Specifies whether the consumer accept 
messages while it is stopping. You may consider enabling this option, if you 
start and stop a shape=rect href=jms.html title=JMSJMS/a routes at 
runtime, while there are still messages enqued on the queue. If this option is 
ttfalse/tt, and you stop the a shape=rect href=jms.html 
title=JMSJMS/a route, then messages may be rejected, and the JMS broker 
would have to attempt redeliveries, which yet again may be rejected, and 
eventually the message may be moved at a dead lett
 er queue on the JMS broker. To avoid this its recommended to enable this 
option. /td/trtrtd colspan=1 rowspan=1 class=confluenceTd 
ttacknowledgementModeName/tt /tdtd colspan=1 rowspan=1 
class=confluenceTd ttAUTO_ACKNOWLEDGE/tt /tdtd colspan=1 
rowspan=1 class=confluenceTd The JMS acknowledgement name, which is one 
of: ttSESSION_TRANSACTED/tt, ttCLIENT_ACKNOWLEDGE/tt, 
ttAUTO_ACKNOWLEDGE/tt, ttDUPS_OK_ACKNOWLEDGE/tt /td/trtrtd 
colspan=1 rowspan=1 class=confluenceTd ttacknowledgementMode/tt 
/tdtd colspan=1 rowspan=1 class=confluenceTd tt-1/tt /tdtd 
colspan=1 rowspan=1 class=confluenceTd The JMS acknowledgement mode 
defined as an Integer. Allows you to set vendor-specific extensions to the 
acknowledgment mode. For the regular modes, it is preferable to use the 
ttacknowledgementModeName/tt instead. /td/trtrtd colspan=1 
rowspan=1 class=confluenceTd ttallowNullBody/tt /
 tdtd colspan=1 rowspan=1 class=confluenceTd tttrue/tt /tdtd 
colspan=1 rowspan=1 class=confluenceTd bCamel 2.9.3/2.10.1:/b 
Whether to allow sending messages with no body. If this option is 
ttfalse/tt and the message body is null, then an ttJMSException/tt is 
thrown. /td/trtrtd colspan=1 rowspan=1 class=confluenceTd 
ttalwaysCopyMessage/tt /tdtd colspan=1 rowspan=1 
class=confluenceTd ttfalse/tt /tdtd colspan=1 rowspan=1 
class=confluenceTd If tttrue/tt, Camel will always make a JMS message 
copy of the message when it is passed to the producer for sending. Copying the 
message is needed in some situations, such as when a 
ttreplyToDestinationSelectorName/tt is set (incidentally, Camel will set 
the ttalwaysCopyMessage/tt option to tttrue/tt, if a 
ttreplyToDestinationSelectorName/tt is set) /td/trtrtd colspan=1 
rowspan=1 class=confluenceTd ttasyncConsumer/tt /tdtd colspan=1
  rowspan=1 class=confluenceTd ttfalse/tt /tdtd colspan=1 
rowspan=1 class=confluenceTd bCamel 2.9:/b Whether the 
ttJmsConsumer/tt processes the a shape=rect href=exchange.html 
title=ExchangeExchange/a a shape=rect 
href=asynchronous-routing-engine.html title=Asynchronous Routing 
Engineasynchronously/a. If enabled then the ttJmsConsumer/tt may pickup 
the next message from the JMS queue, while the previous message is being 
processed asynchronously (by the a shape=rect 
href=asynchronous-routing-engine.html title=Asynchronous Routing 
EngineAsynchronous Routing Engine/a). This means that messages may be 
processed not 100% strictly in order. If disabled (as default) then the a 
shape=rect href=exchange.html title=ExchangeExchange/a is fully 
processed before the ttJmsConsumer/tt will pickup the next message from the 
JMS queue. Note if tttransacted/tt has been enabled, then 
ttasyncConsumer=true/tt does not run a
 synchronously, as transactions must be executed synchronously (Camel 3.0 may 
support async transactions). /td/trtrtd colspan=1 rowspan=1 
class=confluenceTd ttasyncStartListener/tt /tdtd colspan=1 
rowspan=1 class=confluenceTd ttfalse/tt /tdtd colspan=1 
rowspan=1 class=confluenceTd bCamel 2.10:/b Whether to startup the 
ttJmsConsumer/tt message listener asynchronously, when starting a route. 
For example if a ttJmsConsumer/tt cannot get a connection to a remote JMS 
broker, then it may block while retrying and/or failover. This will cause Camel 
to block while starting routes. By setting this option to tttrue/tt, you 
will let routes startup, while the ttJmsConsumer/tt connects to the JMS 
broker using a dedicated thread in asynchronous mode. If this option is used, 
then beware that if the connection could not be established, then an exception 
is logged at ttWARN/tt level, and the consumer will not be able to receive 
messages
 ; You 

svn commit: r884036 [3/3] - in /websites/production/camel/content: book-component-appendix.html book-in-one-page.html cache/main.pageCache jms.html

2013-10-25 Thread buildbot
Modified: websites/production/camel/content/jms.html
==
--- websites/production/camel/content/jms.html (original)
+++ websites/production/camel/content/jms.html Fri Oct 25 07:19:34 2013
@@ -201,7 +201,7 @@ In Camel 2.8 onwards, the default settin
 div class=confluenceTableSmall/div
 div class=table-wrap
 table class=confluenceTabletbodytrth colspan=1 rowspan=1 
class=confluenceTh Option /thth colspan=1 rowspan=1 
class=confluenceTh Default Value /thth colspan=1 rowspan=1 
class=confluenceTh Description /th/trtrtd colspan=1 rowspan=1 
class=confluenceTd ttacceptMessagesWhileStopping/tt /tdtd colspan=1 
rowspan=1 class=confluenceTd ttfalse/tt /tdtd colspan=1 
rowspan=1 class=confluenceTd Specifies whether the consumer accept 
messages while it is stopping. You may consider enabling this option, if you 
start and stop a shape=rect href=jms.html title=JMSJMS/a routes at 
runtime, while there are still messages enqued on the queue. If this option is 
ttfalse/tt, and you stop the a shape=rect href=jms.html 
title=JMSJMS/a route, then messages may be rejected, and the JMS broker 
would have to attempt redeliveries, which yet again may be rejected, and 
eventually the message may be moved at a dead lett
 er queue on the JMS broker. To avoid this its recommended to enable this 
option. /td/trtrtd colspan=1 rowspan=1 class=confluenceTd 
ttacknowledgementModeName/tt /tdtd colspan=1 rowspan=1 
class=confluenceTd ttAUTO_ACKNOWLEDGE/tt /tdtd colspan=1 
rowspan=1 class=confluenceTd The JMS acknowledgement name, which is one 
of: ttSESSION_TRANSACTED/tt, ttCLIENT_ACKNOWLEDGE/tt, 
ttAUTO_ACKNOWLEDGE/tt, ttDUPS_OK_ACKNOWLEDGE/tt /td/trtrtd 
colspan=1 rowspan=1 class=confluenceTd ttacknowledgementMode/tt 
/tdtd colspan=1 rowspan=1 class=confluenceTd tt-1/tt /tdtd 
colspan=1 rowspan=1 class=confluenceTd The JMS acknowledgement mode 
defined as an Integer. Allows you to set vendor-specific extensions to the 
acknowledgment mode. For the regular modes, it is preferable to use the 
ttacknowledgementModeName/tt instead. /td/trtrtd colspan=1 
rowspan=1 class=confluenceTd ttallowNullBody/tt /
 tdtd colspan=1 rowspan=1 class=confluenceTd tttrue/tt /tdtd 
colspan=1 rowspan=1 class=confluenceTd bCamel 2.9.3/2.10.1:/b 
Whether to allow sending messages with no body. If this option is 
ttfalse/tt and the message body is null, then an ttJMSException/tt is 
thrown. /td/trtrtd colspan=1 rowspan=1 class=confluenceTd 
ttalwaysCopyMessage/tt /tdtd colspan=1 rowspan=1 
class=confluenceTd ttfalse/tt /tdtd colspan=1 rowspan=1 
class=confluenceTd If tttrue/tt, Camel will always make a JMS message 
copy of the message when it is passed to the producer for sending. Copying the 
message is needed in some situations, such as when a 
ttreplyToDestinationSelectorName/tt is set (incidentally, Camel will set 
the ttalwaysCopyMessage/tt option to tttrue/tt, if a 
ttreplyToDestinationSelectorName/tt is set) /td/trtrtd colspan=1 
rowspan=1 class=confluenceTd ttasyncConsumer/tt /tdtd colspan=1
  rowspan=1 class=confluenceTd ttfalse/tt /tdtd colspan=1 
rowspan=1 class=confluenceTd bCamel 2.9:/b Whether the 
ttJmsConsumer/tt processes the a shape=rect href=exchange.html 
title=ExchangeExchange/a a shape=rect 
href=asynchronous-routing-engine.html title=Asynchronous Routing 
Engineasynchronously/a. If enabled then the ttJmsConsumer/tt may pickup 
the next message from the JMS queue, while the previous message is being 
processed asynchronously (by the a shape=rect 
href=asynchronous-routing-engine.html title=Asynchronous Routing 
EngineAsynchronous Routing Engine/a). This means that messages may be 
processed not 100% strictly in order. If disabled (as default) then the a 
shape=rect href=exchange.html title=ExchangeExchange/a is fully 
processed before the ttJmsConsumer/tt will pickup the next message from the 
JMS queue. Note if tttransacted/tt has been enabled, then 
ttasyncConsumer=true/tt does not run a
 synchronously, as transactions must be executed synchronously (Camel 3.0 may 
support async transactions). /td/trtrtd colspan=1 rowspan=1 
class=confluenceTd ttasyncStartListener/tt /tdtd colspan=1 
rowspan=1 class=confluenceTd ttfalse/tt /tdtd colspan=1 
rowspan=1 class=confluenceTd bCamel 2.10:/b Whether to startup the 
ttJmsConsumer/tt message listener asynchronously, when starting a route. 
For example if a ttJmsConsumer/tt cannot get a connection to a remote JMS 
broker, then it may block while retrying and/or failover. This will cause Camel 
to block while starting routes. By setting this option to tttrue/tt, you 
will let routes startup, while the ttJmsConsumer/tt connects to the JMS 
broker using a dedicated thread in asynchronous mode. If this option is used, 
then beware that if the connection could not be established, then an exception 
is logged at ttWARN/tt level, and the consumer will not be able to receive 
messages
 ; You can then restart the route to retry. 

svn commit: r884036 [1/3] - in /websites/production/camel/content: book-component-appendix.html book-in-one-page.html cache/main.pageCache jms.html

2013-10-25 Thread buildbot
Author: buildbot
Date: Fri Oct 25 07:19:34 2013
New Revision: 884036

Log:
Production update by buildbot for camel

Modified:
websites/production/camel/content/book-component-appendix.html
websites/production/camel/content/book-in-one-page.html
websites/production/camel/content/cache/main.pageCache
websites/production/camel/content/jms.html

Modified: websites/production/camel/content/book-component-appendix.html
==
--- websites/production/camel/content/book-component-appendix.html (original)
+++ websites/production/camel/content/book-component-appendix.html Fri Oct 25 
07:19:34 2013
@@ -9355,7 +9355,7 @@ In Camel 2.8 onwards, the default settin
 div class=confluenceTableSmall/div
 div class=table-wrap
 table class=confluenceTabletbodytrth colspan=1 rowspan=1 
class=confluenceTh Option /thth colspan=1 rowspan=1 
class=confluenceTh Default Value /thth colspan=1 rowspan=1 
class=confluenceTh Description /th/trtrtd colspan=1 rowspan=1 
class=confluenceTd ttacceptMessagesWhileStopping/tt /tdtd colspan=1 
rowspan=1 class=confluenceTd ttfalse/tt /tdtd colspan=1 
rowspan=1 class=confluenceTd Specifies whether the consumer accept 
messages while it is stopping. You may consider enabling this option, if you 
start and stop a shape=rect href=jms.html title=JMSJMS/a routes at 
runtime, while there are still messages enqued on the queue. If this option is 
ttfalse/tt, and you stop the a shape=rect href=jms.html 
title=JMSJMS/a route, then messages may be rejected, and the JMS broker 
would have to attempt redeliveries, which yet again may be rejected, and 
eventually the message may be moved at a dead lett
 er queue on the JMS broker. To avoid this its recommended to enable this 
option. /td/trtrtd colspan=1 rowspan=1 class=confluenceTd 
ttacknowledgementModeName/tt /tdtd colspan=1 rowspan=1 
class=confluenceTd ttAUTO_ACKNOWLEDGE/tt /tdtd colspan=1 
rowspan=1 class=confluenceTd The JMS acknowledgement name, which is one 
of: ttSESSION_TRANSACTED/tt, ttCLIENT_ACKNOWLEDGE/tt, 
ttAUTO_ACKNOWLEDGE/tt, ttDUPS_OK_ACKNOWLEDGE/tt /td/trtrtd 
colspan=1 rowspan=1 class=confluenceTd ttacknowledgementMode/tt 
/tdtd colspan=1 rowspan=1 class=confluenceTd tt-1/tt /tdtd 
colspan=1 rowspan=1 class=confluenceTd The JMS acknowledgement mode 
defined as an Integer. Allows you to set vendor-specific extensions to the 
acknowledgment mode. For the regular modes, it is preferable to use the 
ttacknowledgementModeName/tt instead. /td/trtrtd colspan=1 
rowspan=1 class=confluenceTd ttallowNullBody/tt /
 tdtd colspan=1 rowspan=1 class=confluenceTd tttrue/tt /tdtd 
colspan=1 rowspan=1 class=confluenceTd bCamel 2.9.3/2.10.1:/b 
Whether to allow sending messages with no body. If this option is 
ttfalse/tt and the message body is null, then an ttJMSException/tt is 
thrown. /td/trtrtd colspan=1 rowspan=1 class=confluenceTd 
ttalwaysCopyMessage/tt /tdtd colspan=1 rowspan=1 
class=confluenceTd ttfalse/tt /tdtd colspan=1 rowspan=1 
class=confluenceTd If tttrue/tt, Camel will always make a JMS message 
copy of the message when it is passed to the producer for sending. Copying the 
message is needed in some situations, such as when a 
ttreplyToDestinationSelectorName/tt is set (incidentally, Camel will set 
the ttalwaysCopyMessage/tt option to tttrue/tt, if a 
ttreplyToDestinationSelectorName/tt is set) /td/trtrtd colspan=1 
rowspan=1 class=confluenceTd ttasyncConsumer/tt /tdtd colspan=1
  rowspan=1 class=confluenceTd ttfalse/tt /tdtd colspan=1 
rowspan=1 class=confluenceTd bCamel 2.9:/b Whether the 
ttJmsConsumer/tt processes the a shape=rect href=exchange.html 
title=ExchangeExchange/a a shape=rect 
href=asynchronous-routing-engine.html title=Asynchronous Routing 
Engineasynchronously/a. If enabled then the ttJmsConsumer/tt may pickup 
the next message from the JMS queue, while the previous message is being 
processed asynchronously (by the a shape=rect 
href=asynchronous-routing-engine.html title=Asynchronous Routing 
EngineAsynchronous Routing Engine/a). This means that messages may be 
processed not 100% strictly in order. If disabled (as default) then the a 
shape=rect href=exchange.html title=ExchangeExchange/a is fully 
processed before the ttJmsConsumer/tt will pickup the next message from the 
JMS queue. Note if tttransacted/tt has been enabled, then 
ttasyncConsumer=true/tt does not run a
 synchronously, as transactions must be executed synchronously (Camel 3.0 may 
support async transactions). /td/trtrtd colspan=1 rowspan=1 
class=confluenceTd ttasyncStartListener/tt /tdtd colspan=1 
rowspan=1 class=confluenceTd ttfalse/tt /tdtd colspan=1 
rowspan=1 class=confluenceTd bCamel 2.10:/b Whether to startup the 
ttJmsConsumer/tt message listener asynchronously, when starting a route. 
For example if a ttJmsConsumer/tt cannot get a connection to a remote JMS 
broker, then it may block while retrying and/or failover. This will cause Camel 
to block while 

[2/4] git commit: Merge branch 'master' of https://github.com/ctamisier/camel

2013-10-25 Thread davsclaus
Merge branch 'master' of https://github.com/ctamisier/camel


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/d805749e
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/d805749e
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/d805749e

Branch: refs/heads/master
Commit: d805749e8f991a61354f9bbd84cc1456b01e14f8
Parents: bd021812 49c2e91
Author: Claus Ibsen davscl...@apache.org
Authored: Fri Oct 25 09:46:38 2013 +0200
Committer: Claus Ibsen davscl...@apache.org
Committed: Fri Oct 25 09:46:38 2013 +0200

--
 .../apache/camel/component/servlet/CamelHttpTransportServlet.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--




[4/4] git commit: typo Servet

2013-10-25 Thread davsclaus
typo Servet


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/321543a5
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/321543a5
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/321543a5

Branch: refs/heads/camel-2.11.x
Commit: 321543a54095bd7f1651ad8794a76d05d0bb180e
Parents: e7e62e2
Author: Clément Tamisier clement.tamis...@gmail.com
Authored: Fri Oct 25 12:23:40 2013 +0800
Committer: Claus Ibsen davscl...@apache.org
Committed: Fri Oct 25 09:47:19 2013 +0200

--
 .../apache/camel/component/servlet/CamelHttpTransportServlet.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/321543a5/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/CamelHttpTransportServlet.java
--
diff --git 
a/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/CamelHttpTransportServlet.java
 
b/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/CamelHttpTransportServlet.java
index b727070..12ee697 100644
--- 
a/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/CamelHttpTransportServlet.java
+++ 
b/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/CamelHttpTransportServlet.java
@@ -57,7 +57,7 @@ public class CamelHttpTransportServlet extends CamelServlet {
 httpRegistry = DefaultHttpRegistry.getHttpRegistry(name);
 CamelServlet existing = httpRegistry.getCamelServlet(name);
 if (existing != null) {
-String msg = Duplicate ServetName detected:  + name + . 
Existing:  + existing +  This:  + this.toString()
+String msg = Duplicate ServletName detected:  + name + . 
Existing:  + existing +  This:  + this.toString()
 + . Its advised to use unique ServletName per Camel 
application.;
 // always log so people can see it easier
 if (isIgnoreDuplicateServletName()) {



[1/4] git commit: typo Servet

2013-10-25 Thread davsclaus
Updated Branches:
  refs/heads/camel-2.11.x e7e62e2c6 - 321543a54
  refs/heads/camel-2.12.x 2dc879348 - 3ea4614f3
  refs/heads/master bd0218121 - d805749e8


typo Servet

Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/49c2e919
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/49c2e919
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/49c2e919

Branch: refs/heads/master
Commit: 49c2e919ee28c5e15a495e5164a6ea29db318da3
Parents: 8b78963
Author: Clément Tamisier clement.tamis...@gmail.com
Authored: Fri Oct 25 12:23:40 2013 +0800
Committer: Clément Tamisier clement.tamis...@gmail.com
Committed: Fri Oct 25 12:23:40 2013 +0800

--
 .../apache/camel/component/servlet/CamelHttpTransportServlet.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/49c2e919/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/CamelHttpTransportServlet.java
--
diff --git 
a/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/CamelHttpTransportServlet.java
 
b/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/CamelHttpTransportServlet.java
index 8c30492..f064136 100644
--- 
a/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/CamelHttpTransportServlet.java
+++ 
b/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/CamelHttpTransportServlet.java
@@ -57,7 +57,7 @@ public class CamelHttpTransportServlet extends CamelServlet {
 httpRegistry = DefaultHttpRegistry.getHttpRegistry(name);
 CamelServlet existing = httpRegistry.getCamelServlet(name);
 if (existing != null) {
-String msg = Duplicate ServetName detected:  + name + . 
Existing:  + existing +  This:  + this.toString()
+String msg = Duplicate ServletName detected:  + name + . 
Existing:  + existing +  This:  + this.toString()
 + . Its advised to use unique ServletName per Camel 
application.;
 // always log so people can see it easier
 if (isIgnoreDuplicateServletName()) {



[3/4] git commit: typo Servet

2013-10-25 Thread davsclaus
typo Servet


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/3ea4614f
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/3ea4614f
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/3ea4614f

Branch: refs/heads/camel-2.12.x
Commit: 3ea4614f39e7cc0a5c1f95a5a8d4f6397ab39233
Parents: 2dc8793
Author: Clément Tamisier clement.tamis...@gmail.com
Authored: Fri Oct 25 12:23:40 2013 +0800
Committer: Claus Ibsen davscl...@apache.org
Committed: Fri Oct 25 09:47:05 2013 +0200

--
 .../apache/camel/component/servlet/CamelHttpTransportServlet.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/3ea4614f/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/CamelHttpTransportServlet.java
--
diff --git 
a/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/CamelHttpTransportServlet.java
 
b/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/CamelHttpTransportServlet.java
index 8c30492..f064136 100644
--- 
a/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/CamelHttpTransportServlet.java
+++ 
b/components/camel-servlet/src/main/java/org/apache/camel/component/servlet/CamelHttpTransportServlet.java
@@ -57,7 +57,7 @@ public class CamelHttpTransportServlet extends CamelServlet {
 httpRegistry = DefaultHttpRegistry.getHttpRegistry(name);
 CamelServlet existing = httpRegistry.getCamelServlet(name);
 if (existing != null) {
-String msg = Duplicate ServetName detected:  + name + . 
Existing:  + existing +  This:  + this.toString()
+String msg = Duplicate ServletName detected:  + name + . 
Existing:  + existing +  This:  + this.toString()
 + . Its advised to use unique ServletName per Camel 
application.;
 // always log so people can see it easier
 if (isIgnoreDuplicateServletName()) {



git commit: Added some missing asserts by JmsEndpointConfigurationTest#testDefaultEndpointOptions() and polished the pre-existing ones.

2013-10-25 Thread bvahdat
Updated Branches:
  refs/heads/master d805749e8 - a4722b588


Added some missing asserts by 
JmsEndpointConfigurationTest#testDefaultEndpointOptions() and polished the 
pre-existing ones.

Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/a4722b58
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/a4722b58
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/a4722b58

Branch: refs/heads/master
Commit: a4722b588a584aa904e2075db626dde08cb0ff42
Parents: d805749
Author: Babak Vahdat bvah...@apache.org
Authored: Fri Oct 25 11:00:07 2013 +0200
Committer: Babak Vahdat bvah...@apache.org
Committed: Fri Oct 25 11:00:07 2013 +0200

--
 .../jms/JmsEndpointConfigurationTest.java   | 123 +++
 1 file changed, 74 insertions(+), 49 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/a4722b58/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsEndpointConfigurationTest.java
--
diff --git 
a/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsEndpointConfigurationTest.java
 
b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsEndpointConfigurationTest.java
index 5f779b9..bda3098 100644
--- 
a/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsEndpointConfigurationTest.java
+++ 
b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsEndpointConfigurationTest.java
@@ -25,9 +25,11 @@ import org.apache.activemq.ActiveMQConnectionFactory;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.Exchange;
+import org.apache.camel.LoggingLevel;
 import org.apache.camel.Processor;
 import org.apache.camel.Producer;
 import org.apache.camel.ResolveEndpointFailedException;
+import org.apache.camel.ServiceStatus;
 import org.apache.camel.impl.JndiRegistry;
 import org.apache.camel.test.junit4.CamelTestSupport;
 
@@ -238,21 +240,21 @@ public class JmsEndpointConfigurationTest extends 
CamelTestSupport {
 public void testIdleTaskExecutionLimit() throws Exception {
 JmsEndpoint endpoint = 
resolveMandatoryEndpoint(jms:queue:Foo?idleTaskExecutionLimit=50, 
JmsEndpoint.class);
 assertEquals(50, endpoint.getIdleTaskExecutionLimit());
-assertEquals(true, endpoint.isAutoStartup());
+assertTrue(endpoint.isAutoStartup());
 }
 
 @Test
 public void testIdleConsumerLimit() throws Exception {
 JmsEndpoint endpoint = 
resolveMandatoryEndpoint(jms:queue:Foo?idleConsumerLimit=51, 
JmsEndpoint.class);
 assertEquals(51, endpoint.getIdleConsumerLimit());
-assertEquals(true, endpoint.isAutoStartup());
+assertTrue(endpoint.isAutoStartup());
 assertEquals(Foo, endpoint.getEndpointConfiguredDestinationName());
 }
 
 @Test
 public void testLazyCreateTransactionManager() throws Exception {
 JmsEndpoint endpoint = 
resolveMandatoryEndpoint(jms:queue:Foo?lazyCreateTransactionManager=true, 
JmsEndpoint.class);
-assertEquals(true, 
endpoint.getConfiguration().isLazyCreateTransactionManager());
+
assertTrue(endpoint.getConfiguration().isLazyCreateTransactionManager());
 }
 
 @SuppressWarnings(deprecation)
@@ -262,42 +264,52 @@ public class JmsEndpointConfigurationTest extends 
CamelTestSupport {
 
 assertNotNull(endpoint.getBinding());
 assertNotNull(endpoint.getCamelContext());
+assertNull(endpoint.getDefaultTaskExecutorType());
+assertNull(endpoint.getMessageListenerContainerFactory());
 assertEquals(-1, endpoint.getRecoveryInterval());
+assertEquals(JmsConsumer[Foo], endpoint.getThreadName());
 assertEquals(-1, endpoint.getTimeToLive());
 assertEquals(-1, endpoint.getTransactionTimeout());
-assertEquals(null, endpoint.getAcknowledgementModeName());
 assertEquals(1, endpoint.getAcknowledgementMode());
+assertNull(endpoint.getAcknowledgementModeName());
 assertEquals(-1, endpoint.getCacheLevel());
-assertEquals(null, endpoint.getCacheLevelName());
+assertNull(endpoint.getCacheLevelName());
 assertNotNull(endpoint.getCamelId());
-assertEquals(null, endpoint.getClientId());
+assertNull(endpoint.getClientId());
 assertNotNull(endpoint.getConnectionFactory());
 assertEquals(1, endpoint.getConcurrentConsumers());
+assertNull(endpoint.getDeliveryMode());
 assertNull(endpoint.getDestination());
 assertEquals(Foo, endpoint.getDestinationName());
 assertNull(endpoint.getDestinationResolver());
-assertEquals(null, endpoint.getDurableSubscriptionName());
+assertNull(endpoint.getDurableSubscriptionName());
 assertEquals(jms://queue:Foo, 

git commit: Added some missing asserts by JmsEndpointConfigurationTest#testDefaultEndpointOptions() and polished the pre-existing ones.

2013-10-25 Thread bvahdat
Updated Branches:
  refs/heads/camel-2.12.x 3ea4614f3 - 7be01a006


Added some missing asserts by 
JmsEndpointConfigurationTest#testDefaultEndpointOptions() and polished the 
pre-existing ones.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/7be01a00
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/7be01a00
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/7be01a00

Branch: refs/heads/camel-2.12.x
Commit: 7be01a00662e8a6471f9a636ed6dca108e473576
Parents: 3ea4614
Author: Babak Vahdat bvah...@apache.org
Authored: Fri Oct 25 11:00:07 2013 +0200
Committer: Babak Vahdat bvah...@apache.org
Committed: Fri Oct 25 11:01:31 2013 +0200

--
 .../jms/JmsEndpointConfigurationTest.java   | 123 +++
 1 file changed, 74 insertions(+), 49 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/7be01a00/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsEndpointConfigurationTest.java
--
diff --git 
a/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsEndpointConfigurationTest.java
 
b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsEndpointConfigurationTest.java
index 5f779b9..bda3098 100644
--- 
a/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsEndpointConfigurationTest.java
+++ 
b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsEndpointConfigurationTest.java
@@ -25,9 +25,11 @@ import org.apache.activemq.ActiveMQConnectionFactory;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.Exchange;
+import org.apache.camel.LoggingLevel;
 import org.apache.camel.Processor;
 import org.apache.camel.Producer;
 import org.apache.camel.ResolveEndpointFailedException;
+import org.apache.camel.ServiceStatus;
 import org.apache.camel.impl.JndiRegistry;
 import org.apache.camel.test.junit4.CamelTestSupport;
 
@@ -238,21 +240,21 @@ public class JmsEndpointConfigurationTest extends 
CamelTestSupport {
 public void testIdleTaskExecutionLimit() throws Exception {
 JmsEndpoint endpoint = 
resolveMandatoryEndpoint(jms:queue:Foo?idleTaskExecutionLimit=50, 
JmsEndpoint.class);
 assertEquals(50, endpoint.getIdleTaskExecutionLimit());
-assertEquals(true, endpoint.isAutoStartup());
+assertTrue(endpoint.isAutoStartup());
 }
 
 @Test
 public void testIdleConsumerLimit() throws Exception {
 JmsEndpoint endpoint = 
resolveMandatoryEndpoint(jms:queue:Foo?idleConsumerLimit=51, 
JmsEndpoint.class);
 assertEquals(51, endpoint.getIdleConsumerLimit());
-assertEquals(true, endpoint.isAutoStartup());
+assertTrue(endpoint.isAutoStartup());
 assertEquals(Foo, endpoint.getEndpointConfiguredDestinationName());
 }
 
 @Test
 public void testLazyCreateTransactionManager() throws Exception {
 JmsEndpoint endpoint = 
resolveMandatoryEndpoint(jms:queue:Foo?lazyCreateTransactionManager=true, 
JmsEndpoint.class);
-assertEquals(true, 
endpoint.getConfiguration().isLazyCreateTransactionManager());
+
assertTrue(endpoint.getConfiguration().isLazyCreateTransactionManager());
 }
 
 @SuppressWarnings(deprecation)
@@ -262,42 +264,52 @@ public class JmsEndpointConfigurationTest extends 
CamelTestSupport {
 
 assertNotNull(endpoint.getBinding());
 assertNotNull(endpoint.getCamelContext());
+assertNull(endpoint.getDefaultTaskExecutorType());
+assertNull(endpoint.getMessageListenerContainerFactory());
 assertEquals(-1, endpoint.getRecoveryInterval());
+assertEquals(JmsConsumer[Foo], endpoint.getThreadName());
 assertEquals(-1, endpoint.getTimeToLive());
 assertEquals(-1, endpoint.getTransactionTimeout());
-assertEquals(null, endpoint.getAcknowledgementModeName());
 assertEquals(1, endpoint.getAcknowledgementMode());
+assertNull(endpoint.getAcknowledgementModeName());
 assertEquals(-1, endpoint.getCacheLevel());
-assertEquals(null, endpoint.getCacheLevelName());
+assertNull(endpoint.getCacheLevelName());
 assertNotNull(endpoint.getCamelId());
-assertEquals(null, endpoint.getClientId());
+assertNull(endpoint.getClientId());
 assertNotNull(endpoint.getConnectionFactory());
 assertEquals(1, endpoint.getConcurrentConsumers());
+assertNull(endpoint.getDeliveryMode());
 assertNull(endpoint.getDestination());
 assertEquals(Foo, endpoint.getDestinationName());
 assertNull(endpoint.getDestinationResolver());
-assertEquals(null, endpoint.getDurableSubscriptionName());
+assertNull(endpoint.getDurableSubscriptionName());
 

[1/2] git commit: CAMEL-6903: Fixed netty-http endpoint being unique which could lead to netty http producer sending wrong data if uri parameters are part of endpoint uri.

2013-10-25 Thread davsclaus
Updated Branches:
  refs/heads/camel-2.12.x 7be01a006 - 7b9e13e2a
  refs/heads/master a4722b588 - eafa69511


CAMEL-6903: Fixed netty-http endpoint being unique which could lead to netty 
http producer sending wrong data if uri parameters are part of endpoint uri.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/eafa6951
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/eafa6951
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/eafa6951

Branch: refs/heads/master
Commit: eafa69511189592ce5195f644b6109e7f4750155
Parents: a4722b5
Author: Claus Ibsen davscl...@apache.org
Authored: Fri Oct 25 12:46:03 2013 +0200
Committer: Claus Ibsen davscl...@apache.org
Committed: Fri Oct 25 12:47:21 2013 +0200

--
 .../netty/http/NettyHttpComponent.java  | 14 +++---
 .../component/netty/http/NettyHttpEndpoint.java | 11 +
 .../component/netty/http/NettyHttpHelper.java   |  5 +-
 .../component/netty/http/NettyHttpProducer.java |  7 +--
 ...ettyHttpSameHostDifferentParametersTest.java | 52 
 5 files changed, 62 insertions(+), 27 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/eafa6951/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpComponent.java
--
diff --git 
a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpComponent.java
 
b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpComponent.java
index f6f4a9a..d305d92 100644
--- 
a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpComponent.java
+++ 
b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpComponent.java
@@ -78,6 +78,7 @@ public class NettyHttpComponent extends NettyComponent 
implements HeaderFilterSt
 MapString, Object securityOptions = 
IntrospectionSupport.extractProperties(parameters, securityConfiguration.);
 
 config = parseConfiguration(config, remaining, parameters);
+setProperties(config, parameters);
 
 // validate config
 config.validateConfiguration();
@@ -90,15 +91,12 @@ public class NettyHttpComponent extends NettyComponent 
implements HeaderFilterSt
 config.setPort(shared.getPort());
 }
 
-NettyHttpEndpoint answer = new NettyHttpEndpoint(remaining, this, 
config);
-answer.setTimer(getTimer());
-setProperties(answer.getConfiguration(), parameters);
+// create the address uri which includes the remainder parameters 
(which is not configuration parameters for this component)
+URI u = new URI(UnsafeUriCharactersEncoder.encode(remaining));
+String addressUri = URISupport.createRemainingURI(u, 
parameters).toString();
 
-// any leftover parameters is uri parameters
-if (!parameters.isEmpty()) {
-String query = URISupport.createQueryString(parameters);
-answer.setUriParameters(query);
-}
+NettyHttpEndpoint answer = new NettyHttpEndpoint(addressUri, this, 
config);
+answer.setTimer(getTimer());
 
 // set component options on endpoint as defaults
 if (answer.getNettyHttpBinding() == null) {

http://git-wip-us.apache.org/repos/asf/camel/blob/eafa6951/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpEndpoint.java
--
diff --git 
a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpEndpoint.java
 
b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpEndpoint.java
index 5e5de9d..27775c5 100644
--- 
a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpEndpoint.java
+++ 
b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpEndpoint.java
@@ -40,7 +40,6 @@ import org.slf4j.LoggerFactory;
 public class NettyHttpEndpoint extends NettyEndpoint implements 
HeaderFilterStrategyAware {
 
 private static final Logger LOG = 
LoggerFactory.getLogger(NettyHttpEndpoint.class);
-private String uriParameters;
 private NettyHttpBinding nettyHttpBinding;
 private HeaderFilterStrategy headerFilterStrategy;
 private boolean traceEnabled;
@@ -77,7 +76,7 @@ public class NettyHttpEndpoint extends NettyEndpoint 
implements HeaderFilterStra
 
 @Override
 public Producer createProducer() throws Exception {
-Producer answer = new NettyHttpProducer(this, getConfiguration(), 
getUriParameters());
+Producer answer = new NettyHttpProducer(this, getConfiguration());
 if 

[2/2] git commit: CAMEL-6903: Fixed netty-http endpoint being unique which could lead to netty http producer sending wrong data if uri parameters are part of endpoint uri.

2013-10-25 Thread davsclaus
CAMEL-6903: Fixed netty-http endpoint being unique which could lead to netty 
http producer sending wrong data if uri parameters are part of endpoint uri.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/7b9e13e2
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/7b9e13e2
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/7b9e13e2

Branch: refs/heads/camel-2.12.x
Commit: 7b9e13e2ae7fa6c439f38ced6d8fb1be6fb7f8fc
Parents: 7be01a0
Author: Claus Ibsen davscl...@apache.org
Authored: Fri Oct 25 12:46:03 2013 +0200
Committer: Claus Ibsen davscl...@apache.org
Committed: Fri Oct 25 12:47:27 2013 +0200

--
 .../netty/http/NettyHttpComponent.java  | 14 +++---
 .../component/netty/http/NettyHttpEndpoint.java | 11 +
 .../component/netty/http/NettyHttpHelper.java   |  5 +-
 .../component/netty/http/NettyHttpProducer.java |  7 +--
 ...ettyHttpSameHostDifferentParametersTest.java | 52 
 5 files changed, 62 insertions(+), 27 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/7b9e13e2/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpComponent.java
--
diff --git 
a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpComponent.java
 
b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpComponent.java
index f6f4a9a..d305d92 100644
--- 
a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpComponent.java
+++ 
b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpComponent.java
@@ -78,6 +78,7 @@ public class NettyHttpComponent extends NettyComponent 
implements HeaderFilterSt
 MapString, Object securityOptions = 
IntrospectionSupport.extractProperties(parameters, securityConfiguration.);
 
 config = parseConfiguration(config, remaining, parameters);
+setProperties(config, parameters);
 
 // validate config
 config.validateConfiguration();
@@ -90,15 +91,12 @@ public class NettyHttpComponent extends NettyComponent 
implements HeaderFilterSt
 config.setPort(shared.getPort());
 }
 
-NettyHttpEndpoint answer = new NettyHttpEndpoint(remaining, this, 
config);
-answer.setTimer(getTimer());
-setProperties(answer.getConfiguration(), parameters);
+// create the address uri which includes the remainder parameters 
(which is not configuration parameters for this component)
+URI u = new URI(UnsafeUriCharactersEncoder.encode(remaining));
+String addressUri = URISupport.createRemainingURI(u, 
parameters).toString();
 
-// any leftover parameters is uri parameters
-if (!parameters.isEmpty()) {
-String query = URISupport.createQueryString(parameters);
-answer.setUriParameters(query);
-}
+NettyHttpEndpoint answer = new NettyHttpEndpoint(addressUri, this, 
config);
+answer.setTimer(getTimer());
 
 // set component options on endpoint as defaults
 if (answer.getNettyHttpBinding() == null) {

http://git-wip-us.apache.org/repos/asf/camel/blob/7b9e13e2/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpEndpoint.java
--
diff --git 
a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpEndpoint.java
 
b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpEndpoint.java
index 5e5de9d..27775c5 100644
--- 
a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpEndpoint.java
+++ 
b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpEndpoint.java
@@ -40,7 +40,6 @@ import org.slf4j.LoggerFactory;
 public class NettyHttpEndpoint extends NettyEndpoint implements 
HeaderFilterStrategyAware {
 
 private static final Logger LOG = 
LoggerFactory.getLogger(NettyHttpEndpoint.class);
-private String uriParameters;
 private NettyHttpBinding nettyHttpBinding;
 private HeaderFilterStrategy headerFilterStrategy;
 private boolean traceEnabled;
@@ -77,7 +76,7 @@ public class NettyHttpEndpoint extends NettyEndpoint 
implements HeaderFilterStra
 
 @Override
 public Producer createProducer() throws Exception {
-Producer answer = new NettyHttpProducer(this, getConfiguration(), 
getUriParameters());
+Producer answer = new NettyHttpProducer(this, getConfiguration());
 if (isSynchronous()) {
 return new SynchronousDelegateProducer(answer);
 } else {
@@ -156,14 

[1/2] git commit: Added unit test

2013-10-25 Thread davsclaus
Updated Branches:
  refs/heads/camel-2.12.x 7b9e13e2a - 3f1edb04f
  refs/heads/master eafa69511 - c6f05fa09


Added unit test


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/c6f05fa0
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/c6f05fa0
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/c6f05fa0

Branch: refs/heads/master
Commit: c6f05fa09113233b4121094492f8909e07a6e873
Parents: eafa695
Author: Claus Ibsen davscl...@apache.org
Authored: Fri Oct 25 13:11:09 2013 +0200
Committer: Claus Ibsen davscl...@apache.org
Committed: Fri Oct 25 13:11:09 2013 +0200

--
 .../netty/http/ManagedNettyEndpointTest.java| 85 
 1 file changed, 85 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/c6f05fa0/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/ManagedNettyEndpointTest.java
--
diff --git 
a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/ManagedNettyEndpointTest.java
 
b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/ManagedNettyEndpointTest.java
new file mode 100644
index 000..986c1b7
--- /dev/null
+++ 
b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/ManagedNettyEndpointTest.java
@@ -0,0 +1,85 @@
+/**
+ * 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.component.netty.http;
+
+import java.util.Set;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.Exchange;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.management.DefaultManagementNamingStrategy;
+import org.junit.Test;
+
+public class ManagedNettyEndpointTest extends BaseNettyTest {
+
+@Override
+protected boolean useJmx() {
+return true;
+}
+
+protected CamelContext createCamelContext() throws Exception {
+CamelContext context = super.createCamelContext();
+DefaultManagementNamingStrategy naming = 
(DefaultManagementNamingStrategy) 
context.getManagementStrategy().getManagementNamingStrategy();
+naming.setHostName(localhost);
+naming.setDomainName(org.apache.camel);
+return context;
+}
+
+protected MBeanServer getMBeanServer() {
+return 
context.getManagementStrategy().getManagementAgent().getMBeanServer();
+}
+
+@Test
+public void testManagement() throws Exception {
+// JMX tests dont work well on AIX CI servers (hangs them)
+if (isPlatform(aix)) {
+return;
+}
+
+// should not add 100 endpoints
+getMockEndpoint(mock:foo).expectedMessageCount(100);
+for (int i = 0; i  100; i++) {
+String out = 
template.requestBody(netty-http:http://localhost:{{port}}/foo?param; + i + 
=value + i, Hello World, String.class);
+assertEquals(param + i + =value + i, out);
+}
+assertMockEndpointsSatisfied();
+
+MBeanServer mbeanServer = getMBeanServer();
+
+ObjectName on = 
ObjectName.getInstance(org.apache.camel:context=localhost/camel-1,type=endpoints,name=\http://0.0.0.0:;
 + getPort() + /foo\);
+mbeanServer.isRegistered(on);
+
+// should only be 2 endpoints in JMX
+SetObjectName set = getMBeanServer().queryNames(new 
ObjectName(*:context=localhost/camel-1,type=endpoints,*), null);
+assertEquals(2, set.size());
+}
+
+@Override
+protected RouteBuilder createRouteBuilder() throws Exception {
+return new RouteBuilder() {
+@Override
+public void configure() throws Exception {
+from(netty-http:http://0.0.0.0:{{port}}/foo;)
+.to(mock:foo)
+.transform().header(Exchange.HTTP_QUERY);
+}
+};
+}
+
+}



[CONF] Apache Camel Camel 2.13.0 Release

2013-10-25 Thread Claus Ibsen (Confluence)







Camel 2.13.0 Release
Page edited by Claus Ibsen


 Changes (1)
 




...
* Fixed [HTTP4] to support multiple custom component names in use, each configured using different {{SSLContext}}. * Fixed [Content Based Router] using method calls as [Predicate]s if threw an exception, the [Content Based Router] will call next predicate before triggering [Error Handler]. 
* Fixed [Netty HTTP] producer with query parameters may use wrong parameters from a previous call. 
 h3. New [Enterprise Integration Patterns] 
...


Full Content

Camel 2.13.0 release (currently in progress)




New and Noteworthy

Welcome to the 2.13.0 release which approx XXX issues resolved (new features, improvements and bug fixes such as...)


	When using multiple OSGi Blueprint cm:property-placeholder's then Camel now favors using non-default placeholders, or the last property-placeholder defined in the Blueprint XML file. This allows for example to define default properties in one placeholder, and override these values in other placeholders.
	FTP consumer allow to download a single named file without using the FTP LIST command. This allows to download a known file from a FTP server even when the user account does not have permission to do FTP LIST command.
	FTP consumer allow to ignore file not found or insufficient file permission errors.
	Data Format using marshal now leverages Stream caching out of the box if enabled, which allows to marshal big streams and spool to disk, instead of being pure in-memory based.
	Improved using Bean when the bean is looked up in the Registry, when using concurrent processing in the route.
	Added cache option to beanRef and bean in the DSL. This avoids looking up the Bean from the Registry on each usage; this can safely be done for singleton beans.
	Configuring Data Formats in XML attributes now supports reference lookup using the # syntax, eg jaxb xmlStreamWriterWrapper="#myWriterWrapper" ..
	JDBC component now also support outputType to specify the expected output as either a List or single Object. As well allow to map to a bean using a BeanRowMapper to control the mapping of ROW names to bean properties.
	Both Quartz as well as Quartz2 based ScheduledRoutePolicy has been improved to better support cluster setups (e.g. to not schedule jobs being already scheduled through another node inside a given cluster).
	Reduced the work the Aggregate EIP does while holding a lock during aggregation, which can lead to improved performance in some use-cases.
	JndiRegistry now implements all the find methods.
	VM component now supports multipleConsumers=true across deployment units.
	Added @PreConsumed to JPA consumer.
	Added CamelFileName header support to the HDFS producer
	Like as JpaConsumer now also JpaProducer of the JPA component supports the CamelEntityManager header.
	Restlet consumer now supports returning custom headers as HTTP headers from the Camel Message.



Fixed Issues


	Fixed an ArrayIndexOutOfBoundsException with Message History when using SEDA
	Fixed requestTimeout on Netty not triggering when we have received message.
	Fixed Parameter Binding Annotations on boolean types to evaluate as Predicate instead of _expression_
	Fixed using File consumer with delete=truereadLock=fileLock not being able to delete the file on Windows.
	Fixed Throttler to honor time slots after period expires (eg so it works consistently and as expected).
	Fixed getting JMSXUserID property when consuming from ActiveMQ
	Fixed interceptFrom to support property placeholders
	Fixed a race condition in initializing SSLContext in Netty and Netty HTTP
	Fixed using Recipient List, Routing Slip calling another route which is configured with NoErrorHandler, and an exception occurred in that route, would be propagated back as not-exhausted, allow the caller route to have its error handler react on the exception.
	Fixed Quartz and exception was thrown when scheduling a job, would affect during shutdown, assuming the job was still in progress, and not shutdown the Quartz scheduler.
	Fixed so you can configure Stomp endpoints using URIs
	Fixed memory leak when using Language component with camel-script languages and having contentCache=false
	Fixed Error Handler may log at WARN level "Cannot determine current route from Exchange" when using Splitter
	Fixed camel-fop to work in Apache Karaf and ServiceMix
	Fixed HDFS producer to use the configured UuidGenerator when generating split file names to avoid filename collisions
	Fixed JpaProducer and JpaConsumer of the JPA component to not share/reuse the same EntityManager object which could cause problems if this would occur in the context of multiple/different threads.
	Fixed HTTP4 to support multiple custom component names in use, each 

svn commit: r884058 - in /websites/production/camel/content: cache/main.pageCache camel-2130-release.html

2013-10-25 Thread buildbot
Author: buildbot
Date: Fri Oct 25 11:18:53 2013
New Revision: 884058

Log:
Production update by buildbot for camel

Modified:
websites/production/camel/content/cache/main.pageCache
websites/production/camel/content/camel-2130-release.html

Modified: websites/production/camel/content/cache/main.pageCache
==
Binary files - no diff available.

Modified: websites/production/camel/content/camel-2130-release.html
==
--- websites/production/camel/content/camel-2130-release.html (original)
+++ websites/production/camel/content/camel-2130-release.html Fri Oct 25 
11:18:53 2013
@@ -99,7 +99,7 @@
 
 h3a shape=rect name=Camel2.13.0Release-FixedIssues/aFixed Issues/h3
 
-ulliFixed an ttArrayIndexOutOfBoundsException/tt with a shape=rect 
href=message-history.html title=Message HistoryMessage History/a when 
using a shape=rect href=seda.html title=SEDASEDA/a/liliFixed 
ttrequestTimeout/tt on a shape=rect href=netty.html 
title=NettyNetty/a not triggering when we have received 
message./liliFixed a shape=rect 
href=parameter-binding-annotations.html title=Parameter Binding 
AnnotationsParameter Binding Annotations/a on boolean types to evaluate as 
a shape=rect href=predicate.html title=PredicatePredicate/a instead 
of a shape=rect href=expression.html 
title=ExpressionExpression/a/liliFixed using a shape=rect 
href=file2.html title=File2File/a consumer with 
ttdelete=trueamp;readLock=fileLock/tt not being able to delete the file on 
Windows./liliFixed a shape=rect href=throttler.html 
title=ThrottlerThrottler/a to honor time slots after period expires (
 eg so it works consistently and as expected)./liliFixed getting JMSXUserID 
property when consuming from a shape=rect href=activemq.html 
title=ActiveMQActiveMQ/a/liliFixed a shape=rect 
href=intercept.html title=InterceptinterceptFrom/a to support property 
placeholders/liliFixed a race condition in initializing ttSSLContext/tt 
in a shape=rect href=netty.html title=NettyNetty/a and a 
shape=rect href=netty-http.html title=Netty HTTPNetty 
HTTP/a/liliFixed using a shape=rect href=recipient-list.html 
title=Recipient ListRecipient List/a, a shape=rect 
href=routing-slip.html title=Routing SlipRouting Slip/a calling another 
route which is configured with ttNoErrorHandler/tt, and an exception 
occurred in that route, would be propagated back as not-exhausted, allow the 
caller route to have its error handler react on the exception./liliFixed a 
shape=rect href=quartz.html title=QuartzQuartz/a and exc
 eption was thrown when scheduling a job, would affect during shutdown, 
assuming the job was still in progress, and not shutdown the Quartz 
scheduler./liliFixed so you can configure a shape=rect href=stomp.html 
title=StompStomp/a endpoints using a shape=rect href=uris.html 
title=URIsURIs/a/liliFixed memory leak when using a shape=rect 
href=language.html title=LanguageLanguage/a component with 
ttcamel-script/tt languages and having 
ttcontentCache=false/tt/liliFixed a shape=rect 
href=error-handler.html title=Error HandlerError Handler/a may log at 
ttWARN/tt level Cannot determine current route from Exchange when using 
a shape=rect href=splitter.html 
title=SplitterSplitter/a/liliFixed ttcamel-fop/tt to work in 
Apache a shape=rect href=karaf.html title=KarafKaraf/a and 
ServiceMix/liliFixed a shape=rect href=hdfs.html title=HDFSHDFS/a 
producer to use the configured a shape=rect h
 ref=uuidgenerator.html title=UuidGeneratorUuidGenerator/a when 
generating split file names to avoid filename collisions/liliFixed 
ttJpaProducer/tt and ttJpaConsumer/tt of the a shape=rect 
href=jpa.html title=JPAJPA/a component to not share/reuse the same 
ttEntityManager/tt object which could cause problems if this would occur in 
the context of multiple/different threads./liliFixed a shape=rect 
href=http4.html title=HTTP4HTTP4/a to support multiple custom component 
names in use, each configured using different 
ttSSLContext/tt./liliFixed a shape=rect 
href=content-based-router.html title=Content Based RouterContent Based 
Router/a using method call's as a shape=rect href=predicate.html 
title=PredicatePredicate/as if threw an exception, the a shape=rect 
href=content-based-router.html title=Content Based RouterContent Based 
Router/a will call next predicate before triggering a shape=rect 
href=error-ha
 ndler.html title=Error HandlerError Handler/a./li/ul
+ulliFixed an ttArrayIndexOutOfBoundsException/tt with a shape=rect 
href=message-history.html title=Message HistoryMessage History/a when 
using a shape=rect href=seda.html title=SEDASEDA/a/liliFixed 
ttrequestTimeout/tt on a shape=rect href=netty.html 
title=NettyNetty/a not triggering when we have received 
message./liliFixed a shape=rect 
href=parameter-binding-annotations.html title=Parameter Binding 
AnnotationsParameter Binding Annotations/a on boolean types to 

git commit: Polished tests, corrected a typo by JmsConsumerShutdownTest#testSedaConsumerShutdownWithMessageInFlight, removed some deprecated API usage of JdbcTemplate. Also re-enabled 2 tests which se

2013-10-25 Thread bvahdat
Updated Branches:
  refs/heads/master c6f05fa09 - e92aab5af


Polished tests, corrected a typo by 
JmsConsumerShutdownTest#testSedaConsumerShutdownWithMessageInFlight, removed 
some deprecated API usage of JdbcTemplate. Also re-enabled 2 tests which seem 
to work again since the recent AMQ 5.9 upgrade.

Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/e92aab5a
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/e92aab5a
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/e92aab5a

Branch: refs/heads/master
Commit: e92aab5aff3744210c191fba71f9e35fd35bb226
Parents: c6f05fa
Author: Babak Vahdat bvah...@apache.org
Authored: Fri Oct 25 13:50:56 2013 +0200
Committer: Babak Vahdat bvah...@apache.org
Committed: Fri Oct 25 13:50:56 2013 +0200

--
 .../camel/itest/jms/JmsConsumerShutdownTest.java   | 12 
 .../FromJmsToJdbcIdempotentConsumerToJmsTest.java  | 17 ++---
 2 files changed, 10 insertions(+), 19 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/e92aab5a/tests/camel-itest/src/test/java/org/apache/camel/itest/jms/JmsConsumerShutdownTest.java
--
diff --git 
a/tests/camel-itest/src/test/java/org/apache/camel/itest/jms/JmsConsumerShutdownTest.java
 
b/tests/camel-itest/src/test/java/org/apache/camel/itest/jms/JmsConsumerShutdownTest.java
index e5aac72..9261272 100644
--- 
a/tests/camel-itest/src/test/java/org/apache/camel/itest/jms/JmsConsumerShutdownTest.java
+++ 
b/tests/camel-itest/src/test/java/org/apache/camel/itest/jms/JmsConsumerShutdownTest.java
@@ -43,12 +43,9 @@ public class JmsConsumerShutdownTest extends 
AbstractJUnit4SpringContextTests {
 @EndpointInject(uri = mock:exception)
 protected MockEndpoint exception;
 
-// Camel context will never shut down. Regardless of the settings in 
DefaultShutdownStrategy
-// JmsConsumer does not correctly shut down direct subroutes
-@Test(timeout = 2)
+@Test
 @DirtiesContext
 public void testJmsConsumerShutdownWithMessageInFlight() throws 
InterruptedException {
-
 end.expectedMessageCount(0);
 end.setResultWaitTime(2000);
 
@@ -65,11 +62,10 @@ public class JmsConsumerShutdownTest extends 
AbstractJUnit4SpringContextTests {
 end.assertIsSatisfied();
 }
 
-// For comparison, SedaConsumer will correctly shut down direct subroutes
-@Test(timeout = 2)
+// Just for the sake of comparison test the SedaConsumer as well
+@Test
 @DirtiesContext
 public void testSedaConsumerShutdownWithMessageInFlight() throws 
InterruptedException {
-
 end.expectedMessageCount(0);
 end.setResultWaitTime(2000);
 
@@ -81,7 +77,7 @@ public class JmsConsumerShutdownTest extends 
AbstractJUnit4SpringContextTests {
 }
 });
 
-seda.sendBody(activemq:start, Hello);
+seda.sendBody(seda:start, Hello);
 
 end.assertIsSatisfied();
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/e92aab5a/tests/camel-itest/src/test/java/org/apache/camel/itest/sql/FromJmsToJdbcIdempotentConsumerToJmsTest.java
--
diff --git 
a/tests/camel-itest/src/test/java/org/apache/camel/itest/sql/FromJmsToJdbcIdempotentConsumerToJmsTest.java
 
b/tests/camel-itest/src/test/java/org/apache/camel/itest/sql/FromJmsToJdbcIdempotentConsumerToJmsTest.java
index bc8d4da..b67afe6 100644
--- 
a/tests/camel-itest/src/test/java/org/apache/camel/itest/sql/FromJmsToJdbcIdempotentConsumerToJmsTest.java
+++ 
b/tests/camel-itest/src/test/java/org/apache/camel/itest/sql/FromJmsToJdbcIdempotentConsumerToJmsTest.java
@@ -28,7 +28,6 @@ import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.spi.IdempotentRepository;
 import org.apache.camel.test.spring.CamelSpringTestSupport;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.springframework.context.support.AbstractApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -79,12 +78,11 @@ public class FromJmsToJdbcIdempotentConsumerToJmsTest 
extends CamelSpringTestSup
 assertTrue(Should complete 1 message, notify.matchesMockWaitTime());
 
 // check that there is a message in the database and JMS queue
-assertEquals(1, jdbcTemplate.queryForInt(select count(*) from 
CAMEL_MESSAGEPROCESSED));
+assertEquals(new Integer(1), jdbcTemplate.queryForObject(select 
count(*) from CAMEL_MESSAGEPROCESSED, Integer.class));
 Object out = consumer.receiveBody(activemq:queue:outbox, 3000);
 assertEquals(DONE-A, out);
 }
 
-@Ignore(see the TODO below)
 @Test
 public void testJmsToJdbcJmsRollbackAtA() throws Exception {
 

git commit: CAMEL-6895 Supported to set the camel-xmljson Encoding

2013-10-25 Thread ningjiang
Updated Branches:
  refs/heads/master e92aab5af - 3e49c6979


CAMEL-6895 Supported to set the camel-xmljson Encoding


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/3e49c697
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/3e49c697
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/3e49c697

Branch: refs/heads/master
Commit: 3e49c69790a05e0a3cf8785386bbeb0c962a
Parents: e92aab5
Author: Willem Jiang ningji...@apache.org
Authored: Fri Oct 25 20:44:54 2013 +0800
Committer: Willem Jiang ningji...@apache.org
Committed: Fri Oct 25 21:04:57 2013 +0800

--
 .../camel/dataformat/xmljson/XmlJsonDataFormat.java| 13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/3e49c697/components/camel-xmljson/src/main/java/org/apache/camel/dataformat/xmljson/XmlJsonDataFormat.java
--
diff --git 
a/components/camel-xmljson/src/main/java/org/apache/camel/dataformat/xmljson/XmlJsonDataFormat.java
 
b/components/camel-xmljson/src/main/java/org/apache/camel/dataformat/xmljson/XmlJsonDataFormat.java
index f68c60b..99a91d7 100644
--- 
a/components/camel-xmljson/src/main/java/org/apache/camel/dataformat/xmljson/XmlJsonDataFormat.java
+++ 
b/components/camel-xmljson/src/main/java/org/apache/camel/dataformat/xmljson/XmlJsonDataFormat.java
@@ -151,8 +151,17 @@ public class XmlJsonDataFormat extends ServiceSupport 
implements DataFormat {
 } else {
 json = serializer.read((String) xml);
 }
-
-OutputStreamWriter osw = new OutputStreamWriter(stream, 
IOHelper.getCharsetName(exchange));
+// don't return the default setting here
+String encoding = IOHelper.getCharsetName(exchange, false);
+if (encoding == null) {
+encoding = getEncoding();
+}
+OutputStreamWriter osw = null;
+if (encoding != null) {
+osw = new OutputStreamWriter(stream, encoding);
+} else {
+osw = new OutputStreamWriter(stream);
+}
 json.write(osw);
 osw.flush();
 



[1/2] git commit: CAMEL-6895 Supported to set the camel-xmljson Encoding

2013-10-25 Thread ningjiang
Updated Branches:
  refs/heads/camel-2.11.x 321543a54 - 86fe48860
  refs/heads/camel-2.12.x 3f1edb04f - f9bbf60fe


CAMEL-6895 Supported to set the camel-xmljson Encoding


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/f9bbf60f
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f9bbf60f
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f9bbf60f

Branch: refs/heads/camel-2.12.x
Commit: f9bbf60fed7c4029abdf32f4ee7b242014cdbe45
Parents: 3f1edb0
Author: Willem Jiang ningji...@apache.org
Authored: Fri Oct 25 20:44:54 2013 +0800
Committer: Willem Jiang willem.ji...@gmail.com
Committed: Fri Oct 25 21:06:34 2013 +0800

--
 .../camel/dataformat/xmljson/XmlJsonDataFormat.java| 13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/f9bbf60f/components/camel-xmljson/src/main/java/org/apache/camel/dataformat/xmljson/XmlJsonDataFormat.java
--
diff --git 
a/components/camel-xmljson/src/main/java/org/apache/camel/dataformat/xmljson/XmlJsonDataFormat.java
 
b/components/camel-xmljson/src/main/java/org/apache/camel/dataformat/xmljson/XmlJsonDataFormat.java
index f68c60b..99a91d7 100644
--- 
a/components/camel-xmljson/src/main/java/org/apache/camel/dataformat/xmljson/XmlJsonDataFormat.java
+++ 
b/components/camel-xmljson/src/main/java/org/apache/camel/dataformat/xmljson/XmlJsonDataFormat.java
@@ -151,8 +151,17 @@ public class XmlJsonDataFormat extends ServiceSupport 
implements DataFormat {
 } else {
 json = serializer.read((String) xml);
 }
-
-OutputStreamWriter osw = new OutputStreamWriter(stream, 
IOHelper.getCharsetName(exchange));
+// don't return the default setting here
+String encoding = IOHelper.getCharsetName(exchange, false);
+if (encoding == null) {
+encoding = getEncoding();
+}
+OutputStreamWriter osw = null;
+if (encoding != null) {
+osw = new OutputStreamWriter(stream, encoding);
+} else {
+osw = new OutputStreamWriter(stream);
+}
 json.write(osw);
 osw.flush();
 



[2/2] git commit: CAMEL-6895 Supported to set the camel-xmljson Encoding

2013-10-25 Thread ningjiang
CAMEL-6895 Supported to set the camel-xmljson Encoding


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/86fe4886
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/86fe4886
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/86fe4886

Branch: refs/heads/camel-2.11.x
Commit: 86fe48860b3eea709282afb39850fb7bdf00a783
Parents: 321543a
Author: Willem Jiang ningji...@apache.org
Authored: Fri Oct 25 20:44:54 2013 +0800
Committer: Willem Jiang willem.ji...@gmail.com
Committed: Fri Oct 25 21:07:14 2013 +0800

--
 .../camel/dataformat/xmljson/XmlJsonDataFormat.java| 13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/86fe4886/components/camel-xmljson/src/main/java/org/apache/camel/dataformat/xmljson/XmlJsonDataFormat.java
--
diff --git 
a/components/camel-xmljson/src/main/java/org/apache/camel/dataformat/xmljson/XmlJsonDataFormat.java
 
b/components/camel-xmljson/src/main/java/org/apache/camel/dataformat/xmljson/XmlJsonDataFormat.java
index f68c60b..99a91d7 100644
--- 
a/components/camel-xmljson/src/main/java/org/apache/camel/dataformat/xmljson/XmlJsonDataFormat.java
+++ 
b/components/camel-xmljson/src/main/java/org/apache/camel/dataformat/xmljson/XmlJsonDataFormat.java
@@ -151,8 +151,17 @@ public class XmlJsonDataFormat extends ServiceSupport 
implements DataFormat {
 } else {
 json = serializer.read((String) xml);
 }
-
-OutputStreamWriter osw = new OutputStreamWriter(stream, 
IOHelper.getCharsetName(exchange));
+// don't return the default setting here
+String encoding = IOHelper.getCharsetName(exchange, false);
+if (encoding == null) {
+encoding = getEncoding();
+}
+OutputStreamWriter osw = null;
+if (encoding != null) {
+osw = new OutputStreamWriter(stream, encoding);
+} else {
+osw = new OutputStreamWriter(stream);
+}
 json.write(osw);
 osw.flush();
 



[1/3] git commit: CAMEL-6904: Reduce logging noise for OSGi runtime

2013-10-25 Thread davsclaus
Updated Branches:
  refs/heads/camel-2.11.x 86fe48860 - f2e85bb7d
  refs/heads/camel-2.12.x f9bbf60fe - 5758c7c8b
  refs/heads/master 3e49c6979 - 6eafddcf2


CAMEL-6904: Reduce logging noise for OSGi runtime


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/6eafddcf
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/6eafddcf
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/6eafddcf

Branch: refs/heads/master
Commit: 6eafddcf257a637afaaebb1cbef0858a2807797e
Parents: 3e49c69
Author: Claus Ibsen davscl...@apache.org
Authored: Fri Oct 25 15:46:28 2013 +0200
Committer: Claus Ibsen davscl...@apache.org
Committed: Fri Oct 25 15:47:23 2013 +0200

--
 .../src/main/java/org/apache/camel/impl/osgi/Activator.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/6eafddcf/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java
--
diff --git a/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java 
b/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java
index 799ac3a..9be601b 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java
@@ -349,7 +349,7 @@ public class Activator implements BundleActivator, 
BundleTrackerCustomizer {
 }
 
 // load the classes into type converter registry
-LOG.info(Found {} @Converter classes to load, 
classes.size());
+LOG.debug(Found {} @Converter classes to load, 
classes.size());
 for (Class? type : classes) {
 if (LOG.isTraceEnabled()) {
 LOG.trace(Loading converter class: {}, 
ObjectHelper.name(type));
@@ -386,7 +386,7 @@ public class Activator implements BundleActivator, 
BundleTrackerCustomizer {
 return null;
 }
 URL url = bundle.getEntry(path);
-LOG.debug(The entry {}'s url is {}, name, url);
+LOG.trace(The entry {}'s url is {}, name, url);
 return createInstance(name, url, context.getInjector());
 }
 



[2/3] git commit: CAMEL-6904: Reduce logging noise for OSGi runtime

2013-10-25 Thread davsclaus
CAMEL-6904: Reduce logging noise for OSGi runtime


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/f2e85bb7
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f2e85bb7
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f2e85bb7

Branch: refs/heads/camel-2.11.x
Commit: f2e85bb7da1350e0fe8bf7ce591d099694275eb0
Parents: 86fe488
Author: Claus Ibsen davscl...@apache.org
Authored: Fri Oct 25 15:46:28 2013 +0200
Committer: Claus Ibsen davscl...@apache.org
Committed: Fri Oct 25 15:47:33 2013 +0200

--
 .../src/main/java/org/apache/camel/impl/osgi/Activator.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/f2e85bb7/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java
--
diff --git a/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java 
b/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java
index 79799a0..aec58e8 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java
@@ -349,7 +349,7 @@ public class Activator implements BundleActivator, 
BundleTrackerCustomizer {
 }
 
 // load the classes into type converter registry
-LOG.info(Found {} @Converter classes to load, 
classes.size());
+LOG.debug(Found {} @Converter classes to load, 
classes.size());
 for (Class? type : classes) {
 if (LOG.isTraceEnabled()) {
 LOG.trace(Loading converter class: {}, 
ObjectHelper.name(type));
@@ -386,7 +386,7 @@ public class Activator implements BundleActivator, 
BundleTrackerCustomizer {
 return null;
 }
 URL url = bundle.getEntry(path);
-LOG.debug(The entry {}'s url is {}, name, url);
+LOG.trace(The entry {}'s url is {}, name, url);
 return createInstance(name, url, context.getInjector());
 }
 



[3/3] git commit: CAMEL-6904: Reduce logging noise for OSGi runtime

2013-10-25 Thread davsclaus
CAMEL-6904: Reduce logging noise for OSGi runtime


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/5758c7c8
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/5758c7c8
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/5758c7c8

Branch: refs/heads/camel-2.12.x
Commit: 5758c7c8b1bd45e26718dd30df5cfcdd4c738268
Parents: f9bbf60
Author: Claus Ibsen davscl...@apache.org
Authored: Fri Oct 25 15:46:28 2013 +0200
Committer: Claus Ibsen davscl...@apache.org
Committed: Fri Oct 25 15:47:43 2013 +0200

--
 .../src/main/java/org/apache/camel/impl/osgi/Activator.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/5758c7c8/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java
--
diff --git a/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java 
b/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java
index 799ac3a..9be601b 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java
@@ -349,7 +349,7 @@ public class Activator implements BundleActivator, 
BundleTrackerCustomizer {
 }
 
 // load the classes into type converter registry
-LOG.info(Found {} @Converter classes to load, 
classes.size());
+LOG.debug(Found {} @Converter classes to load, 
classes.size());
 for (Class? type : classes) {
 if (LOG.isTraceEnabled()) {
 LOG.trace(Loading converter class: {}, 
ObjectHelper.name(type));
@@ -386,7 +386,7 @@ public class Activator implements BundleActivator, 
BundleTrackerCustomizer {
 return null;
 }
 URL url = bundle.getEntry(path);
-LOG.debug(The entry {}'s url is {}, name, url);
+LOG.trace(The entry {}'s url is {}, name, url);
 return createInstance(name, url, context.getInjector());
 }
 



[CONF] Apache Camel Esper

2013-10-25 Thread Christoph Emmersberger (Confluence)







Esper
Page edited by Christoph Emmersberger


Comment:
adding an eql example


 Changes (9)
 




...
When consuming from an Esper endpoint you must specify a *pattern* or *eql* statement to query the event stream.  
For example 
Pattern example: {code} from(esper://cheese?pattern=every event=MyEvent(bar=5))   .to(activemq:Foo); {code} 
 
EQL example: 
{code} 
from(esper://cheese?pattern=every event=MyEvent(bar=5)). 
from(esper://esper-dom?eql=insert into DomStream select * from org.w3c.dom.Document) 
to(activemq:Foo); .to(log://esper-dom?level=INFO); 
from(esper://esper-dom?eql=select childNodes from DomStream)   .to(mock:results); 
{code}  
...
{div:class=confluenceTableSmall} || Name || Default Value || Description || 
| {{pattern}} |  | The [Esper Pattern _expression_|http://esper.codehaus.org/esper-1.11.0/doc/reference/en/html/event_patterns.html] _expression_|http://esper.codehaus.org/esper-4.10.0/doc/reference/en-US/html/event_patterns.html] as a String to filter events | 
| {{eql}} |  | The [Esper EQL _expression_|http://esper.codehaus.org/esper-1.11.0/doc/reference/en/html/eql_clauses.html] _expression_|http://esper.codehaus.org/esper-4.10.0/doc/reference/en-US/html/epl_clauses.html] as a String to filter events | 
{div}  
...
 {code} 
  EventBean newEvent = exchange.getIn(EsperMessage.class).getNewEvent();
  EventBean oldEvent = exchange.getIn(EsperMessage.class).getOldEvent(); 
{code}  
...


Full Content

Esper

The Esper component supports the Esper Library for Event Stream Processing. The camel-esper library is provided by the Camel Extra project which hosts all *GPL related components for Camel.

URI format



esper:name[?options]



When consuming from an Esper endpoint you must specify a pattern or eql statement to query the event stream.

Pattern example:


from("esper://cheese?pattern=every event=MyEvent(bar=5)")
  .to("activemq:Foo");



EQL example:


from("esper://esper-dom?eql=insert into DomStream select * from org.w3c.dom.Document")
  .to("log://esper-dom?level=INFO");
from("esper://esper-dom?eql=select childNodes from DomStream")
  .to("mock:results");



Options



 Name 
 Default Value 
 Description 


 pattern 

 The Esper Pattern _expression_ as a String to filter events 


 eql 

 The Esper EQL _expression_ as a String to filter events 





You can append query options to the URI in the following format, ?option=valueoption=value...

EsperMessage

From Camel 2.12 onwards the esper consumer stores new and old events in the org.apacheextras.camel.component.esper.EsperMessage message as the input Message on the Exchange. You can get access to the esper event beans from java code with:



  EventBean newEvent = exchange.getIn(EsperMessage.class).getNewEvent();
  EventBean oldEvent = exchange.getIn(EsperMessage.class).getOldEvent();



By default if you get the body of org.apacheextras.camel.component.esper.EsperMessage it returns the new EventBean as in previous versions.

Demo

There is a demo which shows how to work with ActiveMQ, Camel and Esper in the Camel Extra project

See Also

	Configuring Camel
	Component
	Endpoint
	Getting Started



	Esper Camel Demo





Stop watching space
|
Change email notification preferences

View Online
|
View Changes









svn commit: r884082 - in /websites/production/camel/content: book-component-appendix.html book-in-one-page.html cache/main.pageCache esper.html

2013-10-25 Thread buildbot
Author: buildbot
Date: Fri Oct 25 15:19:40 2013
New Revision: 884082

Log:
Production update by buildbot for camel

Modified:
websites/production/camel/content/book-component-appendix.html
websites/production/camel/content/book-in-one-page.html
websites/production/camel/content/cache/main.pageCache
websites/production/camel/content/esper.html

Modified: websites/production/camel/content/book-component-appendix.html
==
--- websites/production/camel/content/book-component-appendix.html (original)
+++ websites/production/camel/content/book-component-appendix.html Fri Oct 25 
15:19:40 2013
@@ -3637,18 +3637,27 @@ esper:name[?options]
 
 pWhen consuming from an Esper endpoint you must specify a bpattern/b or 
beql/b statement to query the event stream./p
 
-pFor example/p
+pPattern example:/p
+div class=code panel style=border-width: 1px;div class=codeContent 
panelContent
+script class=theme: Default; brush: java; gutter: false 
type=syntaxhighlighter![CDATA[
+from(esper://cheese?pattern=every event=MyEvent(bar=5))
+  .to(activemq:Foo);
+]]/script
+/div/div
 
+pEQL example:/p
 div class=code panel style=border-width: 1px;div class=codeContent 
panelContent
 script class=theme: Default; brush: java; gutter: false 
type=syntaxhighlighter![CDATA[
-from(esper://cheese?pattern=every event=MyEvent(bar=5)).
-   to(activemq:Foo);
+from(esper://esper-dom?eql=insert into DomStream select * from 
org.w3c.dom.Document)
+  .to(log://esper-dom?level=INFO);
+from(esper://esper-dom?eql=select childNodes from DomStream)
+  .to(mock:results);
 ]]/script
 /div/div
 
 h3a shape=rect name=BookComponentAppendix-Options/aOptions/h3
 div class=confluenceTableSmalldiv class=table-wrap
-table class=confluenceTabletbodytrth colspan=1 rowspan=1 
class=confluenceTh Name /thth colspan=1 rowspan=1 
class=confluenceTh Default Value /thth colspan=1 rowspan=1 
class=confluenceTh Description /th/trtrtd colspan=1 rowspan=1 
class=confluenceTd ttpattern/tt /tdtd colspan=1 rowspan=1 
class=confluenceTd#160;/tdtd colspan=1 rowspan=1 
class=confluenceTd The a shape=rect class=external-link 
href=http://esper.codehaus.org/esper-1.11.0/doc/reference/en/html/event_patterns.html;
 rel=nofollowEsper Pattern expression/a as a String to filter events 
/td/trtrtd colspan=1 rowspan=1 class=confluenceTd tteql/tt 
/tdtd colspan=1 rowspan=1 class=confluenceTd#160;/tdtd 
colspan=1 rowspan=1 class=confluenceTd The a shape=rect 
class=external-link 
href=http://esper.codehaus.org/esper-1.11.0/doc/reference/en/html/eql_clauses.html;
 rel=nofollowEsper EQL expression/a as a S
 tring to filter events /td/tr/tbody/table
+table class=confluenceTabletbodytrth colspan=1 rowspan=1 
class=confluenceTh Name /thth colspan=1 rowspan=1 
class=confluenceTh Default Value /thth colspan=1 rowspan=1 
class=confluenceTh Description /th/trtrtd colspan=1 rowspan=1 
class=confluenceTd ttpattern/tt /tdtd colspan=1 rowspan=1 
class=confluenceTd#160;/tdtd colspan=1 rowspan=1 
class=confluenceTd The a shape=rect class=external-link 
href=http://esper.codehaus.org/esper-4.10.0/doc/reference/en-US/html/event_patterns.html;
 rel=nofollowEsper Pattern expression/a as a String to filter events 
/td/trtrtd colspan=1 rowspan=1 class=confluenceTd tteql/tt 
/tdtd colspan=1 rowspan=1 class=confluenceTd#160;/tdtd 
colspan=1 rowspan=1 class=confluenceTd The a shape=rect 
class=external-link 
href=http://esper.codehaus.org/esper-4.10.0/doc/reference/en-US/html/epl_clauses.html;
 rel=nofollowEsper EQL expression/a 
 as a String to filter events /td/tr/tbody/table
 /div
 /div
 
@@ -3660,8 +3669,8 @@ from(esper://cheese?pattern=every event
 
 div class=code panel style=border-width: 1px;div class=codeContent 
panelContent
 script class=theme: Default; brush: java; gutter: false 
type=syntaxhighlighter![CDATA[
-EventBean newEvent = exchange.getIn(EsperMessage.class).getNewEvent();
-EventBean oldEvent = exchange.getIn(EsperMessage.class).getOldEvent();
+  EventBean newEvent = exchange.getIn(EsperMessage.class).getNewEvent();
+  EventBean oldEvent = exchange.getIn(EsperMessage.class).getOldEvent();
 ]]/script
 /div/div
 

Modified: websites/production/camel/content/book-in-one-page.html
==
--- websites/production/camel/content/book-in-one-page.html (original)
+++ websites/production/camel/content/book-in-one-page.html Fri Oct 25 15:19:40 
2013
@@ -25158,18 +25158,27 @@ esper:name[?options]
 
 pWhen consuming from an Esper endpoint you must specify a bpattern/b or 
beql/b statement to query the event stream./p
 
-pFor example/p
+pPattern example:/p
+div class=code panel style=border-width: 1px;div class=codeContent 
panelContent
+script class=theme: Default; brush: java; gutter: false 
type=syntaxhighlighter![CDATA[
+from(esper://cheese?pattern=every event=MyEvent(bar=5))
+  .to(activemq:Foo);
+]]/script
+/div/div
 
+pEQL 

[CONF] Apache Camel Camel 2.13.0 Release

2013-10-25 Thread Henryk Konsek (Confluence)







Camel 2.13.0 Release
Page edited by Henryk Konsek


Comment:
Added information about JavaConfig changes


 Changes (1)
 




...
* Like as {{JpaConsumer}} now also {{JpaProducer}} of the [JPA] component supports the {{CamelEntityManager}} header. * [Restlet] consumer now supports returning custom headers as HTTP headers from the Camel [Message]. 
* [Spring Java Config] {{CamelConfiguration}} now automagically detects all {{RouteBuilder}} instances registered in the Spring context if {{CamelConfiguration#routes}} method is not overridden. 
 h3. Fixed Issues 
...


Full Content

Camel 2.13.0 release (currently in progress)




New and Noteworthy

Welcome to the 2.13.0 release which approx XXX issues resolved (new features, improvements and bug fixes such as...)


	When using multiple OSGi Blueprint cm:property-placeholder's then Camel now favors using non-default placeholders, or the last property-placeholder defined in the Blueprint XML file. This allows for example to define default properties in one placeholder, and override these values in other placeholders.
	FTP consumer allow to download a single named file without using the FTP LIST command. This allows to download a known file from a FTP server even when the user account does not have permission to do FTP LIST command.
	FTP consumer allow to ignore file not found or insufficient file permission errors.
	Data Format using marshal now leverages Stream caching out of the box if enabled, which allows to marshal big streams and spool to disk, instead of being pure in-memory based.
	Improved using Bean when the bean is looked up in the Registry, when using concurrent processing in the route.
	Added cache option to beanRef and bean in the DSL. This avoids looking up the Bean from the Registry on each usage; this can safely be done for singleton beans.
	Configuring Data Formats in XML attributes now supports reference lookup using the # syntax, eg jaxb xmlStreamWriterWrapper="#myWriterWrapper" ..
	JDBC component now also support outputType to specify the expected output as either a List or single Object. As well allow to map to a bean using a BeanRowMapper to control the mapping of ROW names to bean properties.
	Both Quartz as well as Quartz2 based ScheduledRoutePolicy has been improved to better support cluster setups (e.g. to not schedule jobs being already scheduled through another node inside a given cluster).
	Reduced the work the Aggregate EIP does while holding a lock during aggregation, which can lead to improved performance in some use-cases.
	JndiRegistry now implements all the find methods.
	VM component now supports multipleConsumers=true across deployment units.
	Added @PreConsumed to JPA consumer.
	Added CamelFileName header support to the HDFS producer
	Like as JpaConsumer now also JpaProducer of the JPA component supports the CamelEntityManager header.
	Restlet consumer now supports returning custom headers as HTTP headers from the Camel Message.
	Spring Java Config CamelConfiguration now automagically detects all RouteBuilder instances registered in the Spring context if CamelConfiguration#routes method is not overridden.



Fixed Issues


	Fixed an ArrayIndexOutOfBoundsException with Message History when using SEDA
	Fixed requestTimeout on Netty not triggering when we have received message.
	Fixed Parameter Binding Annotations on boolean types to evaluate as Predicate instead of _expression_
	Fixed using File consumer with delete=truereadLock=fileLock not being able to delete the file on Windows.
	Fixed Throttler to honor time slots after period expires (eg so it works consistently and as expected).
	Fixed getting JMSXUserID property when consuming from ActiveMQ
	Fixed interceptFrom to support property placeholders
	Fixed a race condition in initializing SSLContext in Netty and Netty HTTP
	Fixed using Recipient List, Routing Slip calling another route which is configured with NoErrorHandler, and an exception occurred in that route, would be propagated back as not-exhausted, allow the caller route to have its error handler react on the exception.
	Fixed Quartz and exception was thrown when scheduling a job, would affect during shutdown, assuming the job was still in progress, and not shutdown the Quartz scheduler.
	Fixed so you can configure Stomp endpoints using URIs
	Fixed memory leak when using Language component with camel-script languages and having contentCache=false
	Fixed Error Handler may log at WARN level "Cannot determine current route from Exchange" when using Splitter
	Fixed camel-fop to work in Apache Karaf and ServiceMix
	Fixed HDFS producer to use the configured UuidGenerator when generating split file names to avoid filename collisions
	

git commit: Updated JavaConfig Javadoc.

2013-10-25 Thread hekonsek
Updated Branches:
  refs/heads/master 6eafddcf2 - 5055f6739


Updated JavaConfig Javadoc.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/5055f673
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/5055f673
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/5055f673

Branch: refs/heads/master
Commit: 5055f6739f51c18e201ade164bb09a7d61a14632
Parents: 6eafddc
Author: Henryk Konsek hekon...@gmail.com
Authored: Fri Oct 25 21:16:36 2013 +0200
Committer: Henryk Konsek hekon...@gmail.com
Committed: Fri Oct 25 21:16:36 2013 +0200

--
 .../org/apache/camel/spring/javaconfig/CamelConfiguration.java| 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/5055f673/components/camel-spring-javaconfig/src/main/java/org/apache/camel/spring/javaconfig/CamelConfiguration.java
--
diff --git 
a/components/camel-spring-javaconfig/src/main/java/org/apache/camel/spring/javaconfig/CamelConfiguration.java
 
b/components/camel-spring-javaconfig/src/main/java/org/apache/camel/spring/javaconfig/CamelConfiguration.java
index ba0ac09..c6e5142 100644
--- 
a/components/camel-spring-javaconfig/src/main/java/org/apache/camel/spring/javaconfig/CamelConfiguration.java
+++ 
b/components/camel-spring-javaconfig/src/main/java/org/apache/camel/spring/javaconfig/CamelConfiguration.java
@@ -41,7 +41,8 @@ import org.springframework.context.annotation.Configuration;
  * A useful base class for writing
  * a
  * 
href=http://docs.spring.io/spring/docs/current/spring-framework-reference/html/beans.html#beans-annotation-config;
- * Spring annotation-based/a configurations for working with Camel.
+ * Spring annotation-based/a configurations for working with Camel. Unless 
{@link #routes()} method is overridden, this configuration
+ * automagically load all the {@link org.apache.camel.builder.RouteBuilder} 
instances available in the Spring context.
  */
 @Configuration
 public abstract class CamelConfiguration implements BeanFactoryAware, 
ApplicationContextAware {



svn commit: r884105 - in /websites/production/camel/content: cache/main.pageCache camel-2130-release.html

2013-10-25 Thread buildbot
Author: buildbot
Date: Fri Oct 25 19:19:16 2013
New Revision: 884105

Log:
Production update by buildbot for camel

Modified:
websites/production/camel/content/cache/main.pageCache
websites/production/camel/content/camel-2130-release.html

Modified: websites/production/camel/content/cache/main.pageCache
==
Binary files - no diff available.

Modified: websites/production/camel/content/camel-2130-release.html
==
--- websites/production/camel/content/camel-2130-release.html (original)
+++ websites/production/camel/content/camel-2130-release.html Fri Oct 25 
19:19:16 2013
@@ -94,7 +94,7 @@
 
 pWelcome to the 2.13.0 release which approx XXX issues resolved (new 
features, improvements and bug fixes such as...)/p
 
-ulliWhen using multiple OSGi Blueprint lt;cm:property-placeholdergt;'s 
then Camel now favors using non-default placeholders, or the last 
property-placeholder defined in the Blueprint XML file. This allows for example 
to define default properties in one placeholder, and override these values in 
other placeholders./lilia shape=rect href=ftp2.html 
title=FTP2FTP/a consumer allow to download a single named file without 
using the FTP LIST command. This allows to download a known file from a FTP 
server even when the user account does not have permission to do FTP LIST 
command./lilia shape=rect href=ftp2.html title=FTP2FTP/a consumer 
allow to ignore file not found or insufficient file permission 
errors./lilia shape=rect href=data-format.html title=Data 
FormatData Format/a using marshal now leverages a shape=rect 
href=stream-caching.html title=Stream cachingStream caching/a out of the 
box if enabled, which allows to marshal big stream
 s and spool to disk, instead of being pure in-memory based./liliImproved 
using a shape=rect href=bean.html title=BeanBean/a when the bean is 
looked up in the a shape=rect href=registry.html 
title=RegistryRegistry/a, when using concurrent processing in the 
route./liliAdded ttcache/tt option to ttbeanRef/tt and 
ttlt;beangt;/tt in the DSL. This avoids looking up the a shape=rect 
href=bean.html title=BeanBean/a from the a shape=rect 
href=registry.html title=RegistryRegistry/a on each usage; this can 
safely be done for singleton beans./liliConfiguring a shape=rect 
href=data-format.html title=Data FormatData Format/as in XML attributes 
now supports reference lookup using the # syntax, eg ttlt;jaxb 
xmlStreamWriterWrapper=#myWriterWrapper ..gt;/tt/lilia shape=rect 
href=jdbc.html title=JDBCJDBC/a component now also support 
ttoutputType/tt to specify the expected output as either a List or si
 ngle Object. As well allow to map to a bean using a ttBeanRowMapper/tt to 
control the mapping of ROW names to bean properties./liliBoth a 
shape=rect href=quartz.html title=QuartzQuartz/a as well as a 
shape=rect href=quartz2.html title=Quartz2Quartz2/a based a 
shape=rect href=scheduledroutepolicy.html 
title=ScheduledRoutePolicyScheduledRoutePolicy/a has been improved to 
better support cluster setups (e.g. to not schedule jobs being already 
scheduled through another node inside a given cluster)./liliReduced the 
work the a shape=rect href=aggregator2.html 
title=Aggregator2Aggregate/a EIP does while holding a lock during 
aggregation, which can lead to improved performance in some 
use-cases./lilittJndiRegistry/tt now implements all the find 
methods./lilia shape=rect href=vm.html title=VMVM/a component now 
supports ttmultipleConsumers=true/tt across deployment units./liliAdded 
tt@PreConsumed/tt to a sha
 pe=rect href=jpa.html title=JPAJPA/a consumer./liliAdded 
CamelFileName header support to the a shape=rect href=hdfs.html 
title=HDFSHDFS/a producer/liliLike as ttJpaConsumer/tt now also 
ttJpaProducer/tt of the a shape=rect href=jpa.html title=JPAJPA/a 
component supports the ttCamelEntityManager/tt header./lilia 
shape=rect href=restlet.html title=RestletRestlet/a consumer now 
supports returning custom headers as HTTP headers from the Camel a 
shape=rect href=message.html title=MessageMessage/a./li/ul
+ulliWhen using multiple OSGi Blueprint lt;cm:property-placeholdergt;'s 
then Camel now favors using non-default placeholders, or the last 
property-placeholder defined in the Blueprint XML file. This allows for example 
to define default properties in one placeholder, and override these values in 
other placeholders./lilia shape=rect href=ftp2.html 
title=FTP2FTP/a consumer allow to download a single named file without 
using the FTP LIST command. This allows to download a known file from a FTP 
server even when the user account does not have permission to do FTP LIST 
command./lilia shape=rect href=ftp2.html title=FTP2FTP/a consumer 
allow to ignore file not found or insufficient file permission 
errors./lilia shape=rect href=data-format.html title=Data 
FormatData Format/a using marshal now leverages a 

[CONF] Apache Camel Spring Java Config

2013-10-25 Thread Henryk Konsek (Confluence)







Spring Java Config
Page edited by Henryk Konsek


Comment:
Updated RouteBuilder autodetection information.


 Changes (1)
 




...
The *@ContextConfiguration* annotation tells the [Spring Testing] framework to load the *ContextConfig* class as the configuration to use. This class derives from *SingleRouteCamelConfiguration* which is a helper Spring Java Config class which will configure the CamelContext for us and then register the RouteBuilder we create.  
If you wish to create a collection of *RouteBuilder* instances then derive from the *CamelConfiguration* helper class and implement the *routes()* method. Keep in mind that starting from the Camel 2.13.0 if you dont override *routes()* method, then *CamelConfiguration* will use all *RouteBuilder* instances available in the Spring context. 
 Since *Camel 2.11.0* you can use the CamelSpringJUnit4ClassRunner with CamelSpringDelegatingTestContextLoader like [example using Java Config with CamelSpringJUnit4ClassRunner|http://svn.apache.org/repos/asf/camel/trunk/components/camel-spring-javaconfig/src/test/java/org/apache/camel/spring/javaconfig/test/CamelSpringDelegatingTestContextLoaderTest.java]. 
...


Full Content

Spring Java Config

Spring started life using XML Config to wire beans together. However some folks don't like using XML and would rather use Java code which led to the creation of Guice along with the Spring JavaConfig project.

You can use either the XML or Java config approachs with Camel; its your choice really on which you prefer.

NOTE: From Camel 2.2.0 camel-spring-javaconfig is moved to Spring 3.x, which means you can't run it with spring 2.x.

Using Spring Java Config

To use Spring Java Config in your Camel project the easiest thing to do is add the following to your pom.xml



dependency
  groupIdorg.apache.camel/groupId
  artifactIdcamel-spring-javaconfig/artifactId
  version${camel-version}/version
/dependency



This will then add the dependencies on the Spring JavaConfig library along with some helper classes for configuring Camel inside Spring.

Note that this library is totally optional; you could just wire Camel together yourself with Java Config.

Example

The following example using Java Config is actually a Spring Testing based unit test.





The @ContextConfiguration annotation tells the Spring Testing framework to load the ContextConfig class as the configuration to use. This class derives from SingleRouteCamelConfiguration which is a helper Spring Java Config class which will configure the CamelContext for us and then register the RouteBuilder we create.

If you wish to create a collection of RouteBuilder instances then derive from the CamelConfiguration helper class and implement the routes() method. Keep in mind that starting from the Camel 2.13.0 if you don't override routes() method, then CamelConfiguration will use all RouteBuilder instances available in the Spring context.

Since Camel 2.11.0 you can use the CamelSpringJUnit4ClassRunner with CamelSpringDelegatingTestContextLoader like example using Java Config with CamelSpringJUnit4ClassRunner.


.



Stop watching space
|
Change email notification preferences

View Online
|
View Changes









[CONF] Apache Camel Spring Java Config

2013-10-25 Thread Henryk Konsek (Confluence)







Spring Java Config
Page edited by Henryk Konsek


 Changes (1)
 




...
The *@ContextConfiguration* annotation tells the [Spring Testing] framework to load the *ContextConfig* class as the configuration to use. This class derives from *SingleRouteCamelConfiguration* which is a helper Spring Java Config class which will configure the CamelContext for us and then register the RouteBuilder we create.  
If you wish to create a collection of *RouteBuilder* instances then derive from the *CamelConfiguration* helper class and implement the *routes()* method. Keep in mind that (starting from the Camel 2.13.0) if you dont override *routes()* method, then *CamelConfiguration* will use all *RouteBuilder* instances available in the Spring context. 
 Since *Camel 2.11.0* you can use the CamelSpringJUnit4ClassRunner with CamelSpringDelegatingTestContextLoader like [example using Java Config with CamelSpringJUnit4ClassRunner|http://svn.apache.org/repos/asf/camel/trunk/components/camel-spring-javaconfig/src/test/java/org/apache/camel/spring/javaconfig/test/CamelSpringDelegatingTestContextLoaderTest.java]. 
...


Full Content

Spring Java Config

Spring started life using XML Config to wire beans together. However some folks don't like using XML and would rather use Java code which led to the creation of Guice along with the Spring JavaConfig project.

You can use either the XML or Java config approachs with Camel; its your choice really on which you prefer.

NOTE: From Camel 2.2.0 camel-spring-javaconfig is moved to Spring 3.x, which means you can't run it with spring 2.x.

Using Spring Java Config

To use Spring Java Config in your Camel project the easiest thing to do is add the following to your pom.xml



dependency
  groupIdorg.apache.camel/groupId
  artifactIdcamel-spring-javaconfig/artifactId
  version${camel-version}/version
/dependency



This will then add the dependencies on the Spring JavaConfig library along with some helper classes for configuring Camel inside Spring.

Note that this library is totally optional; you could just wire Camel together yourself with Java Config.

Example

The following example using Java Config is actually a Spring Testing based unit test.





The @ContextConfiguration annotation tells the Spring Testing framework to load the ContextConfig class as the configuration to use. This class derives from SingleRouteCamelConfiguration which is a helper Spring Java Config class which will configure the CamelContext for us and then register the RouteBuilder we create.

If you wish to create a collection of RouteBuilder instances then derive from the CamelConfiguration helper class and implement the routes() method. Keep in mind that (starting from the Camel 2.13.0) if you don't override routes() method, then CamelConfiguration will use all RouteBuilder instances available in the Spring context.

Since Camel 2.11.0 you can use the CamelSpringJUnit4ClassRunner with CamelSpringDelegatingTestContextLoader like example using Java Config with CamelSpringJUnit4ClassRunner.


.



Stop watching space
|
Change email notification preferences

View Online
|
View Changes









[CONF] Apache Camel Spring Java Config

2013-10-25 Thread Henryk Konsek (Confluence)







Spring Java Config
Page edited by Henryk Konsek


Comment:
Extended documentation with common use cases.


 Changes (3)
 




...
Note that this library is totally optional; you could just wire Camel together yourself with Java Config.  
h3. Example 
h3. Common cases 
 
The most common case of using JavaConfig with Camel would be to create configuration with defined list of routes to be used by router.  {code:java} @Configuration public class MyRouteConfiguration extends CamelConfiguration {  @Autowire private MyRouteBuilder myRouteBuilder;  @Autowire private MyAnotherRouteBuilder myAnotherRouteBuilder;  @Override public ListRouteBuilder routes() { return Arrays.asList(myRouteBuilder, myAnotherRouteBuilder); }   } {code}  Starting from Camel 2.13.0 you can skip the *routes()* definition, and fall back to the *RouteBuilder* instances located in the Spring context.  {code:java} @Configuration @ComponentScan(com.example.routes) public class MyRouteConfiguration extends CamelConfiguration { } {code}  h3. Other examples  
The following [example using Java Config|http://svn.apache.org/repos/asf/camel/trunk/components/camel-spring-javaconfig/src/test/java/org/apache/camel/spring/javaconfig/patterns/FilterTest.java] is actually a [Spring Testing] based unit test.  
...


Full Content

Spring Java Config

Spring started life using XML Config to wire beans together. However some folks don't like using XML and would rather use Java code which led to the creation of Guice along with the Spring JavaConfig project.

You can use either the XML or Java config approachs with Camel; its your choice really on which you prefer.

NOTE: From Camel 2.2.0 camel-spring-javaconfig is moved to Spring 3.x, which means you can't run it with spring 2.x.

Using Spring Java Config

To use Spring Java Config in your Camel project the easiest thing to do is add the following to your pom.xml



dependency
  groupIdorg.apache.camel/groupId
  artifactIdcamel-spring-javaconfig/artifactId
  version${camel-version}/version
/dependency



This will then add the dependencies on the Spring JavaConfig library along with some helper classes for configuring Camel inside Spring.

Note that this library is totally optional; you could just wire Camel together yourself with Java Config.

Common cases

The most common case of using JavaConfig with Camel would be to create configuration with defined list of routes to be used by router.



@Configuration
public class MyRouteConfiguration extends CamelConfiguration {

@Autowire
private MyRouteBuilder myRouteBuilder;

@Autowire
private MyAnotherRouteBuilder myAnotherRouteBuilder;

@Override
public ListRouteBuilder routes() {
return Arrays.asList(myRouteBuilder, myAnotherRouteBuilder);
} 

}



Starting from Camel 2.13.0 you can skip the routes() definition, and fall back to the RouteBuilder instances located in the Spring context.



@Configuration
@ComponentScan("com.example.routes")
public class MyRouteConfiguration extends CamelConfiguration {
}



Other examples

The following example using Java Config is actually a Spring Testing based unit test.





The @ContextConfiguration annotation tells the Spring Testing framework to load the ContextConfig class as the configuration to use. This class derives from SingleRouteCamelConfiguration which is a helper Spring Java Config class which will configure the CamelContext for us and then register the RouteBuilder we create.

If you wish to create a collection of RouteBuilder instances then derive from the CamelConfiguration helper class and implement the routes() method. Keep in mind that (starting from the Camel 2.13.0) if you don't override routes() method, then CamelConfiguration will use all RouteBuilder instances available in the Spring context.

Since Camel 2.11.0 you can use the CamelSpringJUnit4ClassRunner with CamelSpringDelegatingTestContextLoader like example using Java Config with CamelSpringJUnit4ClassRunner.


.



Stop watching space
|
Change email notification preferences

View Online
|
View Changes









svn commit: r884111 - in /websites/production/camel/content: cache/main.pageCache spring-java-config.html

2013-10-25 Thread buildbot
Author: buildbot
Date: Fri Oct 25 20:19:34 2013
New Revision: 884111

Log:
Production update by buildbot for camel

Modified:
websites/production/camel/content/cache/main.pageCache
websites/production/camel/content/spring-java-config.html

Modified: websites/production/camel/content/cache/main.pageCache
==
Binary files - no diff available.

Modified: websites/production/camel/content/spring-java-config.html
==
--- websites/production/camel/content/spring-java-config.html (original)
+++ websites/production/camel/content/spring-java-config.html Fri Oct 25 
20:19:34 2013
@@ -111,7 +111,42 @@
 
 pNote that this library is totally optional; you could just wire Camel 
together yourself with Java Config./p
 
-h3a shape=rect name=SpringJavaConfig-Example/aExample/h3
+h3a shape=rect name=SpringJavaConfig-Commoncases/aCommon cases/h3
+
+pThe most common case of using JavaConfig with Camel would be to create 
configuration with defined list of routes to be used by router./p
+
+div class=code panel style=border-width: 1px;div class=codeContent 
panelContent
+script class=theme: Default; brush: java; gutter: false 
type=syntaxhighlighter![CDATA[
+@Configuration
+public class MyRouteConfiguration extends CamelConfiguration {
+
+@Autowire
+private MyRouteBuilder myRouteBuilder;
+
+@Autowire
+private MyAnotherRouteBuilder myAnotherRouteBuilder;
+
+@Override
+public Listlt;RouteBuildergt; routes() {
+return Arrays.asList(myRouteBuilder, myAnotherRouteBuilder);
+} 
+
+}
+]]/script
+/div/div
+
+pStarting from Camel 2.13.0 you can skip the broutes()/b definition, and 
fall back to the bRouteBuilder/b instances located in the Spring 
context./p
+
+div class=code panel style=border-width: 1px;div class=codeContent 
panelContent
+script class=theme: Default; brush: java; gutter: false 
type=syntaxhighlighter![CDATA[
+@Configuration
+@ComponentScan(com.example.routes)
+public class MyRouteConfiguration extends CamelConfiguration {
+}
+]]/script
+/div/div
+
+h3a shape=rect name=SpringJavaConfig-Otherexamples/aOther 
examples/h3
 
 pThe following a shape=rect class=external-link 
href=http://svn.apache.org/repos/asf/camel/trunk/components/camel-spring-javaconfig/src/test/java/org/apache/camel/spring/javaconfig/patterns/FilterTest.java;example
 using Java Config/a is actually a a shape=rect href=spring-testing.html 
title=Spring TestingSpring Testing/a based unit test./p
 
@@ -167,7 +202,7 @@ public class FilterTest extends Abstract
 
 pThe b@ContextConfiguration/b annotation tells the a shape=rect 
href=spring-testing.html title=Spring TestingSpring Testing/a framework 
to load the bContextConfig/b class as the configuration to use. This class 
derives from bSingleRouteCamelConfiguration/b which is a helper Spring Java 
Config class which will configure the CamelContext for us and then register the 
RouteBuilder we create./p
 
-pIf you wish to create a collection of bRouteBuilder/b instances then 
derive from the bCamelConfiguration/b helper class and implement the 
broutes()/b method./p
+pIf you wish to create a collection of bRouteBuilder/b instances then 
derive from the bCamelConfiguration/b helper class and implement the 
broutes()/b method. Keep in mind that (starting from the Camel 2.13.0) if 
you don't override broutes()/b method, then bCamelConfiguration/b will 
use all bRouteBuilder/b instances available in the Spring context./p
 
 pSince bCamel 2.11.0/b you can use the CamelSpringJUnit4ClassRunner with 
CamelSpringDelegatingTestContextLoader like a shape=rect 
class=external-link 
href=http://svn.apache.org/repos/asf/camel/trunk/components/camel-spring-javaconfig/src/test/java/org/apache/camel/spring/javaconfig/test/CamelSpringDelegatingTestContextLoaderTest.java;example
 using Java Config with CamelSpringJUnit4ClassRunner/a.br clear=none
 /pdiv class=code panel style=border-width: 1px;div class=codeContent 
panelContent




svn commit: r884156 - in /websites/production/camel/content: cache/main.pageCache team.html

2013-10-25 Thread buildbot
Author: buildbot
Date: Sat Oct 26 04:48:58 2013
New Revision: 884156

Log:
Production update by buildbot for camel

Modified:
websites/production/camel/content/cache/main.pageCache
websites/production/camel/content/team.html

Modified: websites/production/camel/content/cache/main.pageCache
==
Binary files - no diff available.

Modified: websites/production/camel/content/team.html
==
--- websites/production/camel/content/team.html (original)
+++ websites/production/camel/content/team.html Sat Oct 26 04:48:58 2013
@@ -89,7 +89,7 @@
 div class=panelMacrotable class=infoMacrocolgroup span=1col 
span=1 width=24col span=1/colgrouptrtd colspan=1 rowspan=1 
valign=topimg align=middle 
src=https://cwiki.apache.org/confluence/images/icons/emoticons/information.gif;
 width=16 height=16 alt= border=0/tdtd colspan=1 
rowspan=1bAdding your name to the list below/bbr clear=noneIf you 
have been contributing to the Apache Camel project, and you want your name 
added to the list below. Then you can get in touch with the Camel team from the 
a shape=rect href=mailing-lists.html title=Mailing ListsMailing 
Lists/a and ask to be added./td/tr/table/div
 
 div class=table-wrap
-table class=confluenceTabletbodytrth colspan=1 rowspan=1 
class=confluenceTh Name /thth colspan=1 rowspan=1 
class=confluenceTh Organisation /th/trtrtd colspan=1 rowspan=1 
class=confluenceTd Aaron Crickenberger /tdtd colspan=1 rowspan=1 
class=confluenceTd#160;/td/trtrtd colspan=1 rowspan=1 
class=confluenceTd Al Maw /tdtd colspan=1 rowspan=1 
class=confluenceTd#160;/td/trtrtd colspan=1 rowspan=1 
class=confluenceTd Aleksi Kallio /tdtd colspan=1 rowspan=1 
class=confluenceTd#160;/td/trtrtd colspan=1 rowspan=1 
class=confluenceTd Andrew Deason /tdtd colspan=1 rowspan=1 
class=confluenceTd#160;/td/trtrtd colspan=1 rowspan=1 
class=confluenceTd Andy Depue /tdtd colspan=1 rowspan=1 
class=confluenceTd#160;/td/trtrtd colspan=1 rowspan=1 
class=confluenceTd Axel Hohaus /tdtd colspan=1 rowspan=1 
class=confluenceTd#160;/td/tr
 trtd colspan=1 rowspan=1 class=confluenceTd Arjan Moraal /tdtd 
colspan=1 rowspan=1 class=confluenceTd#160;/td/trtrtd 
colspan=1 rowspan=1 class=confluenceTd Barry Kaplan /tdtd colspan=1 
rowspan=1 class=confluenceTd#160;/td/trtrtd colspan=1 
rowspan=1 class=confluenceTd Brett Meyer /tdtd colspan=1 rowspan=1 
class=confluenceTd a shape=rect class=external-link 
href=http://www.3riverdev.com; rel=nofollow3River Development/a 
/td/trtrtd colspan=1 rowspan=1 class=confluenceTd Brian 
Diesenhaus /tdtd colspan=1 rowspan=1 
class=confluenceTd#160;/td/trtrtd colspan=1 rowspan=1 
class=confluenceTd Brian Guan /tdtd colspan=1 rowspan=1 
class=confluenceTd#160;/td/trtrtd colspan=1 rowspan=1 
class=confluenceTd Brian Madigan /tdtd colspan=1 rowspan=1 
class=confluenceTd#160;/td/trtrtd colspan=1 rowspan=1 
class=confluenceTd Bruno Barin /td
 td colspan=1 rowspan=1 class=confluenceTd#160;/td/trtrtd 
 colspan=1 rowspan=1 class=confluenceTd Bruno Borges /tdtd 
 colspan=1 rowspan=1 class=confluenceTd#160;/td/trtrtd 
 colspan=1 rowspan=1 class=confluenceTd Bryan Schmidt /tdtd 
 colspan=1 rowspan=1 class=confluenceTd#160;/td/trtrtd 
 colspan=1 rowspan=1 class=confluenceTd Chris Kingsbury /tdtd 
 colspan=1 rowspan=1 class=confluenceTd a shape=rect 
 class=external-link href=http://www.tradingscreen.com; 
 rel=nofollowTradingScreen/a /td/trtrtd colspan=1 rowspan=1 
 class=confluenceTd Christopher G. Stach II /tdtd colspan=1 
 rowspan=1 class=confluenceTd#160;/td/trtrtd colspan=1 
 rowspan=1 class=confluenceTd Charles Anthony /tdtd colspan=1 
 rowspan=1 class=confluenceTd#160;/td/trtrtd colspan=1 
 rowspan=1 class=confluenceTd a shape=rect class=external-link 
 href=http://christianposta.com/bl
 og rel=nofollowChristian Posta/a /tdtd colspan=1 rowspan=1 
class=confluenceTd Red Hat /td/trtrtd colspan=1 rowspan=1 
class=confluenceTd Christopher K#246;ster /tdtd colspan=1 rowspan=1 
class=confluenceTd#160;/td/trtrtd colspan=1 rowspan=1 
class=confluenceTd Claus Straube /tdtd colspan=1 rowspan=1 
class=confluenceTd#160;/td/trtrtd colspan=1 rowspan=1 
class=confluenceTd Dan Checkoway /tdtd colspan=1 rowspan=1 
class=confluenceTd#160;/td/trtrtd colspan=1 rowspan=1 
class=confluenceTd Dennis Byrne /tdtd colspan=1 rowspan=1 
class=confluenceTd a shape=rect class=external-link 
href=http://www.thoughtworks.com; rel=nofollowThoughtworks/a 
/td/trtrtd colspan=1 rowspan=1 class=confluenceTd Erik Onnen 
/tdtd colspan=1 rowspan=1 class=confluenceTd#160;/td/trtrtd 
colspan=1 rowspan=1 class=confluenceTd Fernando Ribeiro /tdtd 
colspan=
 1 rowspan=1 class=confluenceTd Upic /td/trtrtd colspan=1 
rowspan=1 class=confluenceTd Gert Vanthienen /tdtd colspan=1 
rowspan=1 class=confluenceTd#160;/td/trtrtd colspan=1 
rowspan=1 class=confluenceTd Glen Klyuzner /tdtd colspan=1 
rowspan=1 class=confluenceTd a shape=rect