[2/2] git commit: CAMEL-6957 CxfEndpoint setServiceClass should check the empty String

2013-11-12 Thread ningjiang
CAMEL-6957 CxfEndpoint setServiceClass should check the empty String


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

Branch: refs/heads/camel-2.11.x
Commit: c94a539189e64f313a703d1154d120c5f9dfe3a1
Parents: 4e3302f
Author: Willem Jiang 
Authored: Wed Nov 13 15:22:28 2013 +0800
Committer: Willem Jiang 
Committed: Wed Nov 13 15:56:31 2013 +0800

--
 .../src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java | 3 +++
 1 file changed, 3 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/c94a5391/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
--
diff --git 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
index 88cdda6..7003723 100644
--- 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
+++ 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
@@ -661,6 +661,9 @@ public class CxfEndpoint extends DefaultEndpoint implements 
HeaderFilterStrategy
 }
 
 public void setServiceClass(String type) throws ClassNotFoundException {
+if (ObjectHelper.isEmpty(type)) {
+throw new IllegalArgumentException("The serviceClass option should 
not be set with Emptye String.");
+}
 serviceClass = 
ClassLoaderUtils.loadClass(resolvePropertyPlaceholders(type), getClass());
 }
 



[1/2] git commit: CAMEL-6957 CxfEndpoint setServiceClass should check the empty String

2013-11-12 Thread ningjiang
Updated Branches:
  refs/heads/camel-2.11.x 4e3302f87 -> c94a53918
  refs/heads/camel-2.12.x c3e63e32c -> 4c3d34a38


CAMEL-6957 CxfEndpoint setServiceClass should check the empty String


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

Branch: refs/heads/camel-2.12.x
Commit: 4c3d34a38d525c80d37c338c802943c29e7a1957
Parents: c3e63e3
Author: Willem Jiang 
Authored: Wed Nov 13 15:22:28 2013 +0800
Committer: Willem Jiang 
Committed: Wed Nov 13 15:55:47 2013 +0800

--
 .../src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java | 3 +++
 1 file changed, 3 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/4c3d34a3/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
--
diff --git 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
index d6ed579..5e7e941 100644
--- 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
+++ 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
@@ -662,6 +662,9 @@ public class CxfEndpoint extends DefaultEndpoint implements 
HeaderFilterStrategy
 }
 
 public void setServiceClass(String type) throws ClassNotFoundException {
+if (ObjectHelper.isEmpty(type)) {
+throw new IllegalArgumentException("The serviceClass option should 
not be set with Emptye String.");
+}
 serviceClass = 
ClassLoaderUtils.loadClass(resolvePropertyPlaceholders(type), getClass());
 }
 



[2/2] git commit: CAMEL-6957 CxfEndpoint setServiceClass should check the empty String

2013-11-12 Thread ningjiang
CAMEL-6957 CxfEndpoint setServiceClass should check the empty String


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

Branch: refs/heads/master
Commit: f043ad9cb31080cdfd01a481c15a8ff6a8354ec7
Parents: cbf1a02
Author: Willem Jiang 
Authored: Wed Nov 13 15:22:28 2013 +0800
Committer: Willem Jiang 
Committed: Wed Nov 13 15:22:28 2013 +0800

--
 .../src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java | 3 +++
 1 file changed, 3 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/f043ad9c/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
--
diff --git 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
index d6ed579..5e7e941 100644
--- 
a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
+++ 
b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfEndpoint.java
@@ -662,6 +662,9 @@ public class CxfEndpoint extends DefaultEndpoint implements 
HeaderFilterStrategy
 }
 
 public void setServiceClass(String type) throws ClassNotFoundException {
+if (ObjectHelper.isEmpty(type)) {
+throw new IllegalArgumentException("The serviceClass option should 
not be set with Emptye String.");
+}
 serviceClass = 
ClassLoaderUtils.loadClass(resolvePropertyPlaceholders(type), getClass());
 }
 



[1/2] git commit: Added an unit test based on the mailing list

2013-11-12 Thread ningjiang
Updated Branches:
  refs/heads/master 0d95b9f36 -> f043ad9cb


Added an unit test based on the mailing list


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

Branch: refs/heads/master
Commit: cbf1a0244f1cfbedbf4e9be1b52414f4218539d5
Parents: 0d95b9f
Author: Willem Jiang 
Authored: Wed Nov 13 11:54:50 2013 +0800
Committer: Willem Jiang 
Committed: Wed Nov 13 14:30:48 2013 +0800

--
 .../test/java/org/apache/camel/jaxb/CamelJaxbTest.java   | 11 +++
 1 file changed, 11 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/cbf1a024/components/camel-jaxb/src/test/java/org/apache/camel/jaxb/CamelJaxbTest.java
--
diff --git 
a/components/camel-jaxb/src/test/java/org/apache/camel/jaxb/CamelJaxbTest.java 
b/components/camel-jaxb/src/test/java/org/apache/camel/jaxb/CamelJaxbTest.java
index 010f80e..ab1daf5 100644
--- 
a/components/camel-jaxb/src/test/java/org/apache/camel/jaxb/CamelJaxbTest.java
+++ 
b/components/camel-jaxb/src/test/java/org/apache/camel/jaxb/CamelJaxbTest.java
@@ -129,6 +129,12 @@ public class CamelJaxbTest extends CamelTestSupport {
 template.sendBody("direct:getJAXBElement", xml);
 resultEndpoint.assertIsSatisfied();
 assertTrue("We should get the JAXBElement here", 
resultEndpoint.getExchanges().get(0).getIn().getBody() instanceof JAXBElement);
+
+resultEndpoint.reset();
+resultEndpoint.expectedMessageCount(1);
+resultEndpoint.expectedBodiesReceived(expected);
+template.sendBody("direct:unmarshall", xml);
+resultEndpoint.assertIsSatisfied();
 }
 
 @Override
@@ -175,6 +181,11 @@ public class CamelJaxbTest extends CamelTestSupport {
 from("direct:marshalCustomWriterAndFiltering")
 .marshal(customWriterAndFilterFormat)
 .to("mock:result");
+
+from("direct:unmarshall")
+.unmarshal()
+.jaxb(PersonType.class.getPackage().getName())
+.to("mock:result");
 
 }
 };



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

2013-11-12 Thread buildbot
Author: buildbot
Date: Wed Nov 13 03:39:56 2013
New Revision: 886460

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/file2.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 Wed Nov 13 
03:39:56 2013
@@ -4306,10 +4306,10 @@ public class MyFileFilter imple
 And then we can configure our route using the filter attribute to 
reference our filter (using # notation) that we have defined in the 
spring XML file:
 
 

svn commit: r886452 - in /websites/production/camel/content: blueprint-testing.html cache/main.pageCache

2013-11-12 Thread buildbot
Author: buildbot
Date: Wed Nov 13 01:22:28 2013
New Revision: 886452

Log:
Production update by buildbot for camel

Modified:
websites/production/camel/content/blueprint-testing.html
websites/production/camel/content/cache/main.pageCache

Modified: websites/production/camel/content/blueprint-testing.html
==
--- websites/production/camel/content/blueprint-testing.html (original)
+++ websites/production/camel/content/blueprint-testing.html Wed Nov 13 
01:22:28 2013
@@ -88,7 +88,7 @@
 Blueprint Testing
 Available as of Camel 2.10
 
-Testing is a 
crucial part of any development or integration work.  Camel supports the 
definition of Blueprint routes, but given 
Blueprint is an OSGi specific technology, writing unit tests is quite 
difficult.  This library leverages http://code.google.com/p/pojosr/"; rel="nofollow">PojoSR which 
provides a service registry without using a fully compliant OSGi container.  
This allows defining real unit tests (as opposed to integration tests using http://team.ops4j.org/wiki/display/paxexam/Pax+Exam"; rel="nofollow">Pax 
Exam.
+Testing is a 
crucial part of any development or integration work.  Camel supports the 
definition of Blueprint routes, but given 
Blueprint is an OSGi specific technology, writing unit tests is quite 
difficult.  This library leverages http://code.google.com/p/pojosr/"; rel="nofollow">PojoSR which 
provides a service registry without using a fully compliant OSGi container.  
This allows defining real unit tests (as opposed to integration tests using http://team.ops4j.org/wiki/display/paxexam/Pax+Exam"; rel="nofollow">Pax 
Exam. Please make sure all test jars in you class path are OSGi bundle.
 
 
 

[CONF] Apache Camel > Blueprint Testing

2013-11-12 Thread willem jiang (Confluence)







Blueprint Testing
Page edited by willem jiang


 Changes (1)
 




...
*Available as of Camel 2.10*  
[Testing] is a crucial part of any development or integration work.  Camel supports the definition of [Blueprint routes|Using OSGi blueprint with Camel], but given Blueprint is an OSGi specific technology, writing unit tests is quite difficult.  This library leverages [PojoSR|http://code.google.com/p/pojosr/] which provides a service registry without using a fully compliant OSGi container.  This allows defining real unit tests (as opposed to integration tests using [Pax Exam|http://team.ops4j.org/wiki/display/paxexam/Pax+Exam]. Please make sure all test jars in you class path are OSGi bundle. 
 {snippet:lang=java|id=example|url="" 
...


Full Content

Blueprint Testing
Available as of Camel 2.10

Testing is a crucial part of any development or integration work.  Camel supports the definition of Blueprint routes, but given Blueprint is an OSGi specific technology, writing unit tests is quite difficult.  This library leverages PojoSR which provides a service registry without using a fully compliant OSGi container.  This allows defining real unit tests (as opposed to integration tests using Pax Exam. Please make sure all test jars in you class path are OSGi bundle.





Also notice the use of getBlueprintDescriptor to specify the location of the OSGi Blueprint XML file.
If you have multiple OSGi Blueprint XML files, then you can specify them with a comma-separated list in the getBlueprintDescriptor method.

Here's the Blueprint XML file: 




In order to define blueprint tests, add the following dependency in your pom:



  org.apache.camel
  camel-test-blueprint
  2.10
  test




Setting timeout when getting CamelContext
Available as of Camel 2.13.0/2.12.1/2.11.2

CamelBlueprintTestSupport waits 30 sec for Camel Context to be ready by default, now you can override this value in two ways:

	Globally, by setting org.apache.camel.test.blueprint.camelContextCreationTimeout system property.
	Locally for each test, by overriding getCamelContextCreationTimeout method.




Adding services on startup
Available as of Camel 2.11.2/2.12.0

When using camel-test-blueprint you may do unit tests which requires using shared services which is not available during unit testing, but only in the real OSGi container, for example a shared DataSource.

To make it easier to register services on startup, such as a standalone DataSource or any other service, you can override the method addServicesOnStartup when your unit test class extends CamelBlueprintTestSupport.

In the example below we register a service org.apache.camel.test.blueprint.MyService using the name myService having a property beer=Carlsberg, as shown below:


@Override
protected void addServicesOnStartup(Map> services) {
services.put("myService", asService(myService, "beer", "Carlsberg"));
}



The asService is a builder method that makes it easy to register a service with a single property. If you need more properties you can use the asService method that takes a Dictionary as argument. And if you do not need any properties, then just pass in null, eg:


services.put("myService", asService(myService, null));



This allows us to use the service by calling a method on it from a Camel Bean component in a route as shown:



  
  
  




Notice the bean endpoint uses the service name myService which was the name we registered the service as. You can also use the fully qualified class name instead, which is more common with OSGi.



@Override
protected void addServicesOnStartup(Map> services) {
services.put(MyService.class.getName(), asService(myService, "beer", "Carlsberg"));
}



And in the route we use the FQN name:



  
  
  






Stop watching space
|
Change email notification preferences

View Online
|
View Changes









svn commit: r886339 - in /websites/production/camel/content: book-in-one-page.html book-pattern-appendix.html cache/main.pageCache content-enricher.html

2013-11-12 Thread buildbot
Author: buildbot
Date: Tue Nov 12 17:19:28 2013
New Revision: 886339

Log:
Production update by buildbot for camel

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

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 Tue Nov 12 17:19:28 
2013
@@ -19803,6 +19803,10 @@ from("activemq:My.Queue").
 enrich uses a Producer to obtain the additional data. It 
is usually used for Request Reply messaging, for instance to invoke an external web 
service.
 pollEnrich on the other hand uses a Polling Consumer to 
obtain the additional data. It is usually used for Event Message messaging, 
for instance to read a file or download a FTP file.
 
+https://cwiki.apache.org/confluence/images/icons/emoticons/forbidden.gif"; 
width="16" height="16" alt="" border="0">Data from current Exchange not usedpollEnrich or enrich does not access any 
data from the current Exchange which means when polling it cannot use any of the 
existing headers you may have set on the Exchange. For example you cannot set a filename in the 
Exchange.FILE_NAME header and use pollEnrich to consume only 
that file. For that you must set the filename in the endpoint URI.
+
+Instead of using enrich you can use Recipient List and have 
dynamic endpoints and define an AggregationStrategy on the Recipient 
List which then would work as a enrich would 
do.
+
 Enrich Options
 
 

Modified: websites/production/camel/content/book-pattern-appendix.html
==
--- websites/production/camel/content/book-pattern-appendix.html (original)
+++ websites/production/camel/content/book-pattern-appendix.html Tue Nov 12 
17:19:28 2013
@@ -4735,6 +4735,10 @@ from("activemq:My.Queue").
 enrich uses a Producer to obtain the additional data. It 
is usually used for Request Reply messaging, for instance to invoke an external web 
service.
 pollEnrich on the other hand uses a Polling Consumer to 
obtain the additional data. It is usually used for Event Message messaging, 
for instance to read a file or download a FTP file.
 
+https://cwiki.apache.org/confluence/images/icons/emoticons/forbidden.gif"; 
width="16" height="16" alt="" border="0">Data from current Exchange not usedpollEnrich or enrich does not access any 
data from the current Exchange which means when polling it cannot use any of the 
existing headers you may have set on the Exchange. For example you cannot set a filename in the 
Exchange.FILE_NAME header and use pollEnrich to consume only 
that file. For that you must set the filename in the endpoint URI.
+
+Instead of using enrich you can use Recipient List and have 
dynamic endpoints and define an AggregationStrategy on the Recipient 
List which then would work as a enrich would 
do.
+
 Enrich 
Options
 
 

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

Modified: websites/production/camel/content/content-enricher.html
==
--- websites/production/camel/content/content-enricher.html (original)
+++ websites/production/camel/content/content-enricher.html Tue Nov 12 17:19:28 
2013
@@ -160,6 +160,10 @@ from("activemq:My.Queue").
 enrich uses a Producer to obtain the additional data. It 
is usually used for Request Reply messaging, for instance to invoke an external web 
service.
 pollEnrich on the other hand uses a Polling Consumer to 
obtain the additional data. It is usually used for Event Message messaging, 
for instance to read a file or download a FTP file.
 
+https://cwiki.apache.org/confluence/images/icons/emoticons/forbidden.gif"; 
width="16" height="16" alt="" border="0">Data from current Exchange not usedpollEnrich or enrich does not access any 
data from the current Exchange which means when polling it cannot use any of the 
existing headers you may have set on the Exchange. For example you cannot set a filename in the 
Exchange.FILE_NAME header and use pollEnrich to consume only 
that file. For that you must set the filename in the endpoint URI.
+
+Instead of using enrich you can use Recipient List and have 
dynamic endpoints and define an AggregationStrategy on the Recipient 
List which then would work as a enrich would 
do.
+
 Enrich 
Options
 
 




[CONF] Apache Camel > Content Enricher

2013-11-12 Thread Claus Ibsen (Confluence)







Content Enricher
Page edited by Claus Ibsen


 Changes (1)
 




...
{{pollEnrich}} on the other hand uses a [Polling Consumer] to obtain the additional data. It is usually used for [Event Message] messaging, for instance to read a file or download a [FTP|FTP2] file.  
{warning:title=Data from current Exchange not used} {{pollEnrich}} or {{enrich}} does *not* access any data from the current [Exchange] which means when polling it cannot use any of the existing headers you may have set on the [Exchange]. For example you cannot set a filename in the {{Exchange.FILE_NAME}} header and use {{pollEnrich}} to consume only that file. For that you *must* set the filename in the endpoint URI.  Instead of using {{enrich}} you can use [Recipient List] and have dynamic endpoints and define an {{AggregationStrategy}} on the [Recipient List] which then would work as a {{enrich}} would do. {warning}  
h3. Enrich Options  
...


Full Content

Content Enricher

Camel supports the Content Enricher from the EIP patterns using a Message Translator, an arbitrary Processor in the routing logic, or using the enrich DSL element to enrich the message.



Content enrichment using a Message Translator or a Processor

Using the Fluent Builders

You can use Templating to consume a message from one destination, transform it with something like Velocity or XQuery, and then send it on to another destination. For example using InOnly (one way messaging)


from("activemq:My.Queue").
  to("velocity:com/acme/MyResponse.vm").
  to("activemq:Another.Queue");


If you want to use InOut (request-reply) semantics to process requests on the My.Queue queue on ActiveMQ with a template generated response, then sending responses back to the JMSReplyTo Destination you could use this:


from("activemq:My.Queue").
  to("velocity:com/acme/MyResponse.vm");


Here is a simple example using the DSL directly to transform the message body



In this example we add our own Processor using explicit Java code



Finally we can use Bean Integration to use any Java method on any bean to act as the transformer


from("activemq:My.Queue").
  beanRef("myBeanName", "myMethodName").
  to("activemq:Another.Queue");


For further examples of this pattern in use you could look at one of the JUnit tests

	TransformTest
	TransformViaDSLTest



Using Spring XML



  
  
  





Content enrichment using the enrich DSL element

Camel comes with two flavors of content enricher in the DSL

	enrich
	pollEnrich



enrich uses a Producer to obtain the additional data. It is usually used for Request Reply messaging, for instance to invoke an external web service.
pollEnrich on the other hand uses a Polling Consumer to obtain the additional data. It is usually used for Event Message messaging, for instance to read a file or download a FTP file.

Data from current Exchange not usedpollEnrich or enrich does not access any data from the current Exchange which means when polling it cannot use any of the existing headers you may have set on the Exchange. For example you cannot set a filename in the Exchange.FILE_NAME header and use pollEnrich to consume only that file. For that you must set the filename in the endpoint URI.

Instead of using enrich you can use Recipient List and have dynamic endpoints and define an AggregationStrategy on the Recipient List which then would work as a enrich would do.

Enrich Options




 Name 
 Default Value 
 Description 


 uri 
 
 The endpoint uri for the external service to enrich from. You must use either uri or ref. 


 ref 
 
 Refers to the endpoint for the external service to enrich from. You must use either uri or ref. 


 strategyRef 
 
 Refers to an AggregationStrategy to be used to merge the reply from the external service, into a single outgoing message. By default Camel will use the reply from the external service as outgoing message. From Camel 2.12 onwards you can also use a POJO as the AggregationStrategy, see the Aggregate page for more details. 


 strategyMethodName 
 
 Camel 2.12: This option can be used to explicit declare the method name to use, when using POJOs as the AggregationStrategy. See the Aggregate page for more details. 


 strategyMethodAllowNull 
 false 
 Camel 2.12: If this option is false then the aggregate method is not used if there was no data to enrich. If this option is true then null values is used as the oldExchange (when no data to enrich), when using POJOs as the AggregationStrategy. See the Aggregate page for more details. 






Using the Fluent Builders



AggregationStrategy aggregationStrategy = ...

from("direct:start")
.enrich("direct:resource", aggregationStrategy)
.to("direct:result");

from("direct:resource")
...



The content enricher (enrich) ret

[2/2] git commit: Skip test which fails occationally on CI.

2013-11-12 Thread davsclaus
Skip test which fails occationally on CI.


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

Branch: refs/heads/camel-2.12.x
Commit: c3e63e32ca25cb934ac569df82f25a87b53df27a
Parents: f884a26
Author: Claus Ibsen 
Authored: Tue Nov 12 13:23:25 2013 +0100
Committer: Claus Ibsen 
Committed: Tue Nov 12 13:23:38 2013 +0100

--
 .../camel/component/aws/sqs/SqsFilterMessagesWithNoDeleteTest.java | 2 ++
 1 file changed, 2 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/c3e63e32/components/camel-aws/src/test/java/org/apache/camel/component/aws/sqs/SqsFilterMessagesWithNoDeleteTest.java
--
diff --git 
a/components/camel-aws/src/test/java/org/apache/camel/component/aws/sqs/SqsFilterMessagesWithNoDeleteTest.java
 
b/components/camel-aws/src/test/java/org/apache/camel/component/aws/sqs/SqsFilterMessagesWithNoDeleteTest.java
index adbe66e..1dfb459 100644
--- 
a/components/camel-aws/src/test/java/org/apache/camel/component/aws/sqs/SqsFilterMessagesWithNoDeleteTest.java
+++ 
b/components/camel-aws/src/test/java/org/apache/camel/component/aws/sqs/SqsFilterMessagesWithNoDeleteTest.java
@@ -24,6 +24,7 @@ import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.impl.DefaultCamelContext;
 import org.apache.camel.impl.SimpleRegistry;
 import org.apache.camel.test.junit4.TestSupport;
+import org.junit.Ignore;
 import org.junit.Test;
 
 import static org.apache.camel.component.mock.MockEndpoint.assertIsSatisfied;
@@ -84,6 +85,7 @@ public class SqsFilterMessagesWithNoDeleteTest extends 
TestSupport {
 }
 
 @Test
+@Ignore("Test fails occationally on CI servers")
 public void testGetThroughFilter() throws Exception {
 final String sqsURI = 
String.format("aws-sqs://MyQueue?amazonSQSClient=#amazonSQSClient"
 // note we will NOT delete if this message gets filtered out, 
but if it goes



[1/2] git commit: Skip test which fails occationally on CI.

2013-11-12 Thread davsclaus
Updated Branches:
  refs/heads/camel-2.12.x f884a26b0 -> c3e63e32c
  refs/heads/master 7c35dd872 -> 0d95b9f36


Skip test which fails occationally on CI.


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

Branch: refs/heads/master
Commit: 0d95b9f36fad493127972cbfce8290ae47152dd5
Parents: 7c35dd8
Author: Claus Ibsen 
Authored: Tue Nov 12 13:23:25 2013 +0100
Committer: Claus Ibsen 
Committed: Tue Nov 12 13:23:25 2013 +0100

--
 .../camel/component/aws/sqs/SqsFilterMessagesWithNoDeleteTest.java | 2 ++
 1 file changed, 2 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/0d95b9f3/components/camel-aws/src/test/java/org/apache/camel/component/aws/sqs/SqsFilterMessagesWithNoDeleteTest.java
--
diff --git 
a/components/camel-aws/src/test/java/org/apache/camel/component/aws/sqs/SqsFilterMessagesWithNoDeleteTest.java
 
b/components/camel-aws/src/test/java/org/apache/camel/component/aws/sqs/SqsFilterMessagesWithNoDeleteTest.java
index adbe66e..1dfb459 100644
--- 
a/components/camel-aws/src/test/java/org/apache/camel/component/aws/sqs/SqsFilterMessagesWithNoDeleteTest.java
+++ 
b/components/camel-aws/src/test/java/org/apache/camel/component/aws/sqs/SqsFilterMessagesWithNoDeleteTest.java
@@ -24,6 +24,7 @@ import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.impl.DefaultCamelContext;
 import org.apache.camel.impl.SimpleRegistry;
 import org.apache.camel.test.junit4.TestSupport;
+import org.junit.Ignore;
 import org.junit.Test;
 
 import static org.apache.camel.component.mock.MockEndpoint.assertIsSatisfied;
@@ -84,6 +85,7 @@ public class SqsFilterMessagesWithNoDeleteTest extends 
TestSupport {
 }
 
 @Test
+@Ignore("Test fails occationally on CI servers")
 public void testGetThroughFilter() throws Exception {
 final String sqsURI = 
String.format("aws-sqs://MyQueue?amazonSQSClient=#amazonSQSClient"
 // note we will NOT delete if this message gets filtered out, 
but if it goes



svn commit: r886294 - in /websites/production/camel/content: cache/main.pageCache why-can-i-not-use-when-or-otherwise-in-a-java-camel-route.html

2013-11-12 Thread buildbot
Author: buildbot
Date: Tue Nov 12 11:18:46 2013
New Revision: 886294

Log:
Production update by buildbot for camel

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

websites/production/camel/content/why-can-i-not-use-when-or-otherwise-in-a-java-camel-route.html

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

Modified: 
websites/production/camel/content/why-can-i-not-use-when-or-otherwise-in-a-java-camel-route.html
==
--- 
websites/production/camel/content/why-can-i-not-use-when-or-otherwise-in-a-java-camel-route.html
 (original)
+++ 
websites/production/camel/content/why-can-i-not-use-when-or-otherwise-in-a-java-camel-route.html
 Tue Nov 12 11:18:46 2013
@@ -134,7 +134,11 @@ from("direct:start")
 ]]>
 
 
-You only need to use .endChoice() when using certain EIPs which often have additional 
methods to configure or as part of the EIP itself. For example the Splitter EIP has a sub-route which 
denotes the routing of each splitted message. You would also have to use 
.endChoice() to indicate the end of the sub-route and to return back 
to the Content Based Router. Note .endChoice() is available as 
of Camel 2.7.
+You only need to use .endChoice() when using certain EIPs which often have additional 
methods to configure or as part of the EIP itself. For example the Splitter EIP has a sub-route which 
denotes the routing of each splitted message. You would also have to use 
.endChoice() to indicate the end of the sub-route and to return back 
to the Content Based Router. Note .endChoice() is available as 
of Camel 2.7.
+
+Still 
problems
+If there is still problems, then you can split your route into multiple 
routes, and link them together using the Direct component.
+There can be some combinations of EIPs that can hit limits in how far we can take the fluent 
builder DSL with generics you can do in Java programming language (1.7 and 
below).
 
 
   




[CONF] Apache Camel > Why can I not use when or otherwise in a Java Camel route

2013-11-12 Thread Claus Ibsen (Confluence)







Why can I not use when or otherwise in a Java Camel route
Page edited by Claus Ibsen


 Changes (1)
 




...
 You only need to use {{.endChoice()}} when using certain [EIP]s which often have additional methods to configure or as part of the [EIP] itself. For example the [Splitter] EIP has a sub-route which denotes the routing of each splitted message. You would also have to use {{.endChoice()}} to indicate the end of the sub-route and to return back to the [Content Based Router]. Note {{.endChoice()}} is *available as of Camel 2.7*. 
 h3. Still problems If there is still problems, then you can split your route into multiple routes, and link them together using the [Direct] component. There can be some combinations of [EIP]s that can hit limits in how far we can take the fluent builder DSL with generics you can do in Java programming language (1.7 and below). 


Full Content

Why can I not use when/otherwise in a Java Camel route?

When using the Content Based Router in the Java DSL you may have a situation where the compiler will not accept the following when() or otherwise() statement.

Quick tipUse .endChoice() to return "back" to the Content Based Router

For example as shown in the route below where we use the Load Balancer inside the Content Based Router in the first when:
Code will not compile

from("direct:start")
.choice()
.when(body().contains("Camel"))
.loadBalance().roundRobin().to("mock:foo").to("mock:bar")
.otherwise()
.to("mock:result");



Well the first issue is that the Load Balancer uses the additional routing to know what to use in the load balancing. In this example that would be the:


.to("mock:foo").to("mock:bar")



To indicate when the balancing stops, you should use .end() to denote the end. So the route is updates as follows:
Code will still not compile

from("direct:start")
.choice()
.when(body().contains("Camel"))
.loadBalance().roundRobin().to("mock:foo").to("mock:bar").end()
.otherwise()
.to("mock:result");



But the code will still not compile. The reason is we have stretched how far we can take the good old Java language in terms of DSL. In a more modern language such as Scala or Groovy you would be able to let it be stack based, so the .end() will pop the last type of the stack, and you would return back to the scope of the Content Based Router. However that's not easily doable in Java. So we need to help Java a bit, which you do by using .endChoice(), which tells Camel to "pop the stack" and return back to the scope of the Content Based Router.

Code compiles

from("direct:start")
.choice()
.when(body().contains("Camel"))
.loadBalance().roundRobin().to("mock:foo").to("mock:bar").endChoice()
.otherwise()
.to("mock:result");



You only need to use .endChoice() when using certain EIPs which often have additional methods to configure or as part of the EIP itself. For example the Splitter EIP has a sub-route which denotes the routing of each splitted message. You would also have to use .endChoice() to indicate the end of the sub-route and to return back to the Content Based Router. Note .endChoice() is available as of Camel 2.7.

Still problems
If there is still problems, then you can split your route into multiple routes, and link them together using the Direct component.
There can be some combinations of EIPs that can hit limits in how far we can take the fluent builder DSL with generics you can do in Java programming language (1.7 and below).



Stop watching space
|
Change email notification preferences

View Online
|
View Changes









git commit: CAMEL-6940: xml tokenizer not handling innner self-closed elements

2013-11-12 Thread ay
Updated Branches:
  refs/heads/camel-2.11.x d2fbde7a9 -> 4e3302f87


CAMEL-6940: xml tokenizer not handling innner self-closed elements


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

Branch: refs/heads/camel-2.11.x
Commit: 4e3302f873fdacce40c2be7bdc62bcebeda84077
Parents: d2fbde7
Author: Akitoshi Yoshida 
Authored: Tue Nov 12 10:50:18 2013 +0100
Committer: Akitoshi Yoshida 
Committed: Tue Nov 12 11:39:33 2013 +0100

--
 .../apache/camel/support/TokenXMLExpressionIterator.java  |  2 +-
 .../camel/language/tokenizer/TokenizeLanguageTest.java| 10 ++
 2 files changed, 11 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/4e3302f8/camel-core/src/main/java/org/apache/camel/support/TokenXMLExpressionIterator.java
--
diff --git 
a/camel-core/src/main/java/org/apache/camel/support/TokenXMLExpressionIterator.java
 
b/camel-core/src/main/java/org/apache/camel/support/TokenXMLExpressionIterator.java
index 938b1d6..3048c64 100644
--- 
a/camel-core/src/main/java/org/apache/camel/support/TokenXMLExpressionIterator.java
+++ 
b/camel-core/src/main/java/org/apache/camel/support/TokenXMLExpressionIterator.java
@@ -47,7 +47,7 @@ import org.apache.camel.util.ObjectHelper;
 public class TokenXMLExpressionIterator extends ExpressionAdapter {
 private static final Pattern NAMESPACE_PATTERN = 
Pattern.compile("xmlns(:\\w+|)\\s*=\\s*('[^']+'|\"[^\"]+\")");
 private static final String SCAN_TOKEN_NS_PREFIX_REGEX = 
"([^:<>]{1,15}?:|)";
-private static final String SCAN_BLOCK_TOKEN_REGEX_TEMPLATE = 
"<{0}(\\s+[^/]*)?/>|<{0}(\\s+[^>]*)?>(?:(?!()).)*";
+private static final String SCAN_BLOCK_TOKEN_REGEX_TEMPLATE = 
"<{0}(\\s+[^/^>]*)?/>|<{0}(\\s+[^>]*)?>(?:(?!()).)*";
 private static final String SCAN_PARENT_TOKEN_REGEX_TEMPLATE = 
"<{0}(\\s+[^>]*\\s*)?>";
 
 protected final String tagToken;

http://git-wip-us.apache.org/repos/asf/camel/blob/4e3302f8/camel-core/src/test/java/org/apache/camel/language/tokenizer/TokenizeLanguageTest.java
--
diff --git 
a/camel-core/src/test/java/org/apache/camel/language/tokenizer/TokenizeLanguageTest.java
 
b/camel-core/src/test/java/org/apache/camel/language/tokenizer/TokenizeLanguageTest.java
index bfc3bfa..1860436 100644
--- 
a/camel-core/src/test/java/org/apache/camel/language/tokenizer/TokenizeLanguageTest.java
+++ 
b/camel-core/src/test/java/org/apache/camel/language/tokenizer/TokenizeLanguageTest.java
@@ -64,6 +64,16 @@ public class TokenizeLanguageTest extends ContextTestSupport 
{
 assertMockEndpointsSatisfied();
 }
 
+public void testSendMixedClosingTagInsideMessageToTokenize() throws 
Exception {
+getMockEndpoint("mock:result").expectedBodiesReceived(
+" ", "");
+
+template.sendBody("direct:start",
+" 
");
+
+assertMockEndpointsSatisfied();
+}
+
 public void testSendNamespacedChildMessageToTokenize() throws Exception {
 getMockEndpoint("mock:result").expectedBodiesReceived(
 "", "");



[2/4] git commit: CAMEL-6107: Upgraded to twitter4j 3.0.5

2013-11-12 Thread davsclaus
CAMEL-6107: Upgraded to twitter4j 3.0.5


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

Branch: refs/heads/master
Commit: 7c35dd872f6f950dd1c75a22ec6602867f2486fc
Parents: 43704eb
Author: Claus Ibsen 
Authored: Tue Nov 12 11:35:35 2013 +0100
Committer: Claus Ibsen 
Committed: Tue Nov 12 11:35:35 2013 +0100

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


http://git-wip-us.apache.org/repos/asf/camel/blob/7c35dd87/parent/pom.xml
--
diff --git a/parent/pom.xml b/parent/pom.xml
index 85b1a5b..330bd4d 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -390,8 +390,8 @@
 1.2_5
 1.2.1
 6.8.7
-3.0.3_1
-3.0.3
+3.0.5_1
+3.0.5
 4.0.4
 4.0.4_1
 1.1.0.Final



[1/4] git commit: CAMEL-6679: Added unit test

2013-11-12 Thread davsclaus
Updated Branches:
  refs/heads/camel-2.11.x 96c1ca4ea -> d2fbde7a9
  refs/heads/camel-2.12.x 12fc496fb -> f884a26b0
  refs/heads/master 2414eb613 -> 7c35dd872


CAMEL-6679: 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/43704eb7
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/43704eb7
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/43704eb7

Branch: refs/heads/master
Commit: 43704eb715ff72b4341527d455738ca1da991e22
Parents: 2414eb6
Author: Claus Ibsen 
Authored: Tue Nov 12 11:26:47 2013 +0100
Committer: Claus Ibsen 
Committed: Tue Nov 12 11:26:58 2013 +0100

--
 .../zipfile/ZipSplitterRouteIssueTest.java  |  56 +++
 .../zipfile/ZipSplitterRouteTest.java   |  11 ++--
 .../camel-zipfile/src/test/resources/data.zip   | Bin 0 -> 540 bytes
 .../src/test/resources/log4j.properties |  40 ++---
 4 files changed, 83 insertions(+), 24 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/43704eb7/components/camel-zipfile/src/test/java/org/apache/camel/dataformat/zipfile/ZipSplitterRouteIssueTest.java
--
diff --git 
a/components/camel-zipfile/src/test/java/org/apache/camel/dataformat/zipfile/ZipSplitterRouteIssueTest.java
 
b/components/camel-zipfile/src/test/java/org/apache/camel/dataformat/zipfile/ZipSplitterRouteIssueTest.java
new file mode 100644
index 000..8e69e57
--- /dev/null
+++ 
b/components/camel-zipfile/src/test/java/org/apache/camel/dataformat/zipfile/ZipSplitterRouteIssueTest.java
@@ -0,0 +1,56 @@
+/**
+ * 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.dataformat.zipfile;
+
+import java.io.File;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Test;
+
+public class ZipSplitterRouteIssueTest extends CamelTestSupport {
+
+@Override
+public void setUp() throws Exception {
+deleteDirectory("target/zip");
+super.setUp();
+}
+
+@Test
+public void testSplitter() throws Exception {
+getMockEndpoint("mock:entry").expectedMessageCount(2);
+
+template.sendBody("seda:decompressFiles", new 
File("src/test/resources/data.zip"));
+
+assertMockEndpointsSatisfied();
+}
+
+@Override
+protected RouteBuilder createRouteBuilder() throws Exception {
+return new RouteBuilder() {
+@Override
+public void configure() throws Exception {
+from("seda:decompressFiles")
+.split(new ZipSplitter()).streaming().shareUnitOfWork()
+.log("we are splitting")
+.to("mock:entry")
+
.to("file:target/zip/?fileName=decompressed.txt&fileExist=Append");
+}
+};
+}
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/43704eb7/components/camel-zipfile/src/test/java/org/apache/camel/dataformat/zipfile/ZipSplitterRouteTest.java
--
diff --git 
a/components/camel-zipfile/src/test/java/org/apache/camel/dataformat/zipfile/ZipSplitterRouteTest.java
 
b/components/camel-zipfile/src/test/java/org/apache/camel/dataformat/zipfile/ZipSplitterRouteTest.java
index 27de3ba..d94e0c7 100644
--- 
a/components/camel-zipfile/src/test/java/org/apache/camel/dataformat/zipfile/ZipSplitterRouteTest.java
+++ 
b/components/camel-zipfile/src/test/java/org/apache/camel/dataformat/zipfile/ZipSplitterRouteTest.java
@@ -16,14 +16,12 @@
  */
 package org.apache.camel.dataformat.zipfile;
 
-
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
 public class ZipSplitterRouteTest extends CamelTestSupport {
-
 
 @Test
 public void testSplitter() throws InterruptedException {
@@ -39,9 +37,12 @@ public class ZipSplitterRouteTest extends Ca

[4/4] git commit: CAMEL-6107: Upgraded to twitter4j 3.0.5

2013-11-12 Thread davsclaus
CAMEL-6107: Upgraded to twitter4j 3.0.5


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

Branch: refs/heads/camel-2.12.x
Commit: f884a26b0ea6a208eeb2f88c06c480cf4eb4a59d
Parents: 12fc496f
Author: Claus Ibsen 
Authored: Tue Nov 12 11:35:35 2013 +0100
Committer: Claus Ibsen 
Committed: Tue Nov 12 11:36:32 2013 +0100

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


http://git-wip-us.apache.org/repos/asf/camel/blob/f884a26b/parent/pom.xml
--
diff --git a/parent/pom.xml b/parent/pom.xml
index dcf9738..048e26a 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -387,8 +387,8 @@
 1.2_5
 1.2.1
 6.8.7
-3.0.3_1
-3.0.3
+3.0.5_1
+3.0.5
 4.0.4
 4.0.4_1
 1.1.0.Final



[3/4] git commit: CAMEL-6107: Upgraded to twitter4j 3.0.5

2013-11-12 Thread davsclaus
CAMEL-6107: Upgraded to twitter4j 3.0.5


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

Branch: refs/heads/camel-2.11.x
Commit: d2fbde7a91ed39d2cea9773949ad3aed0e601220
Parents: 96c1ca4
Author: Claus Ibsen 
Authored: Tue Nov 12 11:35:35 2013 +0100
Committer: Claus Ibsen 
Committed: Tue Nov 12 11:36:08 2013 +0100

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


http://git-wip-us.apache.org/repos/asf/camel/blob/d2fbde7a/parent/pom.xml
--
diff --git a/parent/pom.xml b/parent/pom.xml
index 635cc2a..bc7c663 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -371,8 +371,8 @@
 1.2_5
 1.2.1
 6.8.7
-3.0.3_1
-3.0.3
+3.0.5_1
+3.0.5
 4.0.4
 4.0.4_1
 1.7_6



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

2013-11-12 Thread buildbot
Author: buildbot
Date: Tue Nov 12 10:18:54 2013
New Revision: 886284

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 Tue Nov 12 
10:18:54 2013
@@ -94,12 +94,12 @@
 
 Welcome to the 2.13.0 release which approx XXX issues resolved (new 
features, improvements and bug fixes such as...)
 
-The MBean names registered by Camel JMX no longer include the hostname in the 
context part, eg before context=myHost/myCamelId and now 
after context=myCamelId. Having the hostname in the MBean name does 
not bring much value, and in fact makes things more complicated as the mbean 
name changes depending on the host running Camel.When using multiple 
OSGi Blueprint '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  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 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 producerLike 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.Added 
support for transferring custom headers with RabbitMQ component.PGPDataFormat enables stream 
cache during unmarshaling.FileIdempotentRepository now 
creates necessary parent directories together with the new repository 
file.Properties component and property placeholder will now ignore non existing JVM 
and environment options as well if ignoreMissingLocation is set to 
true
 .
+The MBean names registered by Camel JMX no longer include the hostname in the 
context part, eg before context=myHost/myCamelId and now 
after context=myCamelId. Having the hostname in the MBean name does 
not bring much value, and in fact makes things more complicated as the mbean 
name changes depending on the host running Camel.When using multiple 
OSGi Blueprint '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 
b

git commit: CAMEL-6940: xml tokenizer not handling innner self-closed elements

2013-11-12 Thread ay
Updated Branches:
  refs/heads/camel-2.12.x 797399877 -> 12fc496fb


CAMEL-6940: xml tokenizer not handling innner self-closed elements


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

Branch: refs/heads/camel-2.12.x
Commit: 12fc496fb7a9df4dd68ab514f800ce767de7fe43
Parents: 7973998
Author: Akitoshi Yoshida 
Authored: Tue Nov 12 10:50:18 2013 +0100
Committer: Akitoshi Yoshida 
Committed: Tue Nov 12 11:10:13 2013 +0100

--
 .../apache/camel/support/TokenXMLExpressionIterator.java  |  2 +-
 .../camel/language/tokenizer/TokenizeLanguageTest.java| 10 ++
 2 files changed, 11 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/12fc496f/camel-core/src/main/java/org/apache/camel/support/TokenXMLExpressionIterator.java
--
diff --git 
a/camel-core/src/main/java/org/apache/camel/support/TokenXMLExpressionIterator.java
 
b/camel-core/src/main/java/org/apache/camel/support/TokenXMLExpressionIterator.java
index 938b1d6..3048c64 100644
--- 
a/camel-core/src/main/java/org/apache/camel/support/TokenXMLExpressionIterator.java
+++ 
b/camel-core/src/main/java/org/apache/camel/support/TokenXMLExpressionIterator.java
@@ -47,7 +47,7 @@ import org.apache.camel.util.ObjectHelper;
 public class TokenXMLExpressionIterator extends ExpressionAdapter {
 private static final Pattern NAMESPACE_PATTERN = 
Pattern.compile("xmlns(:\\w+|)\\s*=\\s*('[^']+'|\"[^\"]+\")");
 private static final String SCAN_TOKEN_NS_PREFIX_REGEX = 
"([^:<>]{1,15}?:|)";
-private static final String SCAN_BLOCK_TOKEN_REGEX_TEMPLATE = 
"<{0}(\\s+[^/]*)?/>|<{0}(\\s+[^>]*)?>(?:(?!()).)*";
+private static final String SCAN_BLOCK_TOKEN_REGEX_TEMPLATE = 
"<{0}(\\s+[^/^>]*)?/>|<{0}(\\s+[^>]*)?>(?:(?!()).)*";
 private static final String SCAN_PARENT_TOKEN_REGEX_TEMPLATE = 
"<{0}(\\s+[^>]*\\s*)?>";
 
 protected final String tagToken;

http://git-wip-us.apache.org/repos/asf/camel/blob/12fc496f/camel-core/src/test/java/org/apache/camel/language/tokenizer/TokenizeLanguageTest.java
--
diff --git 
a/camel-core/src/test/java/org/apache/camel/language/tokenizer/TokenizeLanguageTest.java
 
b/camel-core/src/test/java/org/apache/camel/language/tokenizer/TokenizeLanguageTest.java
index bfc3bfa..1860436 100644
--- 
a/camel-core/src/test/java/org/apache/camel/language/tokenizer/TokenizeLanguageTest.java
+++ 
b/camel-core/src/test/java/org/apache/camel/language/tokenizer/TokenizeLanguageTest.java
@@ -64,6 +64,16 @@ public class TokenizeLanguageTest extends ContextTestSupport 
{
 assertMockEndpointsSatisfied();
 }
 
+public void testSendMixedClosingTagInsideMessageToTokenize() throws 
Exception {
+getMockEndpoint("mock:result").expectedBodiesReceived(
+" ", "");
+
+template.sendBody("direct:start",
+" 
");
+
+assertMockEndpointsSatisfied();
+}
+
 public void testSendNamespacedChildMessageToTokenize() throws Exception {
 getMockEndpoint("mock:result").expectedBodiesReceived(
 "", "");



[CONF] Apache Camel > Camel 2.13.0 Release

2013-11-12 Thread Claus Ibsen (Confluence)







Camel 2.13.0 Release
Page edited by Claus Ibsen


 Changes (2)
 




...
* {{FileIdempotentRepository}} now creates necessary parent directories together with the new repository file.  * [Properties] component and [property placeholder|Using PropertyPlaceholder] will now ignore non existing JVM and environment options as well if {{ignoreMissingLocation}} is set to {{true}}. 
* Improved [Stream] consumer to enrich the [Message] with headers about current index / completion flag. 
 h3. Fixed Issues 
...
* Fixed [Netty] producer may cause {{NullPointerException}} in {{messageReceived}} in client handler, if a {{Channel}} was destroyed from the producer pool. * Fixed [File|File2] and [FTP|FTP2] consumer(s) when {{idempotent=true}} could not detect changed file(s) as a new file, but would regard the file as idempotent. 
* Fixed [Stream] consumer reading a file using {{groupLines}} would not read last group of message if there was not enough lines to hit the threshold. 
 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...)


	The MBean names registered by Camel JMX no longer include the hostname in the context part, eg before context=myHost/myCamelId and now after context=myCamelId. Having the hostname in the MBean name does not bring much value, and in fact makes things more complicated as the mbean name changes depending on the host running Camel.
	When using multiple OSGi Blueprint '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  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 
	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.
	Added support for transferring custom headers with RabbitMQ component.
	PGPDataFormat enables stream cache during unmarshaling.
	FileIdempotentRepository now creates necessary parent directories together with the new repository file.
	Properties component and property placeholder will now ignore non existing JVM and environment options as well if ignoreMissingLocation is set to true.
	Improved Stream consumer to enrich the Message with headers about current index / completion flag.



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=true&readLock=fileLock not bei

[2/6] git commit: CAMEL-6899: stream consumer with groupLines should send last message when EOL but the groupLines limit was not hit, otherwise the last group is never sent out.

2013-11-12 Thread davsclaus
CAMEL-6899: stream consumer with groupLines should send last message when EOL 
but the groupLines limit was not hit, otherwise the last group is never sent 
out.


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

Branch: refs/heads/camel-2.12.x
Commit: ac70d071d7aa5ff4955e7f37e49042beffed7347
Parents: 8feba84
Author: Claus Ibsen 
Authored: Tue Nov 12 10:37:07 2013 +0100
Committer: Claus Ibsen 
Committed: Tue Nov 12 10:37:22 2013 +0100

--
 .../camel/component/stream/StreamConsumer.java  | 14 --
 .../camel/component/stream/StreamProducer.java  |  1 +
 .../StreamGroupLinesLastStrategyTest.java   | 51 
 .../stream/StreamGroupLinesStrategyTest.java|  3 +-
 .../component/stream/StreamGroupLinesTest.java  |  1 +
 5 files changed, 64 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/ac70d071/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java
--
diff --git 
a/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java
 
b/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java
index b05ab0b..1e8f9a9 100644
--- 
a/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java
+++ 
b/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java
@@ -159,6 +159,8 @@ public class StreamConsumer extends DefaultConsumer 
implements Runnable {
 processLine(line);
 }
 }
+// EOL so trigger any
+processLine(null);
 }
 // important: do not close the reader as it will close the standard 
system.in etc.
 }
@@ -167,13 +169,17 @@ public class StreamConsumer extends DefaultConsumer 
implements Runnable {
  * Strategy method for processing the line
  */
 protected synchronized void processLine(String line) throws Exception {
+boolean last = line == null;
+
 if (endpoint.getGroupLines() > 0) {
 // remember line
-lines.add(line);
+if (line != null) {
+lines.add(line);
+}
 
 // should we flush lines?
-if (lines.size() >= endpoint.getGroupLines()) {
-// spit out lines
+if (!lines.isEmpty() && (lines.size() >= endpoint.getGroupLines() 
|| last)) {
+// spit out lines as we hit the size, or it was the last
 Exchange exchange = endpoint.createExchange();
 
 // create message with the lines
@@ -187,7 +193,7 @@ public class StreamConsumer extends DefaultConsumer 
implements Runnable {
 
 getProcessor().process(exchange);
 }
-} else {
+} else if (!last) {
 // single line
 Exchange exchange = endpoint.createExchange();
 

http://git-wip-us.apache.org/repos/asf/camel/blob/ac70d071/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamProducer.java
--
diff --git 
a/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamProducer.java
 
b/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamProducer.java
index c8aac89..e194774 100644
--- 
a/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamProducer.java
+++ 
b/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamProducer.java
@@ -99,6 +99,7 @@ public class StreamProducer extends DefaultProducer {
 LOG.debug("About to write to file: {}", fileName);
 File f = new File(fileName);
 // will create a new file if missing or append to existing
+f.getParentFile().mkdirs();
 f.createNewFile();
 return new FileOutputStream(f, true);
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/ac70d071/components/camel-stream/src/test/java/org/apache/camel/component/stream/StreamGroupLinesLastStrategyTest.java
--
diff --git 
a/components/camel-stream/src/test/java/org/apache/camel/component/stream/StreamGroupLinesLastStrategyTest.java
 
b/components/camel-stream/src/test/java/org/apache/camel/component/stream/StreamGroupLinesLastStrategyTest.java
new file mode 100644
index 000..59ad264
--- /dev/null
+++ 
b/components/camel-stream/src/test/java/org/apache/camel/component/stream/StreamGroupLinesLastStrategyTest.java
@@ -0,0 +

[3/6] git commit: CAMEL-6899: stream consumer with groupLines should send last message when EOL but the groupLines limit was not hit, otherwise the last group is never sent out.

2013-11-12 Thread davsclaus
CAMEL-6899: stream consumer with groupLines should send last message when EOL 
but the groupLines limit was not hit, otherwise the last group is never sent 
out.


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

Branch: refs/heads/camel-2.11.x
Commit: 4a6d7086e1a501cd11fef13302db894ee15c5898
Parents: 1416ec7
Author: Claus Ibsen 
Authored: Tue Nov 12 10:37:07 2013 +0100
Committer: Claus Ibsen 
Committed: Tue Nov 12 10:37:43 2013 +0100

--
 .../camel/component/stream/StreamConsumer.java  | 14 --
 .../camel/component/stream/StreamProducer.java  |  1 +
 .../StreamGroupLinesLastStrategyTest.java   | 51 
 .../stream/StreamGroupLinesStrategyTest.java|  3 +-
 .../component/stream/StreamGroupLinesTest.java  |  1 +
 5 files changed, 64 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/4a6d7086/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java
--
diff --git 
a/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java
 
b/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java
index d989249..46b9d4b 100644
--- 
a/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java
+++ 
b/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java
@@ -159,6 +159,8 @@ public class StreamConsumer extends DefaultConsumer 
implements Runnable {
 processLine(line);
 }
 }
+// EOL so trigger any
+processLine(null);
 }
 // important: do not close the reader as it will close the standard 
system.in etc.
 }
@@ -167,13 +169,17 @@ public class StreamConsumer extends DefaultConsumer 
implements Runnable {
  * Strategy method for processing the line
  */
 protected synchronized void processLine(String line) throws Exception {
+boolean last = line == null;
+
 if (endpoint.getGroupLines() > 0) {
 // remember line
-lines.add(line);
+if (line != null) {
+lines.add(line);
+}
 
 // should we flush lines?
-if (lines.size() >= endpoint.getGroupLines()) {
-// spit out lines
+if (!lines.isEmpty() && (lines.size() >= endpoint.getGroupLines() 
|| last)) {
+// spit out lines as we hit the size, or it was the last
 Exchange exchange = endpoint.createExchange();
 
 // create message with the lines
@@ -187,7 +193,7 @@ public class StreamConsumer extends DefaultConsumer 
implements Runnable {
 
 getProcessor().process(exchange);
 }
-} else {
+} else if (!last) {
 // single line
 Exchange exchange = endpoint.createExchange();
 

http://git-wip-us.apache.org/repos/asf/camel/blob/4a6d7086/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamProducer.java
--
diff --git 
a/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamProducer.java
 
b/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamProducer.java
index 82b38eb..ec36004 100644
--- 
a/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamProducer.java
+++ 
b/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamProducer.java
@@ -99,6 +99,7 @@ public class StreamProducer extends DefaultProducer {
 LOG.debug("About to write to file: {}", fileName);
 File f = new File(fileName);
 // will create a new file if missing or append to existing
+f.getParentFile().mkdirs();
 f.createNewFile();
 return new FileOutputStream(f, true);
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/4a6d7086/components/camel-stream/src/test/java/org/apache/camel/component/stream/StreamGroupLinesLastStrategyTest.java
--
diff --git 
a/components/camel-stream/src/test/java/org/apache/camel/component/stream/StreamGroupLinesLastStrategyTest.java
 
b/components/camel-stream/src/test/java/org/apache/camel/component/stream/StreamGroupLinesLastStrategyTest.java
new file mode 100644
index 000..59ad264
--- /dev/null
+++ 
b/components/camel-stream/src/test/java/org/apache/camel/component/stream/StreamGroupLinesLastStrategyTest.java
@@ -0,0 +

[1/6] git commit: CAMEL-6899: stream consumer with groupLines should send last message when EOL but the groupLines limit was not hit, otherwise the last group is never sent out.

2013-11-12 Thread davsclaus
Updated Branches:
  refs/heads/camel-2.11.x 1416ec7e8 -> 96c1ca4ea
  refs/heads/camel-2.12.x 8feba8474 -> 797399877
  refs/heads/master ceb28aea5 -> 23854b2d5


CAMEL-6899: stream consumer with groupLines should send last message when EOL 
but the groupLines limit was not hit, otherwise the last group is never sent 
out.


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

Branch: refs/heads/master
Commit: 3f07f04fa8da745686fedc3757521e223dd87dc1
Parents: ceb28ae
Author: Claus Ibsen 
Authored: Tue Nov 12 10:37:07 2013 +0100
Committer: Claus Ibsen 
Committed: Tue Nov 12 10:37:07 2013 +0100

--
 .../camel/component/stream/StreamConsumer.java  | 14 --
 .../camel/component/stream/StreamProducer.java  |  1 +
 .../StreamGroupLinesLastStrategyTest.java   | 51 
 .../stream/StreamGroupLinesStrategyTest.java|  3 +-
 .../component/stream/StreamGroupLinesTest.java  |  1 +
 5 files changed, 64 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/3f07f04f/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java
--
diff --git 
a/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java
 
b/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java
index b05ab0b..1e8f9a9 100644
--- 
a/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java
+++ 
b/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java
@@ -159,6 +159,8 @@ public class StreamConsumer extends DefaultConsumer 
implements Runnable {
 processLine(line);
 }
 }
+// EOL so trigger any
+processLine(null);
 }
 // important: do not close the reader as it will close the standard 
system.in etc.
 }
@@ -167,13 +169,17 @@ public class StreamConsumer extends DefaultConsumer 
implements Runnable {
  * Strategy method for processing the line
  */
 protected synchronized void processLine(String line) throws Exception {
+boolean last = line == null;
+
 if (endpoint.getGroupLines() > 0) {
 // remember line
-lines.add(line);
+if (line != null) {
+lines.add(line);
+}
 
 // should we flush lines?
-if (lines.size() >= endpoint.getGroupLines()) {
-// spit out lines
+if (!lines.isEmpty() && (lines.size() >= endpoint.getGroupLines() 
|| last)) {
+// spit out lines as we hit the size, or it was the last
 Exchange exchange = endpoint.createExchange();
 
 // create message with the lines
@@ -187,7 +193,7 @@ public class StreamConsumer extends DefaultConsumer 
implements Runnable {
 
 getProcessor().process(exchange);
 }
-} else {
+} else if (!last) {
 // single line
 Exchange exchange = endpoint.createExchange();
 

http://git-wip-us.apache.org/repos/asf/camel/blob/3f07f04f/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamProducer.java
--
diff --git 
a/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamProducer.java
 
b/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamProducer.java
index c8aac89..e194774 100644
--- 
a/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamProducer.java
+++ 
b/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamProducer.java
@@ -99,6 +99,7 @@ public class StreamProducer extends DefaultProducer {
 LOG.debug("About to write to file: {}", fileName);
 File f = new File(fileName);
 // will create a new file if missing or append to existing
+f.getParentFile().mkdirs();
 f.createNewFile();
 return new FileOutputStream(f, true);
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/3f07f04f/components/camel-stream/src/test/java/org/apache/camel/component/stream/StreamGroupLinesLastStrategyTest.java
--
diff --git 
a/components/camel-stream/src/test/java/org/apache/camel/component/stream/StreamGroupLinesLastStrategyTest.java
 
b/components/camel-stream/src/test/java/org/apache/camel/component/stream/StreamGroupLinesLastStrategyTest.java
new file mode 100644
index 00

[5/6] git commit: CAMEL-6899: camel-stream has headers with index/complete flag so you know this information, such as its the last, and there was N number of lines.

2013-11-12 Thread davsclaus
CAMEL-6899: camel-stream has headers with index/complete flag so you know this 
information, such as its the last, and there was N number of lines.


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

Branch: refs/heads/camel-2.12.x
Commit: 797399877f549d1d4edd8cfc8a541b9334cea08a
Parents: ac70d07
Author: Claus Ibsen 
Authored: Tue Nov 12 11:01:33 2013 +0100
Committer: Claus Ibsen 
Committed: Tue Nov 12 11:01:58 2013 +0100

--
 .../camel/component/stream/StreamConstants.java | 26 +++
 .../camel/component/stream/StreamConsumer.java  | 45 ++--
 .../camel/component/stream/StreamEndpoint.java  |  9 
 .../component/stream/ScanStreamFileTest.java|  5 +++
 .../StreamGroupLinesLastStrategyTest.java   |  4 ++
 .../stream/StreamGroupLinesStrategyTest.java|  4 ++
 .../component/stream/StreamGroupLinesTest.java  |  4 ++
 7 files changed, 75 insertions(+), 22 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/79739987/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConstants.java
--
diff --git 
a/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConstants.java
 
b/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConstants.java
new file mode 100644
index 000..b338c43
--- /dev/null
+++ 
b/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConstants.java
@@ -0,0 +1,26 @@
+/**
+ * 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.stream;
+
+public final class StreamConstants {
+
+public static final String STREAM_INDEX = "CamelStreamIndex";
+public static final String STREAM_COMPLETE = "CamelStreamComplete";
+
+private StreamConstants() {
+}
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/79739987/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java
--
diff --git 
a/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java
 
b/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java
index 1e8f9a9..ed33a0d 100644
--- 
a/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java
+++ 
b/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java
@@ -32,10 +32,8 @@ import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.concurrent.ExecutorService;
 
 import org.apache.camel.Exchange;
-import org.apache.camel.Message;
 import org.apache.camel.Processor;
 import org.apache.camel.impl.DefaultConsumer;
-import org.apache.camel.impl.DefaultMessage;
 import org.apache.camel.util.IOHelper;
 import org.apache.camel.util.ObjectHelper;
 
@@ -122,6 +120,7 @@ public class StreamConsumer extends DefaultConsumer 
implements Runnable {
 }
 
 private void readFromStream() throws Exception {
+long index = 0;
 String line;
 BufferedReader br = initializeStream();
 
@@ -132,7 +131,7 @@ public class StreamConsumer extends DefaultConsumer 
implements Runnable {
 LOG.trace("Read line: {}", line);
 boolean eos = line == null;
 if (!eos && isRunAllowed()) {
-processLine(line);
+index = processLine(line, false, index);
 } else if (eos && isRunAllowed() && endpoint.isRetry()) {
 //try and re-open stream
 br = initializeStream();
@@ -147,20 +146,29 @@ public class StreamConsumer extends DefaultConsumer 
implements Runnable {
 } else {
 // regular read stream once until end of stream
 boolean eos = false;
+Strin

[4/6] git commit: CAMEL-6899: camel-stream has headers with index/complete flag so you know this information, such as its the last, and there was N number of lines.

2013-11-12 Thread davsclaus
CAMEL-6899: camel-stream has headers with index/complete flag so you know this 
information, such as its the last, and there was N number of lines.


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

Branch: refs/heads/master
Commit: 23854b2d52c9c7f8ed5420e3e52dc3657c3400e2
Parents: 3f07f04
Author: Claus Ibsen 
Authored: Tue Nov 12 11:01:33 2013 +0100
Committer: Claus Ibsen 
Committed: Tue Nov 12 11:01:33 2013 +0100

--
 .../camel/component/stream/StreamConstants.java | 26 +++
 .../camel/component/stream/StreamConsumer.java  | 45 ++--
 .../camel/component/stream/StreamEndpoint.java  |  9 
 .../component/stream/ScanStreamFileTest.java|  5 +++
 .../StreamGroupLinesLastStrategyTest.java   |  4 ++
 .../stream/StreamGroupLinesStrategyTest.java|  4 ++
 .../component/stream/StreamGroupLinesTest.java  |  4 ++
 7 files changed, 75 insertions(+), 22 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/23854b2d/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConstants.java
--
diff --git 
a/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConstants.java
 
b/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConstants.java
new file mode 100644
index 000..b338c43
--- /dev/null
+++ 
b/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConstants.java
@@ -0,0 +1,26 @@
+/**
+ * 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.stream;
+
+public final class StreamConstants {
+
+public static final String STREAM_INDEX = "CamelStreamIndex";
+public static final String STREAM_COMPLETE = "CamelStreamComplete";
+
+private StreamConstants() {
+}
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/23854b2d/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java
--
diff --git 
a/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java
 
b/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java
index 1e8f9a9..ed33a0d 100644
--- 
a/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java
+++ 
b/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java
@@ -32,10 +32,8 @@ import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.concurrent.ExecutorService;
 
 import org.apache.camel.Exchange;
-import org.apache.camel.Message;
 import org.apache.camel.Processor;
 import org.apache.camel.impl.DefaultConsumer;
-import org.apache.camel.impl.DefaultMessage;
 import org.apache.camel.util.IOHelper;
 import org.apache.camel.util.ObjectHelper;
 
@@ -122,6 +120,7 @@ public class StreamConsumer extends DefaultConsumer 
implements Runnable {
 }
 
 private void readFromStream() throws Exception {
+long index = 0;
 String line;
 BufferedReader br = initializeStream();
 
@@ -132,7 +131,7 @@ public class StreamConsumer extends DefaultConsumer 
implements Runnable {
 LOG.trace("Read line: {}", line);
 boolean eos = line == null;
 if (!eos && isRunAllowed()) {
-processLine(line);
+index = processLine(line, false, index);
 } else if (eos && isRunAllowed() && endpoint.isRetry()) {
 //try and re-open stream
 br = initializeStream();
@@ -147,20 +146,29 @@ public class StreamConsumer extends DefaultConsumer 
implements Runnable {
 } else {
 // regular read stream once until end of stream
 boolean eos = false;
+String line

[6/6] git commit: CAMEL-6899: camel-stream has headers with index/complete flag so you know this information, such as its the last, and there was N number of lines.

2013-11-12 Thread davsclaus
CAMEL-6899: camel-stream has headers with index/complete flag so you know this 
information, such as its the last, and there was N number of lines.


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

Branch: refs/heads/camel-2.11.x
Commit: 96c1ca4ea910d45bbb15f9a467d2a69088e29f35
Parents: 4a6d708
Author: Claus Ibsen 
Authored: Tue Nov 12 11:01:33 2013 +0100
Committer: Claus Ibsen 
Committed: Tue Nov 12 11:02:12 2013 +0100

--
 .../camel/component/stream/StreamConstants.java | 26 +++
 .../camel/component/stream/StreamConsumer.java  | 45 ++--
 .../camel/component/stream/StreamEndpoint.java  |  9 
 .../component/stream/ScanStreamFileTest.java|  5 +++
 .../StreamGroupLinesLastStrategyTest.java   |  4 ++
 .../stream/StreamGroupLinesStrategyTest.java|  4 ++
 .../component/stream/StreamGroupLinesTest.java  |  4 ++
 7 files changed, 75 insertions(+), 22 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/96c1ca4e/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConstants.java
--
diff --git 
a/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConstants.java
 
b/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConstants.java
new file mode 100644
index 000..b338c43
--- /dev/null
+++ 
b/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConstants.java
@@ -0,0 +1,26 @@
+/**
+ * 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.stream;
+
+public final class StreamConstants {
+
+public static final String STREAM_INDEX = "CamelStreamIndex";
+public static final String STREAM_COMPLETE = "CamelStreamComplete";
+
+private StreamConstants() {
+}
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/96c1ca4e/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java
--
diff --git 
a/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java
 
b/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java
index 46b9d4b..c1c8b83 100644
--- 
a/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java
+++ 
b/components/camel-stream/src/main/java/org/apache/camel/component/stream/StreamConsumer.java
@@ -32,10 +32,8 @@ import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.concurrent.ExecutorService;
 
 import org.apache.camel.Exchange;
-import org.apache.camel.Message;
 import org.apache.camel.Processor;
 import org.apache.camel.impl.DefaultConsumer;
-import org.apache.camel.impl.DefaultMessage;
 import org.apache.camel.util.IOHelper;
 import org.apache.camel.util.ObjectHelper;
 
@@ -122,6 +120,7 @@ public class StreamConsumer extends DefaultConsumer 
implements Runnable {
 }
 
 private void readFromStream() throws Exception {
+long index = 0;
 String line;
 BufferedReader br = initializeStream();
 
@@ -132,7 +131,7 @@ public class StreamConsumer extends DefaultConsumer 
implements Runnable {
 LOG.trace("Read line: {}", line);
 boolean eos = line == null;
 if (!eos && isRunAllowed()) {
-processLine(line);
+index = processLine(line, false, index);
 } else if (eos && isRunAllowed() && endpoint.isRetry()) {
 //try and re-open stream
 br = initializeStream();
@@ -147,20 +146,29 @@ public class StreamConsumer extends DefaultConsumer 
implements Runnable {
 } else {
 // regular read stream once until end of stream
 boolean eos = false;
+Strin

git commit: CAMEL-6940: xml tokenizer not handling innner self-closed elements

2013-11-12 Thread ay
Updated Branches:
  refs/heads/master 23854b2d5 -> 2414eb613


CAMEL-6940: xml tokenizer not handling innner self-closed elements


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

Branch: refs/heads/master
Commit: 2414eb613c816468f5d89b12493d3cbffda0877d
Parents: 23854b2
Author: Akitoshi Yoshida 
Authored: Tue Nov 12 10:50:18 2013 +0100
Committer: Akitoshi Yoshida 
Committed: Tue Nov 12 11:02:46 2013 +0100

--
 .../apache/camel/support/TokenXMLExpressionIterator.java  |  2 +-
 .../camel/language/tokenizer/TokenizeLanguageTest.java| 10 ++
 2 files changed, 11 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/2414eb61/camel-core/src/main/java/org/apache/camel/support/TokenXMLExpressionIterator.java
--
diff --git 
a/camel-core/src/main/java/org/apache/camel/support/TokenXMLExpressionIterator.java
 
b/camel-core/src/main/java/org/apache/camel/support/TokenXMLExpressionIterator.java
index 938b1d6..3048c64 100644
--- 
a/camel-core/src/main/java/org/apache/camel/support/TokenXMLExpressionIterator.java
+++ 
b/camel-core/src/main/java/org/apache/camel/support/TokenXMLExpressionIterator.java
@@ -47,7 +47,7 @@ import org.apache.camel.util.ObjectHelper;
 public class TokenXMLExpressionIterator extends ExpressionAdapter {
 private static final Pattern NAMESPACE_PATTERN = 
Pattern.compile("xmlns(:\\w+|)\\s*=\\s*('[^']+'|\"[^\"]+\")");
 private static final String SCAN_TOKEN_NS_PREFIX_REGEX = 
"([^:<>]{1,15}?:|)";
-private static final String SCAN_BLOCK_TOKEN_REGEX_TEMPLATE = 
"<{0}(\\s+[^/]*)?/>|<{0}(\\s+[^>]*)?>(?:(?!()).)*";
+private static final String SCAN_BLOCK_TOKEN_REGEX_TEMPLATE = 
"<{0}(\\s+[^/^>]*)?/>|<{0}(\\s+[^>]*)?>(?:(?!()).)*";
 private static final String SCAN_PARENT_TOKEN_REGEX_TEMPLATE = 
"<{0}(\\s+[^>]*\\s*)?>";
 
 protected final String tagToken;

http://git-wip-us.apache.org/repos/asf/camel/blob/2414eb61/camel-core/src/test/java/org/apache/camel/language/tokenizer/TokenizeLanguageTest.java
--
diff --git 
a/camel-core/src/test/java/org/apache/camel/language/tokenizer/TokenizeLanguageTest.java
 
b/camel-core/src/test/java/org/apache/camel/language/tokenizer/TokenizeLanguageTest.java
index bfc3bfa..1860436 100644
--- 
a/camel-core/src/test/java/org/apache/camel/language/tokenizer/TokenizeLanguageTest.java
+++ 
b/camel-core/src/test/java/org/apache/camel/language/tokenizer/TokenizeLanguageTest.java
@@ -64,6 +64,16 @@ public class TokenizeLanguageTest extends ContextTestSupport 
{
 assertMockEndpointsSatisfied();
 }
 
+public void testSendMixedClosingTagInsideMessageToTokenize() throws 
Exception {
+getMockEndpoint("mock:result").expectedBodiesReceived(
+" ", "");
+
+template.sendBody("direct:start",
+" 
");
+
+assertMockEndpointsSatisfied();
+}
+
 public void testSendNamespacedChildMessageToTokenize() throws Exception {
 getMockEndpoint("mock:result").expectedBodiesReceived(
 "", "");



svn commit: r886279 - in /websites/production/camel/content: cache/main.pageCache mina2.html

2013-11-12 Thread buildbot
Author: buildbot
Date: Tue Nov 12 09:19:02 2013
New Revision: 886279

Log:
Production update by buildbot for camel

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

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

Modified: websites/production/camel/content/mina2.html
==
--- websites/production/camel/content/mina2.html (original)
+++ websites/production/camel/content/mina2.html Tue Nov 12 09:19:02 2013
@@ -128,7 +128,7 @@ However, the option, transferExchange
 
 Options
 
- Option  Default Value  Description  codec  null  You can refer to a named ProtocolCodecFactory 
instance in your Registry such as your Spring ApplicationContext, 
which is then used for the marshalling.  disconnect  false  Whether or not to disconnect(close) from Mina 
session right after use. Can be used for both consumer and producer.  textline 
 false  Only used for TCP. If no codec is 
specified, you can use this flag to indicate a text line based codec; if not 
specified or the value is false, then Object Serialization is assumed 
over TCP.  
textlineDelimiter  DEFAULT  Only used for TCP and if textline=true. Sets the 
text line delimiter to use. Possible values are: DEFAULT, 
AUTO, WINDOWS, UNIX or MAC. If none 
provided, Camel will use DEFAULT. This delimiter is used to mark the 
end of text.  
sync  true  Setting to set endpoint as one-way or 
request-response.  lazySessionCreation  true  Sessions can be lazily created to avoid 
exceptions, if the remote server is not up and running when the Camel producer 
is started.  
timeout  
3  You can 
configure the timeout that specifies how long to wait for a response from a 
remote server. The timeout unit is in milliseconds, so 6 is 60 seconds. The 
timeout is only used for Mina producer.  encodi
 ng  JVM 
Default  You can 
configure the encoding (a http://java.sun.com/j2se/1.5.0/docs/api/java/nio/charset/Charset.html"; 
rel="nofollow">charset name) to use for the TCP textline codec and the UDP 
protocol. If not provided, Camel will use the http://java.sun.com/j2se/1.5.0/docs/api/java/nio/charset/Charset.html#defaultCharset()"
 rel="nofollow">JVM default Charset.  transferExchange  false  Only used for TCP. You can 
transfer the exchange over the wire instead of just the body. The following 
fields are transferred: In body, Out body, fault body, In headers, Out headers, 
fault headers,
  exchange properties, exchange exception. This requires that the objects are 
serializable. Camel will exclude any non-serializable objects and log 
it at WARN level.  minaLogger  false  You can enable the Apache MINA logging filter. Apache 
MINA uses slf4j logging at INFO level to log all input and 
output.  
filters  
null  You can 
set a list of http://mina.apache.org/iofilter.html";>Mina IoFilters to register. The 
filters can be specified as a comma-separate list of bean references 
(e.g. #filterBean1,#filterBean2) w
 here each bean must be of type org.apache.mina.common.IoFilter. 
 
encoderMaxLineLength  -1  Set the textline protocol encoder max line length. By 
default the default value of Mina itself is used which are 
Integer.MAX_VALUE.  decoderMaxLineLength  -1  Set the textline protocol decoder max line length. By 
default the default value of Mina itself is used which are 1024. 
 
maximumPoolSize  
16  The TCP producer is 
thread saf
 e and supports concurrency much better. This option allows you to configure 
the number of threads in its thread pool for concurrent producers. Note: 
Camel has a pooled service which ensured it was already thread safe and 
supported concurrency already.  allowDefaultCodec  true  The mina component installs a default codec 
if both, codec is null and textline is 
false. Setting allowDefaultCodec to false prevents 
the mina component from installing a default codec as the first element in the 
filter chain. This is useful in scenarios where another filter must be the 
first in the filter chain, like the SSL filter.  disconnectOnNoReply  true  If sync is enabled then this option dictates MinaConsumer 
if it should disconnect where there is no reply to send back.  noReplyLogLevel  WARN  If sync is enabled this option 
dictates MinaConsumer which logging level to use when logging a there is no 
reply to send back. Values are: FATAL, ERROR, INFO, DEBUG, OFF. 
 
orderedThreadPoolExecutor  true  Whether to use ordered thread pool, to ensure events are 
processed orderly on the same channel.  sslContextPar
 ameters  
null  SSL 
configuration using an org.apache.camel.util.jsse.SSLContextParameters 
instance. See [Using the JSSE Configuration 
Utility].  autoStartTls  true  Whether to auto start SSL handshake. 

+ Option  Default Value  Description  codec  null  You can refer to a named Pro

[CONF] Apache Camel > MINA2

2013-11-12 Thread Claus Ibsen (Confluence)







MINA2
Page edited by Claus Ibsen


 Changes (2)
 




...
| {{encoderMaxLineLength}} | {{\-1}} | Set the textline protocol encoder max line length. By default the default value of Mina itself is used which are {{Integer.MAX_VALUE}}. | | {{decoderMaxLineLength}} | {{\-1}} | Set the textline protocol decoder max line length. By default the default value of Mina itself is used which are 1024. | 
| {{maximumPoolSize}} | 16 | The TCP producer is thread safe and supports concurrency much better. This option allows you to configure the number of threads in its thread pool for concurrent producers. *Note:* Camel has a pooled service which ensured it was already thread safe and supported concurrency already. | 
| {{maximumPoolSize}} | 16 | Number of worker threads in the worker pool for TCP and UDP (UDP requires *Camel 2.11.3/2.12.2* onwards). | 
| {{allowDefaultCodec}} | {{true}} | The mina component installs a default codec if both, {{codec}} is {{null}} and {{textline}} is {{false}}. Setting {{allowDefaultCodec}} to {{false}} prevents the mina component from installing a default codec as the first element in the filter chain. This is useful in scenarios where another filter must be the first in the filter chain, like the SSL filter. | | {{disconnectOnNoReply}} | {{true}} | If sync is enabled then this option dictates MinaConsumer if it should disconnect where there is no reply to send back. | 
...


Full Content

MINA 2 Component
Available as of Camel 2.10

The mina2: component is a transport for working with Apache MINA 2.x

Favor using Netty as Netty is a much more active maintained and popular project than Apache Mina currently is

Maven users will need to add the following dependency to their pom.xml for this component:



org.apache.camel
camel-mina2
x.x.x





URI format



mina2:tcp://hostname[:port][?options]
mina2:udp://hostname[:port][?options]
mina2:vm://hostname[:port][?options]


You can specify a codec in the Registry using the codec option. If you are using TCP and no codec is specified then the textline flag is used to determine if text line based codec or object serialization should be used instead. By default the object serialization is used.

For UDP if no codec is specified the default uses a basic ByteBuffer based codec.

The VM protocol is used as a direct forwarding mechanism in the same JVM. 

A Mina producer has a default timeout value of 30 seconds, while it waits for a response from the remote server.

In normal use, camel-mina only supports marshalling the body content—message headers and exchange properties are not sent.
However, the option, transferExchange, does allow you to transfer the exchange itself over the wire. See options below.

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

Options



 Option 
 Default Value 
 Description 


 codec 
 null 
 You can refer to a named ProtocolCodecFactory instance in your Registry such as your Spring ApplicationContext, which is then used for the marshalling. 


 disconnect 
 false 
 Whether or not to disconnect(close) from Mina session right after use. Can be used for both consumer and producer. 


 textline 
 false 
 Only used for TCP. If no codec is specified, you can use this flag to indicate a text line based codec; if not specified or the value is false, then Object Serialization is assumed over TCP. 


 textlineDelimiter 
 DEFAULT 
 Only used for TCP and if textline=true. Sets the text line delimiter to use. Possible values are: DEFAULT, AUTO, WINDOWS, UNIX or MAC. If none provided, Camel will use DEFAULT. This delimiter is used to mark the end of text. 


 sync 
 true 
 Setting to set endpoint as one-way or request-response. 


 lazySessionCreation 
 true 
 Sessions can be lazily created to avoid exceptions, if the remote server is not up and running when the Camel producer is started. 


 timeout 
 3 
 You can configure the timeout that specifies how long to wait for a response from a remote server. The timeout unit is in milliseconds, so 6 is 60 seconds. The timeout is only used for Mina producer. 


 encoding 
 JVM Default 
 You can configure the encoding (a charset name) to use for the TCP textline codec and the UDP protocol. If not provided, Camel will use the JVM default Charset. 


 transferExchange 
 false 
 Only used for TCP. You can transfer the exchange over the wire instead of just the body. The following fields are transferred: In body, Out body, fault body, In headers, Out headers, fault headers, exchange properties, exchange exception. This requires that the objects are serializable. Camel will exclude any non-serializable objects and log it at WARN level. 


 minaLogger 
 false 

git commit: CAMEL-6954: camel-mina2 - UDP protocol should use worker pool as well.

2013-11-12 Thread davsclaus
Updated Branches:
  refs/heads/camel-2.12.x 569bc7652 -> 8feba8474


CAMEL-6954: camel-mina2 - UDP protocol should use worker pool as well.


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

Branch: refs/heads/camel-2.12.x
Commit: 8feba847400e44ce7ec982db85321cf9fe9a8c8a
Parents: 569bc76
Author: Claus Ibsen 
Authored: Tue Nov 12 09:32:52 2013 +0100
Committer: Claus Ibsen 
Committed: Tue Nov 12 09:34:32 2013 +0100

--
 .../camel/component/mina2/Mina2Consumer.java|  7 +-
 .../component/mina2/Mina2UdpConcurrentTest.java | 75 
 .../camel/component/mina2/Mina2UdpTest.java |  1 -
 3 files changed, 81 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/8feba847/components/camel-mina2/src/main/java/org/apache/camel/component/mina2/Mina2Consumer.java
--
diff --git 
a/components/camel-mina2/src/main/java/org/apache/camel/component/mina2/Mina2Consumer.java
 
b/components/camel-mina2/src/main/java/org/apache/camel/component/mina2/Mina2Consumer.java
index 49c1dc5..2d6e76a 100644
--- 
a/components/camel-mina2/src/main/java/org/apache/camel/component/mina2/Mina2Consumer.java
+++ 
b/components/camel-mina2/src/main/java/org/apache/camel/component/mina2/Mina2Consumer.java
@@ -193,7 +193,6 @@ public class Mina2Consumer extends DefaultConsumer {
 addCodecFactory(service, codecFactory);
 LOG.debug("{}: Using ObjectSerializationCodecFactory: {}", type, 
codecFactory);
 }
-
 }
 
 protected void setupDatagramProtocol(String uri, Mina2Configuration 
configuration) {
@@ -207,6 +206,12 @@ public class Mina2Consumer extends DefaultConsumer {
 configureDataGramCodecFactory("MinaConsumer", acceptor, configuration);
 acceptor.setCloseOnDeactivation(true);
 // reuse address is default true for datagram
+if (configuration.isOrderedThreadPoolExecutor()) {
+workerPool = new 
OrderedThreadPoolExecutor(configuration.getMaximumPoolSize());
+} else {
+workerPool = new 
UnorderedThreadPoolExecutor(configuration.getMaximumPoolSize());
+}
+acceptor.getFilterChain().addLast("threadPool", new 
ExecutorFilter(workerPool));
 if (minaLogger) {
 acceptor.getFilterChain().addLast("logger", new LoggingFilter());
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/8feba847/components/camel-mina2/src/test/java/org/apache/camel/component/mina2/Mina2UdpConcurrentTest.java
--
diff --git 
a/components/camel-mina2/src/test/java/org/apache/camel/component/mina2/Mina2UdpConcurrentTest.java
 
b/components/camel-mina2/src/test/java/org/apache/camel/component/mina2/Mina2UdpConcurrentTest.java
new file mode 100644
index 000..c1bdf63
--- /dev/null
+++ 
b/components/camel-mina2/src/test/java/org/apache/camel/component/mina2/Mina2UdpConcurrentTest.java
@@ -0,0 +1,75 @@
+/**
+ * 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.mina2;
+
+import java.net.DatagramPacket;
+import java.net.DatagramSocket;
+import java.net.InetAddress;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.junit.Test;
+
+/**
+ * @version 
+ */
+public class Mina2UdpConcurrentTest extends BaseMina2Test {
+
+protected int messageCount = 3;
+
+public Mina2UdpConcurrentTest() {
+}
+
+@Test
+public void testMinaRoute() throws Exception {
+MockEndpoint endpoint = getMockEndpoint("mock:result");
+endpoint.expectedBodiesReceivedInAnyOrder("Hello Message: 0", "Hello 
Message: 1", "Hello Message: 2");
+
+sendUdpMessages();
+
+assertMockEndpointsSatisfied();
+}
+
+protected void sendUdpMessages() throws Exception {
+ 

[2/3] git commit: CAMEL-6954: camel-mina2 - UDP protocol should use worker pool as well.

2013-11-12 Thread davsclaus
CAMEL-6954: camel-mina2 - UDP protocol should use worker pool as well.


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

Branch: refs/heads/camel-2.11.x
Commit: 1416ec7e828a6c70e30233aec4944a66ebe23e36
Parents: c67a30b
Author: Claus Ibsen 
Authored: Tue Nov 12 09:32:52 2013 +0100
Committer: Claus Ibsen 
Committed: Tue Nov 12 09:33:35 2013 +0100

--
 .../camel/component/mina2/Mina2Consumer.java|  7 +-
 .../component/mina2/Mina2UdpConcurrentTest.java | 75 
 .../camel/component/mina2/Mina2UdpTest.java |  1 -
 3 files changed, 81 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/1416ec7e/components/camel-mina2/src/main/java/org/apache/camel/component/mina2/Mina2Consumer.java
--
diff --git 
a/components/camel-mina2/src/main/java/org/apache/camel/component/mina2/Mina2Consumer.java
 
b/components/camel-mina2/src/main/java/org/apache/camel/component/mina2/Mina2Consumer.java
index 31267b2..828fded 100644
--- 
a/components/camel-mina2/src/main/java/org/apache/camel/component/mina2/Mina2Consumer.java
+++ 
b/components/camel-mina2/src/main/java/org/apache/camel/component/mina2/Mina2Consumer.java
@@ -193,7 +193,6 @@ public class Mina2Consumer extends DefaultConsumer {
 addCodecFactory(service, codecFactory);
 LOG.debug("{}: Using ObjectSerializationCodecFactory: {}", type, 
codecFactory);
 }
-
 }
 
 protected void setupDatagramProtocol(String uri, Mina2Configuration 
configuration) {
@@ -207,6 +206,12 @@ public class Mina2Consumer extends DefaultConsumer {
 configureDataGramCodecFactory("MinaConsumer", acceptor, configuration);
 acceptor.setCloseOnDeactivation(true);
 // reuse address is default true for datagram
+if (configuration.isOrderedThreadPoolExecutor()) {
+workerPool = new 
OrderedThreadPoolExecutor(configuration.getMaximumPoolSize());
+} else {
+workerPool = new 
UnorderedThreadPoolExecutor(configuration.getMaximumPoolSize());
+}
+acceptor.getFilterChain().addLast("threadPool", new 
ExecutorFilter(workerPool));
 if (minaLogger) {
 acceptor.getFilterChain().addLast("logger", new LoggingFilter());
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/1416ec7e/components/camel-mina2/src/test/java/org/apache/camel/component/mina2/Mina2UdpConcurrentTest.java
--
diff --git 
a/components/camel-mina2/src/test/java/org/apache/camel/component/mina2/Mina2UdpConcurrentTest.java
 
b/components/camel-mina2/src/test/java/org/apache/camel/component/mina2/Mina2UdpConcurrentTest.java
new file mode 100644
index 000..c1bdf63
--- /dev/null
+++ 
b/components/camel-mina2/src/test/java/org/apache/camel/component/mina2/Mina2UdpConcurrentTest.java
@@ -0,0 +1,75 @@
+/**
+ * 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.mina2;
+
+import java.net.DatagramPacket;
+import java.net.DatagramSocket;
+import java.net.InetAddress;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.junit.Test;
+
+/**
+ * @version 
+ */
+public class Mina2UdpConcurrentTest extends BaseMina2Test {
+
+protected int messageCount = 3;
+
+public Mina2UdpConcurrentTest() {
+}
+
+@Test
+public void testMinaRoute() throws Exception {
+MockEndpoint endpoint = getMockEndpoint("mock:result");
+endpoint.expectedBodiesReceivedInAnyOrder("Hello Message: 0", "Hello 
Message: 1", "Hello Message: 2");
+
+sendUdpMessages();
+
+assertMockEndpointsSatisfied();
+}
+
+protected void sendUdpMessages() throws Exception {
+DatagramSocket socket = new DatagramSocket();
+try {
+

[3/3] git commit: CAMEL-6954: camel-mina2 - UDP protocol should use worker pool as well.

2013-11-12 Thread davsclaus
CAMEL-6954: camel-mina2 - UDP protocol should use worker pool as well.


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

Branch: refs/heads/camel-2.10.x
Commit: b405f5fd8afe2d203a21cb1ab98b09eb8dfa0ae2
Parents: 225a69e
Author: Claus Ibsen 
Authored: Tue Nov 12 09:32:52 2013 +0100
Committer: Claus Ibsen 
Committed: Tue Nov 12 09:33:54 2013 +0100

--
 .../camel/component/mina2/Mina2Consumer.java|  7 +-
 .../component/mina2/Mina2UdpConcurrentTest.java | 75 
 .../camel/component/mina2/Mina2UdpTest.java |  1 -
 3 files changed, 81 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/b405f5fd/components/camel-mina2/src/main/java/org/apache/camel/component/mina2/Mina2Consumer.java
--
diff --git 
a/components/camel-mina2/src/main/java/org/apache/camel/component/mina2/Mina2Consumer.java
 
b/components/camel-mina2/src/main/java/org/apache/camel/component/mina2/Mina2Consumer.java
index 31267b2..828fded 100644
--- 
a/components/camel-mina2/src/main/java/org/apache/camel/component/mina2/Mina2Consumer.java
+++ 
b/components/camel-mina2/src/main/java/org/apache/camel/component/mina2/Mina2Consumer.java
@@ -193,7 +193,6 @@ public class Mina2Consumer extends DefaultConsumer {
 addCodecFactory(service, codecFactory);
 LOG.debug("{}: Using ObjectSerializationCodecFactory: {}", type, 
codecFactory);
 }
-
 }
 
 protected void setupDatagramProtocol(String uri, Mina2Configuration 
configuration) {
@@ -207,6 +206,12 @@ public class Mina2Consumer extends DefaultConsumer {
 configureDataGramCodecFactory("MinaConsumer", acceptor, configuration);
 acceptor.setCloseOnDeactivation(true);
 // reuse address is default true for datagram
+if (configuration.isOrderedThreadPoolExecutor()) {
+workerPool = new 
OrderedThreadPoolExecutor(configuration.getMaximumPoolSize());
+} else {
+workerPool = new 
UnorderedThreadPoolExecutor(configuration.getMaximumPoolSize());
+}
+acceptor.getFilterChain().addLast("threadPool", new 
ExecutorFilter(workerPool));
 if (minaLogger) {
 acceptor.getFilterChain().addLast("logger", new LoggingFilter());
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/b405f5fd/components/camel-mina2/src/test/java/org/apache/camel/component/mina2/Mina2UdpConcurrentTest.java
--
diff --git 
a/components/camel-mina2/src/test/java/org/apache/camel/component/mina2/Mina2UdpConcurrentTest.java
 
b/components/camel-mina2/src/test/java/org/apache/camel/component/mina2/Mina2UdpConcurrentTest.java
new file mode 100644
index 000..c1bdf63
--- /dev/null
+++ 
b/components/camel-mina2/src/test/java/org/apache/camel/component/mina2/Mina2UdpConcurrentTest.java
@@ -0,0 +1,75 @@
+/**
+ * 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.mina2;
+
+import java.net.DatagramPacket;
+import java.net.DatagramSocket;
+import java.net.InetAddress;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.junit.Test;
+
+/**
+ * @version 
+ */
+public class Mina2UdpConcurrentTest extends BaseMina2Test {
+
+protected int messageCount = 3;
+
+public Mina2UdpConcurrentTest() {
+}
+
+@Test
+public void testMinaRoute() throws Exception {
+MockEndpoint endpoint = getMockEndpoint("mock:result");
+endpoint.expectedBodiesReceivedInAnyOrder("Hello Message: 0", "Hello 
Message: 1", "Hello Message: 2");
+
+sendUdpMessages();
+
+assertMockEndpointsSatisfied();
+}
+
+protected void sendUdpMessages() throws Exception {
+DatagramSocket socket = new DatagramSocket();
+try {
+

[1/3] git commit: CAMEL-6954: camel-mina2 - UDP protocol should use worker pool as well.

2013-11-12 Thread davsclaus
Updated Branches:
  refs/heads/camel-2.10.x 225a69eba -> b405f5fd8
  refs/heads/camel-2.11.x c67a30b52 -> 1416ec7e8
  refs/heads/master e1be27def -> ceb28aea5


CAMEL-6954: camel-mina2 - UDP protocol should use worker pool as well.


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

Branch: refs/heads/master
Commit: ceb28aea513b3fb0291700c545efd0b1d22fdf89
Parents: e1be27d
Author: Claus Ibsen 
Authored: Tue Nov 12 09:32:52 2013 +0100
Committer: Claus Ibsen 
Committed: Tue Nov 12 09:32:52 2013 +0100

--
 .../camel/component/mina2/Mina2Consumer.java|  7 +-
 .../component/mina2/Mina2UdpConcurrentTest.java | 75 
 .../camel/component/mina2/Mina2UdpTest.java |  1 -
 3 files changed, 81 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/ceb28aea/components/camel-mina2/src/main/java/org/apache/camel/component/mina2/Mina2Consumer.java
--
diff --git 
a/components/camel-mina2/src/main/java/org/apache/camel/component/mina2/Mina2Consumer.java
 
b/components/camel-mina2/src/main/java/org/apache/camel/component/mina2/Mina2Consumer.java
index 49c1dc5..2d6e76a 100644
--- 
a/components/camel-mina2/src/main/java/org/apache/camel/component/mina2/Mina2Consumer.java
+++ 
b/components/camel-mina2/src/main/java/org/apache/camel/component/mina2/Mina2Consumer.java
@@ -193,7 +193,6 @@ public class Mina2Consumer extends DefaultConsumer {
 addCodecFactory(service, codecFactory);
 LOG.debug("{}: Using ObjectSerializationCodecFactory: {}", type, 
codecFactory);
 }
-
 }
 
 protected void setupDatagramProtocol(String uri, Mina2Configuration 
configuration) {
@@ -207,6 +206,12 @@ public class Mina2Consumer extends DefaultConsumer {
 configureDataGramCodecFactory("MinaConsumer", acceptor, configuration);
 acceptor.setCloseOnDeactivation(true);
 // reuse address is default true for datagram
+if (configuration.isOrderedThreadPoolExecutor()) {
+workerPool = new 
OrderedThreadPoolExecutor(configuration.getMaximumPoolSize());
+} else {
+workerPool = new 
UnorderedThreadPoolExecutor(configuration.getMaximumPoolSize());
+}
+acceptor.getFilterChain().addLast("threadPool", new 
ExecutorFilter(workerPool));
 if (minaLogger) {
 acceptor.getFilterChain().addLast("logger", new LoggingFilter());
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/ceb28aea/components/camel-mina2/src/test/java/org/apache/camel/component/mina2/Mina2UdpConcurrentTest.java
--
diff --git 
a/components/camel-mina2/src/test/java/org/apache/camel/component/mina2/Mina2UdpConcurrentTest.java
 
b/components/camel-mina2/src/test/java/org/apache/camel/component/mina2/Mina2UdpConcurrentTest.java
new file mode 100644
index 000..c1bdf63
--- /dev/null
+++ 
b/components/camel-mina2/src/test/java/org/apache/camel/component/mina2/Mina2UdpConcurrentTest.java
@@ -0,0 +1,75 @@
+/**
+ * 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.mina2;
+
+import java.net.DatagramPacket;
+import java.net.DatagramSocket;
+import java.net.InetAddress;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.junit.Test;
+
+/**
+ * @version 
+ */
+public class Mina2UdpConcurrentTest extends BaseMina2Test {
+
+protected int messageCount = 3;
+
+public Mina2UdpConcurrentTest() {
+}
+
+@Test
+public void testMinaRoute() throws Exception {
+MockEndpoint endpoint = getMockEndpoint("mock:result");
+endpoint.expectedBodiesReceivedInAnyOrder("Hello Message: 0", "Hello 
Message: 1", "Hello Message: 2");
+
+sendUdpMessages();
+
+assertMockEndpoint