[CONF] Apache Camel Camel 2.3.0 Release

2010-03-31 Thread confluence







 Camel 2.3.0 Release
 Page edited by willem jiang

 
  
 
 Camel 2.3.0 release (currently in progress)




New and Noteworthy

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


	Overhauled threading model and introducing threadPoolProfile to define profiles for thread pools to have easy configuration.
	Property placeholders in for example endpoint uris is not natively supported in camel-core which means you no long need to use Spring for that. It works therefore in any environment as its provided out of the box in camel-core.
	Property placeholders also works in the CamelContext when using Spring XML. Basically nearly all places where you enter text the property placeholder is supported.
	Added ExchangeSentEvent to EventNotifier which contains time taken and is emitted when an Exchange is sent to an Endpoint. This allows end users to easily gather performance stats for Exchange send to endpoints.
	Added disconnect option to MINA to close Mina session right after usage.
	Jetty now supports to get the HttpServletRequest and HttpServletResponse from the Message header.
	XPathBuilder now supports being used without an Exchange which allows you to use it in a custom/generic fashion.
	XPath now supports using the JVM system property specifying a custom XPathFactory to be used. You can use this to switch from default to use e.g. Saxon.
	XSLT now supports using xsl:include where the files is loaded from classpath, and being able to load relative according to the endpoint configured location. See the wiki page for details.
	File, FTP added option eagerDeleteTargetFile to control the behavior when using tempFile whether or not to eagerly delete the target file or wait until last moment.
	Reduced registering producers in JMX to prevent using too much memory and potentially registering short lived producers which didn't bring much value of being managed as well.
	Upgraded HTTP to use Apache HTTP Client 4.0.1. You may need to migrate if you use special or advanced configuration of HTTP Client.
	Upgraded Jetty to use Jetty 7.0.1.
	Individual routes can be Graceful Shutdown at runtime, which allows you to stop the route in a more reliable and gentle way.
	Total overhaul of the Aggregator EIP, which now has better completion triggers, and supports pluggable repository. For example to use camel-hawtdb as persistent store.
	Added removeHeaders to remove multiple headers, e.g. use removeHeaders("Camel*") to remove all Camel related headers.
	Improved the Failover load balancer to support round robin mode and a few other options as well.
	Fixed issue with Camel not being able to run deployed as a WAR in WebLogic server.
	Fixed Polling Consumer not working with JMS selector.
	pollEnrich now handover completions which means you can use the move like options from File or FTP component. For example to enrich with a file and have that file moved when the route completes.
	Added @Attachments annotation to Bean binding.
	Simple and Bean language now has a build in OGNL notation which allows you to reference from Map or List structures and as well to invoke methods in a OGNL like notation. See more details at Simple wiki page.
	camel-jetty supports the multipart/form post out of box.
	Graceful Shutdown now shut down routes in the reverse order in which they was started. Option shutdownRoutesInReverseOrder can be used to control this behavior.
	XSLT component now allows you to chose which output type to use with the output option. For example you can now stream directly to a file, for example when transforming very big xml messages.
	ErrorHandler can be configure with customer bean style.



New Enterprise Integration Patterns

New Components


	camel-nagios for sending passive checks to Nagios
	properties for using property placeholders to resolve endpoint uris.
	camel-gae extensions
	
		gauth component for implementing OAuth consumers.
		glogin component for programmatic login to Google App Engine applications from Java clients.
	
	
	camel-hawtdb as persistent store for the Aggregator EIP.



New DSL

	removeHeaders



New Annotations

	@Attachments



New Data Formats


	SOAP data format provides basic webservice support without the CXF Stack



New Languages

New Examples

	camel-example-aggregate shows the new overhauled Aggregator in use with persistence storage using HawtDB.



API breaking

The Aggregate has been overhauled and thus you need to migrate you Camel application if you use it.
See the Aggregate wiki page for which options it has you should use.

In MINA the header key MinaConsumer.HEADER_CLOSE_SESSION_WHEN_COMPLETE is moved to MinaConstants.MINA_CLOSE_SESSION_WHEN_COMPLETE 

org.apache.camel.spi.PollingConsumerPollStrategy now returns a boolean in the begin method. Use true to accept to begin polling, and false to skip polling at this time.

A new method onInit has been added to 

[CONF] Apache Camel JCR

2010-03-31 Thread confluence







 JCR
 Page edited by Claus Ibsen

 
  
 
 JCR Component

The jcr component allows you to add nodes to a JCR (JSR-170) compliant content repository (for example, Apache Jackrabbit ).

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


dependency
groupIdorg.apache.camel/groupId
artifactIdcamel-jcr/artifactId
versionx.x.x/version
!-- use the same version as your Camel core version --
/dependency



URI format



jcr://user:passw...@repository/path/to/node



Usage
The repository element of the URI is used to look up the JCR Repository object in the Camel context registry.

If a message is sent to a JCR producer endpoint:

	A new node is created in the content repository,
	All the message properties of the IN message are transformed to JCR Value instances and added to the new node,
	The node's UUID is returned in the OUT message.



Message properties
All message properties are converted to node properties, except for the CamelJcrNodeName property (you can refer to JcrConstants.NODE_NAME in your code), which is used to determine the node name.

Example
The snippet below creates a node named node under the /home/test node in the content repository.  One additional attribute is added to the node as well: my.contents.property which will contain the body of the message being sent.

from("direct:a").setProperty(JcrConstants.JCR_NODE_NAME, constant("node"))
.setProperty("my.contents.property", body()).to("jcr://user:p...@repository/home/test");



See Also

	Configuring Camel
	Component
	Endpoint
	Getting Started


 
 
   
Change Notification Preferences
   

   View Online
   |
   View Change
  |
   Add Comment









[CONF] Apache Camel How to remove the http protocol headers in the camel message?

2010-03-31 Thread confluence







How to remove the http protocol headers in the camel message?
Page  added by willem jiang

 

 In camel there are lots of components use the http protocol headers to do their business.
The components include camel-http, camel-jetty, camel-restlet, camel-cxf etc. 
So if you are using these component, you may pay attention to the Http protocol headers:
  Exchange.CONTENT_ENCODING
  Exchange.CONTENT_TYPE
  Exchange.HTTP_BASE_URI
  Exchange.HTTP_CHARACTER_ENCODING
  Exchange.HTTP_METHOD
  Exchange.HTTP_PATH
  Exchange.HTTP_QUERY
  Exchange.HTTP_RESPONSE_CODE

If you don't want these headers bother your other endpoints, you'd better to remove these headers like these


  from("jetty://http://myhost:9000/myservice/")
// Remove the header which name is start with CamelHttp, this DSL is new to Camel 2.3.0
// You can use removeHeader if your camel version is lower than 2.3.0
.removeHeaders("CamelHttp*")
.to("otherEndpoint");





  camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"
route
  from uri="jetty://http://myhost:9000/myservice/"/
	!-- remove the header of Content-Length --
	removeHeader headerName="Content-Length" /
  to uri="otherEndpoint"/
/route
  /camelContext 








   
Change Notification Preferences
   
   View Online
  |
   Add Comment
   








[CONF] Apache Camel How to remove the http protocol headers in the camel message?

2010-03-31 Thread confluence







 How to remove the http protocol headers in the camel message?
 Page edited by willem jiang

 
  
 
 In camel there are lots of components use the http protocol headers to do their business.
The components include camel-http, camel-jetty, camel-restlet, camel-cxf etc. 
So if you are using these component, you may pay attention to the Http protocol headers:


  Exchange.CONTENT_ENCODING
  Exchange.CONTENT_TYPE
  Exchange.HTTP_BASE_URI
  Exchange.HTTP_CHARACTER_ENCODING
  Exchange.HTTP_METHOD
  Exchange.HTTP_PATH
  Exchange.HTTP_QUERY
  Exchange.HTTP_RESPONSE_CODE



If you don't want these headers bother your other endpoints, you'd better to remove these headers like these


  from("jetty://http://myhost:9000/myservice/")
// Remove the header which name is start with CamelHttp, this DSL is new to Camel 2.3.0
// You can use removeHeader if your camel version is lower than 2.3.0
.removeHeaders("CamelHttp*")
.to("otherEndpoint");





  camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"
route
  from uri="jetty://http://myhost:9000/myservice/"/
	!-- remove the header of Content-Length --
	removeHeader headerName="Content-Length" /
  to uri="otherEndpoint"/
/route
  /camelContext 






 
 
   
Change Notification Preferences
   

   View Online
   |
   View Change
  |
   Add Comment









svn commit: r929475 - in /camel/trunk/components/camel-cxf/src: main/java/org/apache/camel/component/cxf/CxfHeaderFilterStrategy.java test/java/org/apache/camel/component/cxf/CxfConsumerMessageTest.ja

2010-03-31 Thread ningjiang
Author: ningjiang
Date: Wed Mar 31 11:05:00 2010
New Revision: 929475

URL: http://svn.apache.org/viewvc?rev=929475view=rev
Log:
CAMEL-2604 Filter the 'Content-Length' message header in camel-cxf component

Modified:

camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfHeaderFilterStrategy.java

camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerMessageTest.java

Modified: 
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfHeaderFilterStrategy.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfHeaderFilterStrategy.java?rev=929475r1=929474r2=929475view=diff
==
--- 
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfHeaderFilterStrategy.java
 (original)
+++ 
camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfHeaderFilterStrategy.java
 Wed Mar 31 11:05:00 2010
@@ -73,6 +73,10 @@ public class CxfHeaderFilterStrategy ext
 // message size (e.g. with attachment) is large and response content 
length 
 // is bigger than request content length.)
 getOutFilter().add(Content-Length);
+
+// Filter Content-Length as it will cause some trouble when the 
message 
+// is passed to the other endpoint
+getInFilter().add(Content-Length);
 
 // initialize message header filter map with default SOAP filter
 messageHeaderFiltersMap = new HashMapString, MessageHeaderFilter();

Modified: 
camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerMessageTest.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerMessageTest.java?rev=929475r1=929474r2=929475view=diff
==
--- 
camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerMessageTest.java
 (original)
+++ 
camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfConsumerMessageTest.java
 Wed Mar 31 11:05:00 2010
@@ -40,6 +40,9 @@ public class CxfConsumerMessageTest exte
 from(SIMPLE_ENDPOINT_URI + dataFormat=MESSAGE).process(new 
Processor() {
 public void process(final Exchange exchange) {
 Message in = exchange.getIn();
+// check the content-length header is filtered 
+Object value = in.getHeader(Content-Length);
+assertNull(The Content-Length header should be 
removed, value);
 // Get the request message
 String request = in.getBody(String.class);
 // Send the response message back




svn commit: r929501 - in /camel/m2-repo/com/google/appengine: appengine-api-1.0-sdk/ appengine-api-1.0-sdk/1.3.2/ appengine-api-labs/ appengine-api-labs/1.3.2/

2010-03-31 Thread krasserm
Author: krasserm
Date: Wed Mar 31 12:25:56 2010
New Revision: 929501

URL: http://svn.apache.org/viewvc?rev=929501view=rev
Log:
gae-sdk-1.3.2 upload

Added:
camel/m2-repo/com/google/appengine/appengine-api-1.0-sdk/1.3.2/

camel/m2-repo/com/google/appengine/appengine-api-1.0-sdk/1.3.2/appengine-api-1.0-sdk-1.3.2.jar
   (with props)

camel/m2-repo/com/google/appengine/appengine-api-1.0-sdk/1.3.2/appengine-api-1.0-sdk-1.3.2.jar.md5

camel/m2-repo/com/google/appengine/appengine-api-1.0-sdk/1.3.2/appengine-api-1.0-sdk-1.3.2.jar.sha1

camel/m2-repo/com/google/appengine/appengine-api-1.0-sdk/1.3.2/appengine-api-1.0-sdk-1.3.2.pom
   (with props)

camel/m2-repo/com/google/appengine/appengine-api-1.0-sdk/1.3.2/appengine-api-1.0-sdk-1.3.2.pom.md5

camel/m2-repo/com/google/appengine/appengine-api-1.0-sdk/1.3.2/appengine-api-1.0-sdk-1.3.2.pom.sha1
camel/m2-repo/com/google/appengine/appengine-api-labs/1.3.2/

camel/m2-repo/com/google/appengine/appengine-api-labs/1.3.2/appengine-api-labs-1.3.2.jar
   (with props)

camel/m2-repo/com/google/appengine/appengine-api-labs/1.3.2/appengine-api-labs-1.3.2.jar.md5

camel/m2-repo/com/google/appengine/appengine-api-labs/1.3.2/appengine-api-labs-1.3.2.jar.sha1

camel/m2-repo/com/google/appengine/appengine-api-labs/1.3.2/appengine-api-labs-1.3.2.pom
   (with props)

camel/m2-repo/com/google/appengine/appengine-api-labs/1.3.2/appengine-api-labs-1.3.2.pom.md5

camel/m2-repo/com/google/appengine/appengine-api-labs/1.3.2/appengine-api-labs-1.3.2.pom.sha1
Modified:
camel/m2-repo/com/google/appengine/appengine-api-1.0-sdk/maven-metadata.xml

camel/m2-repo/com/google/appengine/appengine-api-1.0-sdk/maven-metadata.xml.md5

camel/m2-repo/com/google/appengine/appengine-api-1.0-sdk/maven-metadata.xml.sha1
camel/m2-repo/com/google/appengine/appengine-api-labs/maven-metadata.xml
camel/m2-repo/com/google/appengine/appengine-api-labs/maven-metadata.xml.md5

camel/m2-repo/com/google/appengine/appengine-api-labs/maven-metadata.xml.sha1

Added: 
camel/m2-repo/com/google/appengine/appengine-api-1.0-sdk/1.3.2/appengine-api-1.0-sdk-1.3.2.jar
URL: 
http://svn.apache.org/viewvc/camel/m2-repo/com/google/appengine/appengine-api-1.0-sdk/1.3.2/appengine-api-1.0-sdk-1.3.2.jar?rev=929501view=auto
==
Binary file - no diff available.

Propchange: 
camel/m2-repo/com/google/appengine/appengine-api-1.0-sdk/1.3.2/appengine-api-1.0-sdk-1.3.2.jar
--
svn:mime-type = application/octet-stream

Added: 
camel/m2-repo/com/google/appengine/appengine-api-1.0-sdk/1.3.2/appengine-api-1.0-sdk-1.3.2.jar.md5
URL: 
http://svn.apache.org/viewvc/camel/m2-repo/com/google/appengine/appengine-api-1.0-sdk/1.3.2/appengine-api-1.0-sdk-1.3.2.jar.md5?rev=929501view=auto
==
--- 
camel/m2-repo/com/google/appengine/appengine-api-1.0-sdk/1.3.2/appengine-api-1.0-sdk-1.3.2.jar.md5
 (added)
+++ 
camel/m2-repo/com/google/appengine/appengine-api-1.0-sdk/1.3.2/appengine-api-1.0-sdk-1.3.2.jar.md5
 Wed Mar 31 12:25:56 2010
@@ -0,0 +1 @@
+69e10999382ed434aa544554b95786b8
\ No newline at end of file

Added: 
camel/m2-repo/com/google/appengine/appengine-api-1.0-sdk/1.3.2/appengine-api-1.0-sdk-1.3.2.jar.sha1
URL: 
http://svn.apache.org/viewvc/camel/m2-repo/com/google/appengine/appengine-api-1.0-sdk/1.3.2/appengine-api-1.0-sdk-1.3.2.jar.sha1?rev=929501view=auto
==
--- 
camel/m2-repo/com/google/appengine/appengine-api-1.0-sdk/1.3.2/appengine-api-1.0-sdk-1.3.2.jar.sha1
 (added)
+++ 
camel/m2-repo/com/google/appengine/appengine-api-1.0-sdk/1.3.2/appengine-api-1.0-sdk-1.3.2.jar.sha1
 Wed Mar 31 12:25:56 2010
@@ -0,0 +1 @@
+486b1182126f82e25e3538d709a952909fb4d029
\ No newline at end of file

Added: 
camel/m2-repo/com/google/appengine/appengine-api-1.0-sdk/1.3.2/appengine-api-1.0-sdk-1.3.2.pom
URL: 
http://svn.apache.org/viewvc/camel/m2-repo/com/google/appengine/appengine-api-1.0-sdk/1.3.2/appengine-api-1.0-sdk-1.3.2.pom?rev=929501view=auto
==
--- 
camel/m2-repo/com/google/appengine/appengine-api-1.0-sdk/1.3.2/appengine-api-1.0-sdk-1.3.2.pom
 (added)
+++ 
camel/m2-repo/com/google/appengine/appengine-api-1.0-sdk/1.3.2/appengine-api-1.0-sdk-1.3.2.pom
 Wed Mar 31 12:25:56 2010
@@ -0,0 +1,6 @@
+?xml version=1.0 encoding=UTF-8?project
+  modelVersion4.0.0/modelVersion
+  groupIdcom.google.appengine/groupId
+  artifactIdappengine-api-1.0-sdk/artifactId
+  version1.3.2/version
+/project
\ No newline at end of file

Propchange: 
camel/m2-repo/com/google/appengine/appengine-api-1.0-sdk/1.3.2/appengine-api-1.0-sdk-1.3.2.pom
--
svn:eol-style 

svn commit: r929525 - /camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java

2010-03-31 Thread ningjiang
Author: ningjiang
Date: Wed Mar 31 13:15:36 2010
New Revision: 929525

URL: http://svn.apache.org/viewvc?rev=929525view=rev
Log:
Fixed the typo of async DSL comments

Modified:

camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java

Modified: 
camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java?rev=929525r1=929524r2=929525view=diff
==
--- 
camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java
 (original)
+++ 
camel/trunk/camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java
 Wed Mar 31 13:15:36 2010
@@ -519,11 +519,11 @@ public abstract class ProcessorDefinitio
 }
 
 /**
- * Sends the exchange to the given endpoint using synchronous mode.
+ * Sends the exchange to the given endpoint using asynchronous mode.
  *
  * @param uri  the endpoint to send to
  * @return the builder
- * @see org.apache.camel.AsyncProcessor
+ * @see org.apache.camel.SendAsyncProcessor
  */
 public ToDefinition toAsync(String uri) {
 ToDefinition answer = new ToDefinition(uri);
@@ -536,12 +536,12 @@ public abstract class ProcessorDefinitio
 }
 
 /**
- * Sends the exchange to the given endpoint using synchronous mode.
+ * Sends the exchange to the given endpoint using asynchronous mode.
  *
  * @param uri  the endpoint to send to
  * @param poolSize the core pool size
  * @return the builder
- * @see org.apache.camel.AsyncProcessor
+ * @see org.apache.camel.SendAsyncProcessor
  */
 public ToDefinition toAsync(String uri, int poolSize) {
 ToDefinition answer = new ToDefinition(uri);
@@ -555,11 +555,11 @@ public abstract class ProcessorDefinitio
 }
 
 /**
- * Sends the exchange to the given endpoint using synchronous mode.
+ * Sends the exchange to the given endpoint using asynchronous mode.
  *
  * @param endpoint  the endpoint to send to
  * @return the builder
- * @see org.apache.camel.AsyncProcessor
+ * @see org.apache.camel.SendAsyncProcessor
  */
 public ToDefinition toAsync(Endpoint endpoint) {
 ToDefinition answer = new ToDefinition(endpoint);
@@ -572,12 +572,12 @@ public abstract class ProcessorDefinitio
 }
 
 /**
- * Sends the exchange to the given endpoint using synchronous mode.
+ * Sends the exchange to the given endpoint using asynchronous mode.
  *
  * @param endpoint  the endpoint to send to
  * @param poolSize the core pool size
  * @return the builder
- * @see org.apache.camel.AsyncProcessor
+ * @see org.apache.camel.SendAsyncProcessor
  */
 public ToDefinition toAsync(Endpoint endpoint, int poolSize) {
 ToDefinition answer = new ToDefinition(endpoint);




svn commit: r929537 - in /camel/branches/camel-1.x/camel-core/src: main/java/org/apache/camel/processor/DeadLetterChannel.java test/java/org/apache/camel/processor/DeadLetterChannelAsyncTest.java

2010-03-31 Thread gertv
Author: gertv
Date: Wed Mar 31 13:40:48 2010
New Revision: 929537

URL: http://svn.apache.org/viewvc?rev=929537view=rev
Log:
CAMEL-2605: Asynchronous processing in DLC endpoint breaks message handling

Added:

camel/branches/camel-1.x/camel-core/src/test/java/org/apache/camel/processor/DeadLetterChannelAsyncTest.java
Modified:

camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/processor/DeadLetterChannel.java

Modified: 
camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/processor/DeadLetterChannel.java
URL: 
http://svn.apache.org/viewvc/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/processor/DeadLetterChannel.java?rev=929537r1=929536r2=929537view=diff
==
--- 
camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/processor/DeadLetterChannel.java
 (original)
+++ 
camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/processor/DeadLetterChannel.java
 Wed Mar 31 13:40:48 2010
@@ -326,6 +326,10 @@ public class DeadLetterChannel extends E
 boolean sync = afp.process(exchange, new AsyncCallback() {
 public void done(boolean sync) {
 restoreExceptionOnExchange(exchange, data.handledPredicate);
+
+// if the fault was handled asynchronously, this should be 
reflected in the callback as well
+data.sync = sync;
+
 callback.done(data.sync);
 }
 });

Added: 
camel/branches/camel-1.x/camel-core/src/test/java/org/apache/camel/processor/DeadLetterChannelAsyncTest.java
URL: 
http://svn.apache.org/viewvc/camel/branches/camel-1.x/camel-core/src/test/java/org/apache/camel/processor/DeadLetterChannelAsyncTest.java?rev=929537view=auto
==
--- 
camel/branches/camel-1.x/camel-core/src/test/java/org/apache/camel/processor/DeadLetterChannelAsyncTest.java
 (added)
+++ 
camel/branches/camel-1.x/camel-core/src/test/java/org/apache/camel/processor/DeadLetterChannelAsyncTest.java
 Wed Mar 31 13:40:48 2010
@@ -0,0 +1,102 @@
+/**
+ * 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.processor;
+
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.Executor;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.camel.AsyncCallback;
+import org.apache.camel.AsyncProcessor;
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.model.LoggingLevel;
+import org.apache.camel.util.AsyncProcessorHelper;
+
+/**
+ * Test to ensure that async processing inside the DLC endpoint does not break 
message handling
+ * - https://issues.apache.org/activemq/browse/CAMEL-2605
+ *
+ * @version $Revision: 761633 $
+ */
+public class DeadLetterChannelAsyncTest extends ContextTestSupport {
+
+private static final int COUNT = 1;
+
+private final CountDownLatch sent = new CountDownLatch(COUNT);
+private final CountDownLatch handled = new CountDownLatch(COUNT);
+
+private final Executor executor = Executors.newFixedThreadPool(2);
+
+public void testAsyncDlcHandling() throws Exception {
+executor.execute(new Runnable() {
+public void run() {
+sendBody(direct:start, Desperately need processing...);
+sent.countDown();
+}
+});
+
+assertTrue(Call to sendBody should have ended successfully,
+   sent.await(2, TimeUnit.SECONDS));
+assertTrue(Error should have been handled asynchronously,
+   handled.await(2, TimeUnit.SECONDS));
+}
+
+protected RouteBuilder createRouteBuilder() {
+return new RouteBuilder() {
+public void configure() {
+
errorHandler(deadLetterChannel(direct:dlc).maximumRedeliveries(0));
+
+from(direct:start).process(new Processor() {
+public void 

[CONF] Apache Camel GAE

2010-03-31 Thread confluence







 GAE
 Page edited by Martin Krasser

 
  
 
 Camel Components for Google App Engine

TutorialA good starting point for using Camel on GAE is the Tutorial for Camel on Google App Engine

The Camel components for Google App Engine (GAE) are part of the camel-gae project and provide connectivity to GAE's cloud computing services. They make the GAE cloud computing environment accessible to applications via Camel interfaces. Following this pattern for other cloud computing environments could make it easier to port Camel applications from one cloud computing provider to another. The following table lists the cloud computing services provided by Google and the supporting Camel components. The documentation of each component can be found by following the link in the Camel Component column.



GAE service
Camel component
Component description


URL fetch service
ghttp
Provides connectivity to the GAE URL fetch service but can also be used to receive messages from servlets.


Task queueing service
gtask
Supports asynchronous message processing on GAE by using the task queueing service as message queue.


Mail service
gmail
Supports sending of emails via the GAE mail service. Receiving mails is not supported yet but will be added later.


Memcache service

Not supported yet.


XMPP service

Not supported yet.


Images service

Not supported yet.


Datastore service

Not supported yet.


Accounts service
gauth  glogin
These components interact with the Google Accounts API for authentication and authorization. Google Accounts is not specific to Google App Engine but is often used by GAE applications for implementing security. The gauth component is used by web applications to implement a Google-specific OAuth consumer. This component can also be used to OAuth-enable non-GAE web applications. The glogin component is used by Java clients (outside GAE) for programmatic login to GAE applications. For instructions how to protect GAE applications against unauthorized access refer to the Security for Camel GAE applications page.



Camel context

Setting up a SpringCamelContext on Google App Engine differs between Camel 2.1 and Camel 2.2. The problem is that usage of the Camel-specific Spring configuration XML schema from the http://camel.apache.org/schema/spring namespace requires JAXB and Camel 2.1 depends on a Google App Engine SDK version that doesn't support JAXB yet.


	Camel 2.1 depends on the Google App Engine SDK 1.2.6 which doesn't support JAXB. Refer to the Camel 2.1 subsection for instructions how to set up a SpringCamelContext with Camel 2.1 on GAE.
	Camel 2.2 depends on the Google App Engine SDK 1.2.8, the first version that introduces support for JAXB. Refer to the Camel 2.2 or higher subsection for instructions how to set up a SpringCamelContext with Camel 2.2 on GAE.
	Camel 2.3 depends on the Google App Engine SDK 1.3.2.



In all versions, JMX must be disabled because the javax.management package isn't on the App Engine JRE whitelist.

Camel 2.1

camel-gae 2.1 comes with the following CamelContext implementations.


	org.apache.camel.component.gae.context.GaeDefaultCamelContext (extends org.apache.camel.impl.DefaultCamelContext)
	org.apache.camel.component.gae.context.GaeSpringCamelContext (extends org.apache.camel.spring.SpringCamelContext)



Both disable JMX before startup. The GaeSpringCamelContext additionally provides setter methods adding route builders as shown in the next example.

appctx.xml

beans xmlns="http://www.springframework.org/schema/beans"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"

bean id="camelContext" 
class="org.apache.camel.component.gae.context.GaeSpringCamelContext"
property name="routeBuilder" ref="myRouteBuilder" /
/bean

bean id="myRouteBuilder"
class="org.example.MyRouteBuilder"
/bean

/beans

 

Alternatively, use the routeBuilders property of the GaeSpringCamelContext for setting a list of route builders. Using this approach, a SpringCamelContext can be configured on GAE without the need for JAXB.

Camel 2.2 or higher

With Camel 2.2, applications can use the http://camel.apache.org/schema/spring namespace for configuring a SpringCamelContext but still need to disable JMX. Here's an example.

appctx.xml

beans xmlns="http://www.springframework.org/schema/beans"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:camel="http://camel.apache.org/schema/spring"
   xsi:schemaLocation="
http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd"

camel:camelContext id="camelContext"
camel:jmxAgent id="agent" disabled="true" /

svn commit: r929586 - /camel/trunk/platforms/karaf/features/src/main/resources/features.xml

2010-03-31 Thread akarpe
Author: akarpe
Date: Wed Mar 31 15:17:10 2010
New Revision: 929586

URL: http://svn.apache.org/viewvc?rev=929586view=rev
Log:
Added a feature to allow camel-netty to be deployed in Karaf

Modified:
camel/trunk/platforms/karaf/features/src/main/resources/features.xml

Modified: camel/trunk/platforms/karaf/features/src/main/resources/features.xml
URL: 
http://svn.apache.org/viewvc/camel/trunk/platforms/karaf/features/src/main/resources/features.xml?rev=929586r1=929585r2=929586view=diff
==
--- camel/trunk/platforms/karaf/features/src/main/resources/features.xml 
(original)
+++ camel/trunk/platforms/karaf/features/src/main/resources/features.xml Wed 
Mar 31 15:17:10 2010
@@ -353,6 +353,11 @@
 feature version='${pom.version}'camel-core/feature 
 
bundlemvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jsendnsca-core/${jsendnsca-bundle-version}/bundle
 bundlemvn:org.apache.camel/camel-nagios/${pom.version}/bundle
+  /feature
+  feature name='camel-netty' version='${pom.version}'
+feature version='${pom.version}'camel-core/feature
+
bundlewrap:http://repository.jboss.org/maven2/org/jboss/netty/netty/3.1.5.GA/netty-3.1.5.GA.jar/bundle
+bundlemvn:org.apache.camel/camel-netty/${pom.version}/bundle
   /feature 
   feature name='camel-ognl' version='${pom.version}'
 feature version='${pom.version}'camel-core/feature




svn commit: r929597 - in /camel/trunk/components/camel-gae: pom.xml src/test/java/org/apache/camel/component/gae/http/MockUrlFetchService.java src/test/java/org/apache/camel/component/gae/task/MockQue

2010-03-31 Thread krasserm
Author: krasserm
Date: Wed Mar 31 15:52:17 2010
New Revision: 929597

URL: http://svn.apache.org/viewvc?rev=929597view=rev
Log:
Upgrade to App Engine SDK 1.3.2

Modified:
camel/trunk/components/camel-gae/pom.xml

camel/trunk/components/camel-gae/src/test/java/org/apache/camel/component/gae/http/MockUrlFetchService.java

camel/trunk/components/camel-gae/src/test/java/org/apache/camel/component/gae/task/MockQueue.java

Modified: camel/trunk/components/camel-gae/pom.xml
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-gae/pom.xml?rev=929597r1=929596r2=929597view=diff
==
--- camel/trunk/components/camel-gae/pom.xml (original)
+++ camel/trunk/components/camel-gae/pom.xml Wed Mar 31 15:52:17 2010
@@ -32,7 +32,7 @@
 
   properties

camel.osgi.export.pkgorg.apache.camel.component.gae.*/camel.osgi.export.pkg
-appengine-sdk-version1.3.0/appengine-sdk-version
+appengine-sdk-version1.3.2/appengine-sdk-version
 gdata-version1.40.2/gdata-version
   /properties
 

Modified: 
camel/trunk/components/camel-gae/src/test/java/org/apache/camel/component/gae/http/MockUrlFetchService.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-gae/src/test/java/org/apache/camel/component/gae/http/MockUrlFetchService.java?rev=929597r1=929596r2=929597view=diff
==
--- 
camel/trunk/components/camel-gae/src/test/java/org/apache/camel/component/gae/http/MockUrlFetchService.java
 (original)
+++ 
camel/trunk/components/camel-gae/src/test/java/org/apache/camel/component/gae/http/MockUrlFetchService.java
 Wed Mar 31 15:52:17 2010
@@ -18,6 +18,7 @@ package org.apache.camel.component.gae.h
 
 import java.io.IOException;
 import java.net.URL;
+import java.util.concurrent.Future;
 
 import com.google.appengine.api.urlfetch.HTTPHeader;
 import com.google.appengine.api.urlfetch.HTTPRequest;
@@ -43,4 +44,12 @@ public class MockUrlFetchService impleme
 return response;
 }
 
+public FutureHTTPResponse fetchAsync(URL url) {
+throw new UnsupportedOperationException(not implemented);
+}
+
+public FutureHTTPResponse fetchAsync(HTTPRequest httpRequest) {
+throw new UnsupportedOperationException(not implemented);
+}
+
 }

Modified: 
camel/trunk/components/camel-gae/src/test/java/org/apache/camel/component/gae/task/MockQueue.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-gae/src/test/java/org/apache/camel/component/gae/task/MockQueue.java?rev=929597r1=929596r2=929597view=diff
==
--- 
camel/trunk/components/camel-gae/src/test/java/org/apache/camel/component/gae/task/MockQueue.java
 (original)
+++ 
camel/trunk/components/camel-gae/src/test/java/org/apache/camel/component/gae/task/MockQueue.java
 Wed Mar 31 15:52:17 2010
@@ -16,6 +16,7 @@
  */
 package org.apache.camel.component.gae.task;
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
@@ -55,6 +56,10 @@ public class MockQueue implements Queue 
 return add(null, taskOptions);
 }
 
+public ListTaskHandle add(IterableTaskOptions taskOptionsIterable) {
+return add(null, taskOptionsIterable);
+}
+
 public TaskHandle add(Transaction transaction, TaskOptions taskOptions) {
 TaskOptionsAccessor accessor = new TaskOptionsAccessor(taskOptions);
 try {
@@ -74,6 +79,14 @@ public class MockQueue implements Queue 
 return null;
 }
 
+public ListTaskHandle add(Transaction transaction, IterableTaskOptions 
taskOptionsIterable) {
+ArrayListTaskHandle handles = new ArrayListTaskHandle();
+for (TaskOptions taskOptions : taskOptionsIterable) {
+handles.add(add(transaction, taskOptions));
+}
+return handles;
+}
+
 public String getQueueName() {
 return name;
 }




[CONF] Apache Camel Netty

2010-03-31 Thread confluence







Netty
Page  added by Ashwin Karpe

 

 Netty Component

Available as of Camel 2.3

The netty component in Camel is a socket communication component, based on the JBoss Netty community offering (available under an Apache 2.0 license). Netty is a NIO client server framework which enables quick and easy development of network applications such as protocol servers and clients. Netty greatly simplifies and streamlines network programming such as TCP and UDP socket server.


This camel component supports both producer and consumer endpoints.

The netty component has several options and allows fine-grained control of a number of TCP/UDP communication parameters (buffer sizes, keepAlives, tcpNoDelay etc) and facilitates both In-Only and In-Out communication on a Camel route.

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


dependency
groupIdorg.apache.camel/groupId
artifactIdcamel-netty/artifactId
versionx.x.x/version
!-- use the same version as your Camel core version --
/dependency



URI format

The URI scheme for a netty component is as follows



netty:tcp://localhost:9[?options]
netty:udp://remotehost:9/[?options]



This component supports producer and consumer endpoints for both TCP and UDP.

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

Options



 Name 
 Default Value 
 Description 


 keepAlive 
 true 
 boolean setting to ensure socket is not closed due to inactivity 


 tcpNoDelay 
 true 
 boolean setting to improve TCP protocol performance 


 broadcast 
 false 
 boolean setting to choose Multicast over UDP 


 connectTimeoutMillis 
 10 seconds 
 time to wait for a socket connection to be available 


 receiveTimeoutMillis 
 10 seconds 
 time to wait for a response to be received on a connection 


 reuseAddress 
 true 
 boolean setting to facilitate socket multiplexing 


 sync 
 false 
 boolean setting to set endpoint as one-way or request-response 


 ssl 
 false 
 boolean setting to specify whether SSL encrytion is applied to this endpoint 


 sendBufferSize 
 65536 bytes 
 the TCP/UDP buffer sizes to be used during outbound communication 


 receiveBufferSize 
 65536 bytes 
 tthe TCP/UDP buffer sizes to be used during inbound communication 


 corePoolSize 
 10 threads 
 the number of allocated threads at component startup. Defaults to 10 


 maxPoolSize 
 100 threads 
  the maximum number of threads that may be allocated to this endpoint. Defaults to 100 



Registry based Options

Codec Handlers and SSL Keystores can be set via a JNDI Registry that is associated with the Camel Context. The values that could be passed in, are the following



 Name 
 Description 


 passphrase 
 password setting to use in order to encrypt/decrypt payloads sent using SSH 


 keyStoreFile 
 Client side certificate keystore to be used for encryption 


 trustStoreFile 
 Server side certificate keystore to be used for encryption 


 sslHandler 
 Reference to a class that could be used to return an SSL Handler 


 encoder 
 A custom Handler class that can be used to perform special marshalling of outbound payloads. Must override org.jboss.netty.channel.ChannelDownStreamHandler 


 decoder 
 A custom Handler class that can be used to perform special marshalling of inbound payloads. Must override org.jboss.netty.channel.ChannelUpStreamHandler 


 handler 
 A custom Handler class that can be used to perform custom processing of Netty events triggered during communication. Must override org.jboss.netty.channel.SimpleChannelHandler 



Sending Messages to/from a Netty endpoint

Netty Producer 
In Producer mode, the component provides the ability to send payloads to a socket endpoint using either TCP or UDP protocols (with optional SSL support). The producer mode supports both one-way and request-response based operations.

Netty Consumer
In Consumer mode, the component provides the ability to 
a listen on a specified socket using either TCP or UDP protocols (with optional SSL support),
b receive requests on the socket using text/xml, binary and serialized object based payloads and 
c send them along on a route as message exchanges.
The consumer mode supports both one-way and request-response based operations.

Usage Samples

Example 1: A UDP based Netty consumer endpoint supporting Request-Reply communication and serialized Object payload


RouteBuilder builder = new RouteBuilder() {
  public void configure() {
from("netty:udp://localhost:5155?sync=true")
  .process(new Processor() {
 public void process(Exchange exchange) throws Exception {
   Poetry poetry = (Poetry) exchange.getIn().getBody();
   poetry.setPoet("Dr. Sarojini Naidu");
   exchange.getOut().setBody(poetry);
 }
   }
}
};



Example 2: A TCP based Netty consumer endpoint supporting One-way communication


RouteBuilder 

[CONF] Apache Camel Netty

2010-03-31 Thread confluence







 Netty
 Page edited by Ashwin Karpe

 
  
 
 Netty Component

Available as of Camel 2.3

The netty component in Camel is a socket communication component, based on the JBoss Netty community offering (available under an Apache 2.0 license). Netty is a NIO client server framework which enables quick and easy development of network applications such as protocol servers and clients. Netty greatly simplifies and streamlines network programming such as TCP and UDP socket server.


This camel component supports both producer and consumer endpoints.

The netty component has several options and allows fine-grained control of a number of TCP/UDP communication parameters (buffer sizes, keepAlives, tcpNoDelay etc) and facilitates both In-Only and In-Out communication on a Camel route.

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


dependency
groupIdorg.apache.camel/groupId
artifactIdcamel-netty/artifactId
versionx.x.x/version
!-- use the same version as your Camel core version --
/dependency



URI format

The URI scheme for a netty component is as follows



netty:tcp://localhost:9[?options]
netty:udp://remotehost:9/[?options]



This component supports producer and consumer endpoints for both TCP and UDP.

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

Options



 Name 
 Default Value 
 Description 


 keepAlive 
 true 
 boolean setting to ensure socket is not closed due to inactivity 


 tcpNoDelay 
 true 
 boolean setting to improve TCP protocol performance 


 broadcast 
 false 
 boolean setting to choose Multicast over UDP 


 connectTimeoutMillis 
 10 seconds 
 time to wait for a socket connection to be available 


 receiveTimeoutMillis 
 10 seconds 
 time to wait for a response to be received on a connection 


 reuseAddress 
 true 
 boolean setting to facilitate socket multiplexing 


 sync 
 false 
 boolean setting to set endpoint as one-way or request-response 


 ssl 
 false 
 boolean setting to specify whether SSL encrytion is applied to this endpoint 


 sendBufferSize 
 65536 bytes 
 the TCP/UDP buffer sizes to be used during outbound communication 


 receiveBufferSize 
 65536 bytes 
 tthe TCP/UDP buffer sizes to be used during inbound communication 


 corePoolSize 
 10 threads 
 the number of allocated threads at component startup. Defaults to 10 


 maxPoolSize 
 100 threads 
  the maximum number of threads that may be allocated to this endpoint. Defaults to 100 



Registry based Options

Codec Handlers and SSL Keystores can be set via a JNDI Registry that is associated with the Camel Context. The values that could be passed in, are the following



 Name 
 Description 


 passphrase 
 password setting to use in order to encrypt/decrypt payloads sent using SSH 


 keyStoreFile 
 Client side certificate keystore to be used for encryption 


 trustStoreFile 
 Server side certificate keystore to be used for encryption 


 sslHandler 
 Reference to a class that could be used to return an SSL Handler 


 encoder 
 A custom Handler class that can be used to perform special marshalling of outbound payloads. Must override org.jboss.netty.channel.ChannelDownStreamHandler 


 decoder 
 A custom Handler class that can be used to perform special marshalling of inbound payloads. Must override org.jboss.netty.channel.ChannelUpStreamHandler 


 handler 
 A custom Handler class that can be used to perform custom processing of Netty events triggered during communication. Must override org.jboss.netty.channel.SimpleChannelHandler 



Sending Messages to/from a Netty endpoint

Netty Producer 
In Producer mode, the component provides the ability to send payloads to a socket endpoint using either TCP or UDP protocols (with optional SSL support). The producer mode supports both one-way and request-response based operations.

Netty Consumer
In Consumer mode, the component provides the ability to 

	listen on a specified socket using either TCP or UDP protocols (with optional SSL support),
	receive requests on the socket using text/xml, binary and serialized object based payloads and
	send them along on a route as message exchanges.
The consumer mode supports both one-way and request-response based operations.



Usage Samples

Example 1: A UDP based Netty consumer endpoint supporting Request-Reply communication and serialized Object payload


RouteBuilder builder = new RouteBuilder() {
  public void configure() {
from("netty:udp://localhost:5155?sync=true")
  .process(new Processor() {
 public void process(Exchange exchange) throws Exception {
   Poetry poetry = (Poetry) exchange.getIn().getBody();
   poetry.setPoet("Dr. Sarojini Naidu");
   exchange.getOut().setBody(poetry);
 }
   }
}
};



Example 2: A TCP based Netty consumer endpoint supporting One-way communication


RouteBuilder builder 

[CONF] Apache Camel Netty

2010-03-31 Thread confluence







 Netty
 Page edited by Ashwin Karpe

 
  
 
 Netty Component

Available as of Camel 2.3

The netty component in Camel is a socket communication component, based on the JBoss Netty community offering (available under an Apache 2.0 license). Netty is a NIO client server framework which enables quick and easy development of network applications such as protocol servers and clients. Netty greatly simplifies and streamlines network programming such as TCP and UDP socket server.


This camel component supports both producer and consumer endpoints.

The netty component has several options and allows fine-grained control of a number of TCP/UDP communication parameters (buffer sizes, keepAlives, tcpNoDelay etc) and facilitates both In-Only and In-Out communication on a Camel route.

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


dependency
groupIdorg.apache.camel/groupId
artifactIdcamel-netty/artifactId
versionx.x.x/version
!-- use the same version as your Camel core version --
/dependency



URI format

The URI scheme for a netty component is as follows



netty:tcp://localhost:9[?options]
netty:udp://remotehost:9/[?options]



This component supports producer and consumer endpoints for both TCP and UDP.

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

Options



 Name 
 Default Value 
 Description 


 keepAlive 
 true 
 boolean setting to ensure socket is not closed due to inactivity 


 tcpNoDelay 
 true 
 boolean setting to improve TCP protocol performance 


 broadcast 
 false 
 boolean setting to choose Multicast over UDP 


 connectTimeoutMillis 
 10 seconds 
 time to wait for a socket connection to be available 


 receiveTimeoutMillis 
 10 seconds 
 time to wait for a response to be received on a connection 


 reuseAddress 
 true 
 boolean setting to facilitate socket multiplexing 


 sync 
 false 
 boolean setting to set endpoint as one-way or request-response 


 ssl 
 false 
 boolean setting to specify whether SSL encrytion is applied to this endpoint 


 sendBufferSize 
 65536 bytes 
 the TCP/UDP buffer sizes to be used during outbound communication 


 receiveBufferSize 
 65536 bytes 
 tthe TCP/UDP buffer sizes to be used during inbound communication 


 corePoolSize 
 10 threads 
 the number of allocated threads at component startup. Defaults to 10 


 maxPoolSize 
 100 threads 
  the maximum number of threads that may be allocated to this endpoint. Defaults to 100 



Registry based Options

Codec Handlers and SSL Keystores can be set via a JNDI Registry that is associated with the Camel Context. The values that could be passed in, are the following



 Name 
 Description 


 passphrase 
 password setting to use in order to encrypt/decrypt payloads sent using SSH 


 keyStoreFile 
 Client side certificate keystore to be used for encryption 


 trustStoreFile 
 Server side certificate keystore to be used for encryption 


 sslHandler 
 Reference to a class that could be used to return an SSL Handler 


 encoder 
 A custom Handler class that can be used to perform special marshalling of outbound payloads. Must override org.jboss.netty.channel.ChannelDownStreamHandler 


 decoder 
 A custom Handler class that can be used to perform special marshalling of inbound payloads. Must override org.jboss.netty.channel.ChannelUpStreamHandler 


 handler 
 A custom Handler class that can be used to perform custom processing of Netty events triggered during communication. Must override org.jboss.netty.channel.SimpleChannelHandler 



Sending Messages to/from a Netty endpoint

Netty Producer 
In Producer mode, the component provides the ability to send payloads to a socket endpoint using either TCP or UDP protocols (with optional SSL support). The producer mode supports both one-way and request-response based operations.

Netty Consumer
In Consumer mode, the component provides the ability to 

	listen on a specified socket using either TCP or UDP protocols (with optional SSL support),
	receive requests on the socket using text/xml, binary and serialized object based payloads and
	send them along on a route as message exchanges.



The consumer mode supports both one-way and request-response based operations.

Usage Samples

Example 1: A UDP based Netty consumer endpoint supporting Request-Reply communication and serialized Object payload


RouteBuilder builder = new RouteBuilder() {
  public void configure() {
from("netty:udp://localhost:5155?sync=true")
  .process(new Processor() {
 public void process(Exchange exchange) throws Exception {
   Poetry poetry = (Poetry) exchange.getIn().getBody();
   poetry.setPoet("Dr. Sarojini Naidu");
   exchange.getOut().setBody(poetry);
 }
   }
}
};



Example 2: A TCP based Netty consumer endpoint supporting One-way communication


RouteBuilder builder 

[CONF] Apache Camel Netty

2010-03-31 Thread confluence







 Netty
 Page edited by Ashwin Karpe

 
  
 
 Netty Component

Available as of Camel 2.3
See also the Apache Mina component 

The netty component in Camel is a socket communication component, based on the JBoss Netty community offering (available under an Apache 2.0 license). Netty is a NIO client server framework which enables quick and easy development of network applications such as protocol servers and clients. Netty greatly simplifies and streamlines network programming such as TCP and UDP socket server.


This camel component supports both producer and consumer endpoints.

The netty component has several options and allows fine-grained control of a number of TCP/UDP communication parameters (buffer sizes, keepAlives, tcpNoDelay etc) and facilitates both In-Only and In-Out communication on a Camel route.

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


dependency
groupIdorg.apache.camel/groupId
artifactIdcamel-netty/artifactId
versionx.x.x/version
!-- use the same version as your Camel core version --
/dependency



URI format

The URI scheme for a netty component is as follows



netty:tcp://localhost:9[?options]
netty:udp://remotehost:9/[?options]



This component supports producer and consumer endpoints for both TCP and UDP.

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

Options



 Name 
 Default Value 
 Description 


 keepAlive 
 true 
 boolean setting to ensure socket is not closed due to inactivity 


 tcpNoDelay 
 true 
 boolean setting to improve TCP protocol performance 


 broadcast 
 false 
 boolean setting to choose Multicast over UDP 


 connectTimeoutMillis 
 10 seconds 
 time to wait for a socket connection to be available 


 receiveTimeoutMillis 
 10 seconds 
 time to wait for a response to be received on a connection 


 reuseAddress 
 true 
 boolean setting to facilitate socket multiplexing 


 sync 
 false 
 boolean setting to set endpoint as one-way or request-response 


 ssl 
 false 
 boolean setting to specify whether SSL encrytion is applied to this endpoint 


 sendBufferSize 
 65536 bytes 
 the TCP/UDP buffer sizes to be used during outbound communication 


 receiveBufferSize 
 65536 bytes 
 tthe TCP/UDP buffer sizes to be used during inbound communication 


 corePoolSize 
 10 threads 
 the number of allocated threads at component startup. Defaults to 10 


 maxPoolSize 
 100 threads 
  the maximum number of threads that may be allocated to this endpoint. Defaults to 100 



Registry based Options

Codec Handlers and SSL Keystores can be set via a JNDI Registry that is associated with the Camel Context. The values that could be passed in, are the following



 Name 
 Description 


 passphrase 
 password setting to use in order to encrypt/decrypt payloads sent using SSH 


 keyStoreFile 
 Client side certificate keystore to be used for encryption 


 trustStoreFile 
 Server side certificate keystore to be used for encryption 


 sslHandler 
 Reference to a class that could be used to return an SSL Handler 


 encoder 
 A custom Handler class that can be used to perform special marshalling of outbound payloads. Must override org.jboss.netty.channel.ChannelDownStreamHandler 


 decoder 
 A custom Handler class that can be used to perform special marshalling of inbound payloads. Must override org.jboss.netty.channel.ChannelUpStreamHandler 


 handler 
 A custom Handler class that can be used to perform custom processing of Netty events triggered during communication. Must override org.jboss.netty.channel.SimpleChannelHandler 



Sending Messages to/from a Netty endpoint

Netty Producer 
In Producer mode, the component provides the ability to send payloads to a socket endpoint using either TCP or UDP protocols (with optional SSL support). The producer mode supports both one-way and request-response based operations.

Netty Consumer
In Consumer mode, the component provides the ability to 

	listen on a specified socket using either TCP or UDP protocols (with optional SSL support),
	receive requests on the socket using text/xml, binary and serialized object based payloads and
	send them along on a route as message exchanges.



The consumer mode supports both one-way and request-response based operations.

Usage Samples

Example 1: A UDP based Netty consumer endpoint supporting Request-Reply communication and serialized Object payload


RouteBuilder builder = new RouteBuilder() {
  public void configure() {
from("netty:udp://localhost:5155?sync=true")
  .process(new Processor() {
 public void process(Exchange exchange) throws Exception {
   Poetry poetry = (Poetry) exchange.getIn().getBody();
   poetry.setPoet("Dr. Sarojini Naidu");
   exchange.getOut().setBody(poetry);
 }
   }
}
};



Example 2: A TCP based Netty consumer endpoint supporting One-way 

[CONF] Apache Camel Netty

2010-03-31 Thread confluence







 Netty
 Page edited by Ashwin Karpe

 
  
 
 Netty Component

Available as of Camel 2.3
See also the Apache Mina component http://camel.apache.org/mina.html

The netty component in Camel is a socket communication component, based on the JBoss Netty community offering (available under an Apache 2.0 license). Netty is a NIO client server framework which enables quick and easy development of network applications such as protocol servers and clients. Netty greatly simplifies and streamlines network programming such as TCP and UDP socket server.


This camel component supports both producer and consumer endpoints.

The netty component has several options and allows fine-grained control of a number of TCP/UDP communication parameters (buffer sizes, keepAlives, tcpNoDelay etc) and facilitates both In-Only and In-Out communication on a Camel route.

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


dependency
groupIdorg.apache.camel/groupId
artifactIdcamel-netty/artifactId
versionx.x.x/version
!-- use the same version as your Camel core version --
/dependency



URI format

The URI scheme for a netty component is as follows



netty:tcp://localhost:9[?options]
netty:udp://remotehost:9/[?options]



This component supports producer and consumer endpoints for both TCP and UDP.

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

Options



 Name 
 Default Value 
 Description 


 keepAlive 
 true 
 boolean setting to ensure socket is not closed due to inactivity 


 tcpNoDelay 
 true 
 boolean setting to improve TCP protocol performance 


 broadcast 
 false 
 boolean setting to choose Multicast over UDP 


 connectTimeoutMillis 
 10 seconds 
 time to wait for a socket connection to be available 


 receiveTimeoutMillis 
 10 seconds 
 time to wait for a response to be received on a connection 


 reuseAddress 
 true 
 boolean setting to facilitate socket multiplexing 


 sync 
 false 
 boolean setting to set endpoint as one-way or request-response 


 ssl 
 false 
 boolean setting to specify whether SSL encrytion is applied to this endpoint 


 sendBufferSize 
 65536 bytes 
 the TCP/UDP buffer sizes to be used during outbound communication 


 receiveBufferSize 
 65536 bytes 
 tthe TCP/UDP buffer sizes to be used during inbound communication 


 corePoolSize 
 10 threads 
 the number of allocated threads at component startup. Defaults to 10 


 maxPoolSize 
 100 threads 
  the maximum number of threads that may be allocated to this endpoint. Defaults to 100 



Registry based Options

Codec Handlers and SSL Keystores can be set via a JNDI Registry that is associated with the Camel Context. The values that could be passed in, are the following



 Name 
 Description 


 passphrase 
 password setting to use in order to encrypt/decrypt payloads sent using SSH 


 keyStoreFile 
 Client side certificate keystore to be used for encryption 


 trustStoreFile 
 Server side certificate keystore to be used for encryption 


 sslHandler 
 Reference to a class that could be used to return an SSL Handler 


 encoder 
 A custom Handler class that can be used to perform special marshalling of outbound payloads. Must override org.jboss.netty.channel.ChannelDownStreamHandler 


 decoder 
 A custom Handler class that can be used to perform special marshalling of inbound payloads. Must override org.jboss.netty.channel.ChannelUpStreamHandler 


 handler 
 A custom Handler class that can be used to perform custom processing of Netty events triggered during communication. Must override org.jboss.netty.channel.SimpleChannelHandler 



Sending Messages to/from a Netty endpoint

Netty Producer 
In Producer mode, the component provides the ability to send payloads to a socket endpoint using either TCP or UDP protocols (with optional SSL support). The producer mode supports both one-way and request-response based operations.

Netty Consumer
In Consumer mode, the component provides the ability to 

	listen on a specified socket using either TCP or UDP protocols (with optional SSL support),
	receive requests on the socket using text/xml, binary and serialized object based payloads and
	send them along on a route as message exchanges.



The consumer mode supports both one-way and request-response based operations.

Usage Samples

Example 1: A UDP based Netty consumer endpoint supporting Request-Reply communication and serialized Object payload


RouteBuilder builder = new RouteBuilder() {
  public void configure() {
from("netty:udp://localhost:5155?sync=true")
  .process(new Processor() {
 public void process(Exchange exchange) throws Exception {
   Poetry poetry = (Poetry) exchange.getIn().getBody();
   poetry.setPoet("Dr. Sarojini Naidu");
   exchange.getOut().setBody(poetry);
 }
   }
}
};



Example 2: A TCP based Netty 

[CONF] Apache Camel Netty

2010-03-31 Thread confluence







 Netty
 Page edited by Ashwin Karpe

 
  
 
 Netty Component

Available as of Camel 2.3

The netty component in Camel is a socket communication component, based on the JBoss Netty community offering (available under an Apache 2.0 license). Netty is a NIO client server framework which enables quick and easy development of network applications such as protocol servers and clients. Netty greatly simplifies and streamlines network programming such as TCP and UDP socket server.


This camel component supports both producer and consumer endpoints.

The netty component has several options and allows fine-grained control of a number of TCP/UDP communication parameters (buffer sizes, keepAlives, tcpNoDelay etc) and facilitates both In-Only and In-Out communication on a Camel route.

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


dependency
groupIdorg.apache.camel/groupId
artifactIdcamel-netty/artifactId
versionx.x.x/version
!-- use the same version as your Camel core version --
/dependency



URI format

The URI scheme for a netty component is as follows



netty:tcp://localhost:9[?options]
netty:udp://remotehost:9/[?options]



This component supports producer and consumer endpoints for both TCP and UDP.

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

Options



 Name 
 Default Value 
 Description 


 keepAlive 
 true 
 boolean setting to ensure socket is not closed due to inactivity 


 tcpNoDelay 
 true 
 boolean setting to improve TCP protocol performance 


 broadcast 
 false 
 boolean setting to choose Multicast over UDP 


 connectTimeoutMillis 
 10 seconds 
 time to wait for a socket connection to be available 


 receiveTimeoutMillis 
 10 seconds 
 time to wait for a response to be received on a connection 


 reuseAddress 
 true 
 boolean setting to facilitate socket multiplexing 


 sync 
 false 
 boolean setting to set endpoint as one-way or request-response 


 ssl 
 false 
 boolean setting to specify whether SSL encrytion is applied to this endpoint 


 sendBufferSize 
 65536 bytes 
 the TCP/UDP buffer sizes to be used during outbound communication 


 receiveBufferSize 
 65536 bytes 
 tthe TCP/UDP buffer sizes to be used during inbound communication 


 corePoolSize 
 10 threads 
 the number of allocated threads at component startup. Defaults to 10 


 maxPoolSize 
 100 threads 
  the maximum number of threads that may be allocated to this endpoint. Defaults to 100 



Registry based Options

Codec Handlers and SSL Keystores can be set via a JNDI Registry that is associated with the Camel Context. The values that could be passed in, are the following



 Name 
 Description 


 passphrase 
 password setting to use in order to encrypt/decrypt payloads sent using SSH 


 keyStoreFile 
 Client side certificate keystore to be used for encryption 


 trustStoreFile 
 Server side certificate keystore to be used for encryption 


 sslHandler 
 Reference to a class that could be used to return an SSL Handler 


 encoder 
 A custom Handler class that can be used to perform special marshalling of outbound payloads. Must override org.jboss.netty.channel.ChannelDownStreamHandler 


 decoder 
 A custom Handler class that can be used to perform special marshalling of inbound payloads. Must override org.jboss.netty.channel.ChannelUpStreamHandler 


 handler 
 A custom Handler class that can be used to perform custom processing of Netty events triggered during communication. Must override org.jboss.netty.channel.SimpleChannelHandler 



Sending Messages to/from a Netty endpoint

Netty Producer 
In Producer mode, the component provides the ability to send payloads to a socket endpoint using either TCP or UDP protocols (with optional SSL support). The producer mode supports both one-way and request-response based operations.

Netty Consumer
In Consumer mode, the component provides the ability to 

	listen on a specified socket using either TCP or UDP protocols (with optional SSL support),
	receive requests on the socket using text/xml, binary and serialized object based payloads and
	send them along on a route as message exchanges.



The consumer mode supports both one-way and request-response based operations.

Usage Samples

Example 1: A UDP based Netty consumer endpoint supporting Request-Reply communication and serialized Object payload


RouteBuilder builder = new RouteBuilder() {
  public void configure() {
from("netty:udp://localhost:5155?sync=true")
  .process(new Processor() {
 public void process(Exchange exchange) throws Exception {
   Poetry poetry = (Poetry) exchange.getIn().getBody();
   poetry.setPoet("Dr. Sarojini Naidu");
   exchange.getOut().setBody(poetry);
 }
   }
}
};



Example 2: A TCP based Netty consumer endpoint supporting One-way communication


RouteBuilder builder 

[CONF] Apache Camel Netty

2010-03-31 Thread confluence







 Netty
 Page edited by Ashwin Karpe

 
  
 
 Netty Component

Available as of Camel 2.3

The netty component in Camel is a socket communication component, based on the JBoss Netty community offering (available under an Apache 2.0 license). Netty is a NIO client server framework which enables quick and easy development of network applications such as protocol servers and clients. Netty greatly simplifies and streamlines network programming such as TCP and UDP socket server.


This camel component supports both producer and consumer endpoints.

The netty component has several options and allows fine-grained control of a number of TCP/UDP communication parameters (buffer sizes, keepAlives, tcpNoDelay etc) and facilitates both In-Only and In-Out communication on a Camel route.

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


dependency
groupIdorg.apache.camel/groupId
artifactIdcamel-netty/artifactId
versionx.x.x/version
!-- use the same version as your Camel core version --
/dependency



URI format

The URI scheme for a netty component is as follows



netty:tcp://localhost:9[?options]
netty:udp://remotehost:9/[?options]



This component supports producer and consumer endpoints for both TCP and UDP.

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

Options



 Name 
 Default Value 
 Description 


 keepAlive 
 true 
 boolean setting to ensure socket is not closed due to inactivity 


 tcpNoDelay 
 true 
 boolean setting to improve TCP protocol performance 


 broadcast 
 false 
 boolean setting to choose Multicast over UDP 


 connectTimeoutMillis 
 10 seconds 
 time to wait for a socket connection to be available 


 receiveTimeoutMillis 
 10 seconds 
 time to wait for a response to be received on a connection 


 reuseAddress 
 true 
 boolean setting to facilitate socket multiplexing 


 sync 
 false 
 boolean setting to set endpoint as one-way or request-response 


 ssl 
 false 
 boolean setting to specify whether SSL encrytion is applied to this endpoint 


 sendBufferSize 
 65536 bytes 
 the TCP/UDP buffer sizes to be used during outbound communication 


 receiveBufferSize 
 65536 bytes 
 tthe TCP/UDP buffer sizes to be used during inbound communication 


 corePoolSize 
 10 threads 
 the number of allocated threads at component startup. Defaults to 10 


 maxPoolSize 
 100 threads 
  the maximum number of threads that may be allocated to this endpoint. Defaults to 100 



Registry based Options

Codec Handlers and SSL Keystores can be set via a JNDI Registry that is associated with the Camel Context. The values that could be passed in, are the following



 Name 
 Description 


 passphrase 
 password setting to use in order to encrypt/decrypt payloads sent using SSH 


 keyStoreFile 
 Client side certificate keystore to be used for encryption 


 trustStoreFile 
 Server side certificate keystore to be used for encryption 


 sslHandler 
 Reference to a class that could be used to return an SSL Handler 


 encoder 
 A custom Handler class that can be used to perform special marshalling of outbound payloads. Must override org.jboss.netty.channel.ChannelDownStreamHandler 


 decoder 
 A custom Handler class that can be used to perform special marshalling of inbound payloads. Must override org.jboss.netty.channel.ChannelUpStreamHandler 


 handler 
 A custom Handler class that can be used to perform custom processing of Netty events triggered during communication. Must override org.jboss.netty.channel.SimpleChannelHandler 



Sending Messages to/from a Netty endpoint

Netty Producer 
In Producer mode, the component provides the ability to send payloads to a socket endpoint using either TCP or UDP protocols (with optional SSL support). The producer mode supports both one-way and request-response based operations.

Netty Consumer
In Consumer mode, the component provides the ability to 

	listen on a specified socket using either TCP or UDP protocols (with optional SSL support),
	receive requests on the socket using text/xml, binary and serialized object based payloads and
	send them along on a route as message exchanges.



The consumer mode supports both one-way and request-response based operations.

Usage Samples

Example 1: A UDP based Netty consumer endpoint supporting Request-Reply communication and serialized Object payload


RouteBuilder builder = new RouteBuilder() {
  public void configure() {
from("netty:udp://localhost:5155?sync=true")
  .process(new Processor() {
 public void process(Exchange exchange) throws Exception {
   Poetry poetry = (Poetry) exchange.getIn().getBody();
   poetry.setPoet("Dr. Sarojini Naidu");
   exchange.getOut().setBody(poetry);
 }
   }
}
};



Example 2: A TCP based Netty consumer endpoint supporting One-way communication


RouteBuilder builder 

[CONF] Apache Camel Netty

2010-03-31 Thread confluence







 Netty
 Page edited by Ashwin Karpe

 
  
 
 Netty Component

Available as of Camel 2.3

The netty component in Camel is a socket communication component, based on the JBoss Netty community offering (available under an Apache 2.0 license). Netty is a NIO client server framework which enables quick and easy development of network applications such as protocol servers and clients. Netty greatly simplifies and streamlines network programming such as TCP and UDP socket server.


This camel component supports both producer and consumer endpoints.

The netty component has several options and allows fine-grained control of a number of TCP/UDP communication parameters (buffer sizes, keepAlives, tcpNoDelay etc) and facilitates both In-Only and In-Out communication on a Camel route.

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


dependency
groupIdorg.apache.camel/groupId
artifactIdcamel-netty/artifactId
versionx.x.x/version
!-- use the same version as your Camel core version --
/dependency



URI format

The URI scheme for a netty component is as follows



netty:tcp://localhost:9[?options]
netty:udp://remotehost:9/[?options]



This component supports producer and consumer endpoints for both TCP and UDP.

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

Options



 Name 
 Default Value 
 Description 


 keepAlive 
 true 
 boolean setting to ensure socket is not closed due to inactivity 


 tcpNoDelay 
 true 
 boolean setting to improve TCP protocol performance 


 broadcast 
 false 
 boolean setting to choose Multicast over UDP 


 connectTimeoutMillis 
 10 seconds 
 time to wait for a socket connection to be available 


 receiveTimeoutMillis 
 10 seconds 
 time to wait for a response to be received on a connection 


 reuseAddress 
 true 
 boolean setting to facilitate socket multiplexing 


 sync 
 false 
 boolean setting to set endpoint as one-way or request-response 


 ssl 
 false 
 boolean setting to specify whether SSL encrytion is applied to this endpoint 


 sendBufferSize 
 65536 bytes 
 the TCP/UDP buffer sizes to be used during outbound communication 


 receiveBufferSize 
 65536 bytes 
 tthe TCP/UDP buffer sizes to be used during inbound communication 


 corePoolSize 
 10 threads 
 the number of allocated threads at component startup. Defaults to 10 


 maxPoolSize 
 100 threads 
  the maximum number of threads that may be allocated to this endpoint. Defaults to 100 



Registry based Options

Codec Handlers and SSL Keystores can be set via a JNDI Registry that is associated with the Camel Context. The values that could be passed in, are the following



 Name 
 Description 


 passphrase 
 password setting to use in order to encrypt/decrypt payloads sent using SSH 


 keyStoreFile 
 Client side certificate keystore to be used for encryption 


 trustStoreFile 
 Server side certificate keystore to be used for encryption 


 sslHandler 
 Reference to a class that could be used to return an SSL Handler 


 encoder 
 A custom Handler class that can be used to perform special marshalling of outbound payloads. Must override org.jboss.netty.channel.ChannelDownStreamHandler 


 decoder 
 A custom Handler class that can be used to perform special marshalling of inbound payloads. Must override org.jboss.netty.channel.ChannelUpStreamHandler 


 handler 
 A custom Handler class that can be used to perform custom processing of Netty events triggered during communication. Must override org.jboss.netty.channel.SimpleChannelHandler 



Sending Messages to/from a Netty endpoint

Netty Producer 
In Producer mode, the component provides the ability to send payloads to a socket endpoint using either TCP or UDP protocols (with optional SSL support). The producer mode supports both one-way and request-response based operations.

Netty Consumer
In Consumer mode, the component provides the ability to 

	listen on a specified socket using either TCP or UDP protocols (with optional SSL support),
	receive requests on the socket using text/xml, binary and serialized object based payloads and
	send them along on a route as message exchanges.



The consumer mode supports both one-way and request-response based operations.

Usage Samples

Example 1: A UDP based Netty consumer endpoint supporting Request-Reply communication and serialized Object payload


RouteBuilder builder = new RouteBuilder() {
  public void configure() {
from("netty:udp://localhost:5155?sync=true")
  .process(new Processor() {
 public void process(Exchange exchange) throws Exception {
   Poetry poetry = (Poetry) exchange.getIn().getBody();
   poetry.setPoet("Dr. Sarojini Naidu");
   exchange.getOut().setBody(poetry);
 }
   }
}
};



Example 2: A TCP based Netty consumer endpoint supporting One-way communication


RouteBuilder builder 

[CONF] Apache Camel Component List

2010-03-31 Thread confluence







 Component List
 Page edited by Ashwin Karpe

 
  
 
 

 Component / ArtifactId / URI 
 Description 


 ActiveMQ / activemq-camel


activemq:[topic:]destinationName

 
 For JMS Messaging with Apache ActiveMQ 


 ActiveMQ Journal / activemq-core


activemq.journal:directory-on-filesystem

 
 Uses ActiveMQ's fast disk journaling implementation to store message bodies in a rolling log file 


 AMQP / camel-amqp


amqp:[topic:]destinationName

 
 For Messaging with AMQP protocol 


 Atom / camel-atom


atom:uri

 
 Working with Apache Abdera for atom integration, such as consuming an atom feed. 


 Bean / camel-core


bean:beanName[?method=someMethod]

 
 Uses the Bean Binding to bind message exchanges to beans in the Registry. Is also used for exposing and invoking POJO (Plain Old Java Objects). 


 Browse / camel-core


browse:someName

 
 Provdes a simple BrowsableEndpoint which can be useful for testing, visualisation tools or debugging. The exchanges sent to the endpoint are all available to be browsed. 


 Cache / camel-cache


cache://cachename[?options]

 
 The cache component facilitates creation of caching endpoints and processors using EHCache as the cache implementation. 


 Cometd / camel-cometd


cometd://host:port/channelname

 
 Used to deliver messages using the jetty cometd implementation of the bayeux protocol 


 CXF / camel-cxf


cxf:address[?serviceClass=...]

 
 Working with Apache CXF for web services integration 


 CXFRS / camel-cxf


cxfrs:address[?resourcesClasses=...]

 
 Working with Apache CXF for REST services integration 


 DataSet / camel-core


dataset:name

 
 For load  soak testing the DataSet provides a way to create huge numbers of messages for sending to Components or asserting that they are consumed correctly 


 Direct / camel-core


direct:name

 
 Synchronous call to another endpoint 


 Esper / camel-esper in camel-extra


esper:name

 
 Working with the Esper Library for Event Stream Processing 


 Event / camel-spring


event://default
spring-event://default

 
 Working with Spring ApplicationEvents 


 File / camel-core


file://nameOfFileOrDirectory

 
 Sending messages to a file or polling a file or directory. Camel 1.x use this link File. 


 Flatpack / camel-flatpack


flatpack:[fixed|delim]:configFile

 
 Processing fixed width or delimited files or messages using the FlatPack library 


 Freemarker / camel-freemarker


freemarker:someTemplateResource

 
 Generates a response using a Freemarker template 


 FTP / camel-ftp


ftp://host[:port]/fileName

 
 Sending and receiving files over FTP. Camel 1.x use this link FTP. 


 FTPS / camel-ftp


ftps://host[:port]/fileName

 
 Sending and receiving files over FTP Secure (TLS and SSL). 


GAuth / camel-gae


gauth://name[?options]


 Used by web applications to implement an OAuth consumer. See also Camel Components for Google App Engine.


GHttp / camel-gae


ghttp://hostname[:port][/path][?options]
ghttp:///path[?options]


 Provides connectivity to the URL fetch service of Google App Engine but can also be used to receive messages from servlets. See also Camel Components for Google App Engine.


GLogin / camel-gae


gauth://hostname[:port][?options]


 Used by Camel applications outside Google App Engine (GAE) for programmatic login to GAE applications. See also Camel Components for Google App Engine.


GTask / camel-gae


gtask://queue-name


 Supports asynchronous message processing on Google App Engine by using the task queueing service as message queue. See also Camel Components for Google App Engine.


GMail / camel-gae


gmail://u...@gmail.com[?options]
gmail://u...@googlemail.com[?options]


 Supports sending of emails via the mail service of Google App Engine. See also Camel Components for Google App Engine.


 HDFS / camel-hdfs in camel-hdfs


hdfs://path[?options]

 
 For reading/writing from/to an HDFS filesystem 


 Hibernate / camel-hibernate in camel-extra


hibernate://entityName

 
 For using a database as a queue via the Hibernate library 


 HL7 / camel-hl7


mina:tcp://hostname[:port]

 
 For working with the HL7 MLLP protocol and the HL7 model using the HAPI library 


 HTTP / camel-http


http://hostname[:port]

 
 For calling out to external HTTP servers 


 iBATIS / camel-ibatis


ibatis://sqlOperationName

 
 Performs a query, poll, insert, update or delete in a relational database using Apache iBATIS 


 IMap / camel-mail


imap://hostname[:port]

 
 Receiving email using IMap 


 IRC / camel-irc


irc:host[:port]/#room

 
 For IRC communication 


 JavaSpace / camel-javaspace


javaspace:jini://host?spaceName=mySpace?...

 
 Sending and receiving messages through JavaSpace 


 JBI / servicemix-camel


jbi:serviceName

 
 For JBI integration such as working with Apache ServiceMix 


 JCR / camel-jcr


jcr://user:passw...@repository/path/to/node

 
 Storing a message in a JCR (JSR-170) compliant repository like Apache Jackrabbit  

[CONF] Apache Camel Component List

2010-03-31 Thread confluence







 Component List
 Page edited by Ashwin Karpe

 
  
 
 

 Component / ArtifactId / URI 
 Description 


 ActiveMQ / activemq-camel


activemq:[topic:]destinationName

 
 For JMS Messaging with Apache ActiveMQ 


 ActiveMQ Journal / activemq-core


activemq.journal:directory-on-filesystem

 
 Uses ActiveMQ's fast disk journaling implementation to store message bodies in a rolling log file 


 AMQP / camel-amqp


amqp:[topic:]destinationName

 
 For Messaging with AMQP protocol 


 Atom / camel-atom


atom:uri

 
 Working with Apache Abdera for atom integration, such as consuming an atom feed. 


 Bean / camel-core


bean:beanName[?method=someMethod]

 
 Uses the Bean Binding to bind message exchanges to beans in the Registry. Is also used for exposing and invoking POJO (Plain Old Java Objects). 


 Browse / camel-core


browse:someName

 
 Provdes a simple BrowsableEndpoint which can be useful for testing, visualisation tools or debugging. The exchanges sent to the endpoint are all available to be browsed. 


 Cache / camel-cache


cache://cachename[?options]

 
 The cache component facilitates creation of caching endpoints and processors using EHCache as the cache implementation. 


 Cometd / camel-cometd


cometd://host:port/channelname

 
 Used to deliver messages using the jetty cometd implementation of the bayeux protocol 


 CXF / camel-cxf


cxf:address[?serviceClass=...]

 
 Working with Apache CXF for web services integration 


 CXFRS / camel-cxf


cxfrs:address[?resourcesClasses=...]

 
 Working with Apache CXF for REST services integration 


 DataSet / camel-core


dataset:name

 
 For load  soak testing the DataSet provides a way to create huge numbers of messages for sending to Components or asserting that they are consumed correctly 


 Direct / camel-core


direct:name

 
 Synchronous call to another endpoint 


 Esper / camel-esper in camel-extra


esper:name

 
 Working with the Esper Library for Event Stream Processing 


 Event / camel-spring


event://default
spring-event://default

 
 Working with Spring ApplicationEvents 


 File / camel-core


file://nameOfFileOrDirectory

 
 Sending messages to a file or polling a file or directory. Camel 1.x use this link File. 


 Flatpack / camel-flatpack


flatpack:[fixed|delim]:configFile

 
 Processing fixed width or delimited files or messages using the FlatPack library 


 Freemarker / camel-freemarker


freemarker:someTemplateResource

 
 Generates a response using a Freemarker template 


 FTP / camel-ftp


ftp://host[:port]/fileName

 
 Sending and receiving files over FTP. Camel 1.x use this link FTP. 


 FTPS / camel-ftp


ftps://host[:port]/fileName

 
 Sending and receiving files over FTP Secure (TLS and SSL). 


GAuth / camel-gae


gauth://name[?options]


 Used by web applications to implement an OAuth consumer. See also Camel Components for Google App Engine.


GHttp / camel-gae


ghttp://hostname[:port][/path][?options]
ghttp:///path[?options]


 Provides connectivity to the URL fetch service of Google App Engine but can also be used to receive messages from servlets. See also Camel Components for Google App Engine.


GLogin / camel-gae


gauth://hostname[:port][?options]


 Used by Camel applications outside Google App Engine (GAE) for programmatic login to GAE applications. See also Camel Components for Google App Engine.


GTask / camel-gae


gtask://queue-name


 Supports asynchronous message processing on Google App Engine by using the task queueing service as message queue. See also Camel Components for Google App Engine.


GMail / camel-gae


gmail://u...@gmail.com[?options]
gmail://u...@googlemail.com[?options]


 Supports sending of emails via the mail service of Google App Engine. See also Camel Components for Google App Engine.


 HDFS / camel-hdfs in camel-hdfs


hdfs://path[?options]

 
 For reading/writing from/to an HDFS filesystem 


 Hibernate / camel-hibernate in camel-extra


hibernate://entityName

 
 For using a database as a queue via the Hibernate library 


 HL7 / camel-hl7


mina:tcp://hostname[:port]

 
 For working with the HL7 MLLP protocol and the HL7 model using the HAPI library 


 HTTP / camel-http


http://hostname[:port]

 
 For calling out to external HTTP servers 


 iBATIS / camel-ibatis


ibatis://sqlOperationName

 
 Performs a query, poll, insert, update or delete in a relational database using Apache iBATIS 


 IMap / camel-mail


imap://hostname[:port]

 
 Receiving email using IMap 


 IRC / camel-irc


irc:host[:port]/#room

 
 For IRC communication 


 JavaSpace / camel-javaspace


javaspace:jini://host?spaceName=mySpace?...

 
 Sending and receiving messages through JavaSpace 


 JBI / servicemix-camel


jbi:serviceName

 
 For JBI integration such as working with Apache ServiceMix 


 JCR / camel-jcr


jcr://user:passw...@repository/path/to/node

 
 Storing a message in a JCR (JSR-170) compliant repository like Apache Jackrabbit  

[CONF] Apache Camel Component List

2010-03-31 Thread confluence







 Component List
 Page edited by Ashwin Karpe

 
  
 
 

 Component / ArtifactId / URI 
 Description 


 ActiveMQ / activemq-camel

activemq:[topic:]destinationName

 
 For JMS Messaging with Apache ActiveMQ 


 ActiveMQ Journal / activemq-core

activemq.journal:directory-on-filesystem

 
 Uses ActiveMQ's fast disk journaling implementation to store message bodies in a rolling log file 


 AMQP / camel-amqp

amqp:[topic:]destinationName

 
 For Messaging with AMQP protocol 


 Atom / camel-atom

atom:uri

 
 Working with Apache Abdera for atom integration, such as consuming an atom feed. 


 Bean / camel-core

bean:beanName[?method=someMethod]

 
 Uses the Bean Binding to bind message exchanges to beans in the Registry. Is also used for exposing and invoking POJO (Plain Old Java Objects). 


 Browse / camel-core

browse:someName

 
 Provdes a simple BrowsableEndpoint which can be useful for testing, visualisation tools or debugging. The exchanges sent to the endpoint are all available to be browsed. 


 Cache / camel-cache

cache://cachename[?options]

 
 The cache component facilitates creation of caching endpoints and processors using EHCache as the cache implementation. 


 Cometd / camel-cometd

cometd://host:port/channelname

 
 Used to deliver messages using the jetty cometd implementation of the bayeux protocol 


 CXF / camel-cxf

cxf:address[?serviceClass=...]

 
 Working with Apache CXF for web services integration 


 CXFRS / camel-cxf

cxfrs:address[?resourcesClasses=...]

 
 Working with Apache CXF for REST services integration 


 DataSet / camel-core

dataset:name

 
 For load  soak testing the DataSet provides a way to create huge numbers of messages for sending to Components or asserting that they are consumed correctly 


 Direct / camel-core

direct:name

 
 Synchronous call to another endpoint 


 Esper / camel-esper in camel-extra

esper:name

 
 Working with the Esper Library for Event Stream Processing 


 Event / camel-spring

event://default
spring-event://default

 
 Working with Spring ApplicationEvents 


 File / camel-core

file://nameOfFileOrDirectory

 
 Sending messages to a file or polling a file or directory. Camel 1.x use this link File. 


 Flatpack / camel-flatpack

flatpack:[fixed|delim]:configFile

 
 Processing fixed width or delimited files or messages using the FlatPack library 


 Freemarker / camel-freemarker

freemarker:someTemplateResource

 
 Generates a response using a Freemarker template 


 FTP / camel-ftp

ftp://host[:port]/fileName

 
 Sending and receiving files over FTP. Camel 1.x use this link FTP. 


 FTPS / camel-ftp

ftps://host[:port]/fileName

 
 Sending and receiving files over FTP Secure (TLS and SSL). 


GAuth / camel-gae

gauth://name[?options]


 Used by web applications to implement an OAuth consumer. See also Camel Components for Google App Engine.


GHttp / camel-gae

ghttp://hostname[:port][/path][?options]
ghttp:///path[?options]


 Provides connectivity to the URL fetch service of Google App Engine but can also be used to receive messages from servlets. See also Camel Components for Google App Engine.


GLogin / camel-gae

gauth://hostname[:port][?options]


 Used by Camel applications outside Google App Engine (GAE) for programmatic login to GAE applications. See also Camel Components for Google App Engine.


GTask / camel-gae

gtask://queue-name


 Supports asynchronous message processing on Google App Engine by using the task queueing service as message queue. See also Camel Components for Google App Engine.


GMail / camel-gae

gmail://u...@gmail.com[?options]
gmail://u...@googlemail.com[?options]


 Supports sending of emails via the mail service of Google App Engine. See also Camel Components for Google App Engine.


 HDFS / camel-hdfs in camel-hdfs

hdfs://path[?options]

 
 For reading/writing from/to an HDFS filesystem 


 Hibernate / camel-hibernate in camel-extra

hibernate://entityName

 
 For using a database as a queue via the Hibernate library 


 HL7 / camel-hl7

mina:tcp://hostname[:port]

 
 For working with the HL7 MLLP protocol and the HL7 model using the HAPI library 


 HTTP / camel-http

http://hostname[:port]

 
 For calling out to external HTTP servers 


 iBATIS / camel-ibatis

ibatis://sqlOperationName

 
 Performs a query, poll, insert, update or delete in a relational database using Apache iBATIS 


 IMap / camel-mail

imap://hostname[:port]

 
 Receiving email using IMap 


 IRC / camel-irc

irc:host[:port]/#room

 
 For IRC communication 


 JavaSpace / camel-javaspace

javaspace:jini://host?spaceName=mySpace?...

 
 Sending and receiving messages through JavaSpace 


 JBI / servicemix-camel

jbi:serviceName

 
 For JBI integration such as working with Apache ServiceMix 


 JCR / camel-jcr

jcr://user:passw...@repository/path/to/node

 
 Storing a message in a JCR (JSR-170) compliant repository like Apache Jackrabbit  


 JDBC / camel-jdbc


[CONF] Apache Camel Component List

2010-03-31 Thread confluence







 Component List
 Page edited by Ashwin Karpe

 
  
 
 

 Component / ArtifactId / URI 
 Description 


 ActiveMQ / activemq-camel


activemq:[topic:]destinationName

 
 For JMS Messaging with Apache ActiveMQ 


 ActiveMQ Journal / activemq-core


activemq.journal:directory-on-filesystem

 
 Uses ActiveMQ's fast disk journaling implementation to store message bodies in a rolling log file 


 AMQP / camel-amqp


amqp:[topic:]destinationName

 
 For Messaging with AMQP protocol 


 Atom / camel-atom


atom:uri

 
 Working with Apache Abdera for atom integration, such as consuming an atom feed. 


 Bean / camel-core


bean:beanName[?method=someMethod]

 
 Uses the Bean Binding to bind message exchanges to beans in the Registry. Is also used for exposing and invoking POJO (Plain Old Java Objects). 


 Browse / camel-core


browse:someName

 
 Provdes a simple BrowsableEndpoint which can be useful for testing, visualisation tools or debugging. The exchanges sent to the endpoint are all available to be browsed. 


 Cache / camel-cache


cache://cachename[?options]

 
 The cache component facilitates creation of caching endpoints and processors using EHCache as the cache implementation. 


 Cometd / camel-cometd


cometd://host:port/channelname

 
 Used to deliver messages using the jetty cometd implementation of the bayeux protocol 


 CXF / camel-cxf


cxf:address[?serviceClass=...]

 
 Working with Apache CXF for web services integration 


 CXFRS / camel-cxf


cxfrs:address[?resourcesClasses=...]

 
 Working with Apache CXF for REST services integration 


 DataSet / camel-core


dataset:name

 
 For load  soak testing the DataSet provides a way to create huge numbers of messages for sending to Components or asserting that they are consumed correctly 


 Direct / camel-core


direct:name

 
 Synchronous call to another endpoint 


 Esper / camel-esper in camel-extra


esper:name

 
 Working with the Esper Library for Event Stream Processing 


 Event / camel-spring


event://default
spring-event://default

 
 Working with Spring ApplicationEvents 


 File / camel-core


file://nameOfFileOrDirectory

 
 Sending messages to a file or polling a file or directory. Camel 1.x use this link File. 


 Flatpack / camel-flatpack


flatpack:[fixed|delim]:configFile

 
 Processing fixed width or delimited files or messages using the FlatPack library 


 Freemarker / camel-freemarker


freemarker:someTemplateResource

 
 Generates a response using a Freemarker template 


 FTP / camel-ftp


ftp://host[:port]/fileName

 
 Sending and receiving files over FTP. Camel 1.x use this link FTP. 


 FTPS / camel-ftp


ftps://host[:port]/fileName

 
 Sending and receiving files over FTP Secure (TLS and SSL). 


GAuth / camel-gae


gauth://name[?options]


 Used by web applications to implement an OAuth consumer. See also Camel Components for Google App Engine.


GHttp / camel-gae


ghttp://hostname[:port][/path][?options]
ghttp:///path[?options]


 Provides connectivity to the URL fetch service of Google App Engine but can also be used to receive messages from servlets. See also Camel Components for Google App Engine.


GLogin / camel-gae


gauth://hostname[:port][?options]


 Used by Camel applications outside Google App Engine (GAE) for programmatic login to GAE applications. See also Camel Components for Google App Engine.


GTask / camel-gae


gtask://queue-name


 Supports asynchronous message processing on Google App Engine by using the task queueing service as message queue. See also Camel Components for Google App Engine.


GMail / camel-gae


gmail://u...@gmail.com[?options]
gmail://u...@googlemail.com[?options]


 Supports sending of emails via the mail service of Google App Engine. See also Camel Components for Google App Engine.


 HDFS / camel-hdfs in camel-hdfs


hdfs://path[?options]

 
 For reading/writing from/to an HDFS filesystem 


 Hibernate / camel-hibernate in camel-extra


hibernate://entityName

 
 For using a database as a queue via the Hibernate library 


 HL7 / camel-hl7


mina:tcp://hostname[:port]

 
 For working with the HL7 MLLP protocol and the HL7 model using the HAPI library 


 HTTP / camel-http


http://hostname[:port]

 
 For calling out to external HTTP servers 


 iBATIS / camel-ibatis


ibatis://sqlOperationName

 
 Performs a query, poll, insert, update or delete in a relational database using Apache iBATIS 


 IMap / camel-mail


imap://hostname[:port]

 
 Receiving email using IMap 


 IRC / camel-irc


irc:host[:port]/#room

 
 For IRC communication 


 JavaSpace / camel-javaspace


javaspace:jini://host?spaceName=mySpace?...

 
 Sending and receiving messages through JavaSpace 


 JBI / servicemix-camel


jbi:serviceName

 
 For JBI integration such as working with Apache ServiceMix 


 JCR / camel-jcr


jcr://user:passw...@repository/path/to/node

 
 Storing a message in a JCR (JSR-170) compliant repository like Apache Jackrabbit  

[CONF] Apache Camel Netty

2010-03-31 Thread confluence







 Netty
 Page edited by Ashwin Karpe

 
  
 
 Netty Component

Available as of Camel 2.3

The netty component in Camel is a socket communication component, based on the JBoss Netty community offering (available under an Apache 2.0 license). Netty is a NIO client server framework which enables quick and easy development of network applications such as protocol servers and clients. Netty greatly simplifies and streamlines network programming such as TCP and UDP socket server.


This camel component supports both producer and consumer endpoints.

The netty component has several options and allows fine-grained control of a number of TCP/UDP communication parameters (buffer sizes, keepAlives, tcpNoDelay etc) and facilitates both In-Only and In-Out communication on a Camel route.

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


dependency
groupIdorg.apache.camel/groupId
artifactIdcamel-netty/artifactId
versionx.x.x/version
!-- use the same version as your Camel core version --
/dependency



URI format

The URI scheme for a netty component is as follows



netty:tcp://localhost:9[?options]
netty:udp://remotehost:9/[?options]



This component supports producer and consumer endpoints for both TCP and UDP.

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

Options



 Name 
 Default Value 
 Description 


 keepAlive 
 true 
 boolean setting to ensure socket is not closed due to inactivity 


 tcpNoDelay 
 true 
 boolean setting to improve TCP protocol performance 


 broadcast 
 false 
 boolean setting to choose Multicast over UDP 


 connectTimeoutMillis 
 10 seconds 
 time to wait for a socket connection to be available 


 receiveTimeoutMillis 
 10 seconds 
 time to wait for a response to be received on a connection 


 reuseAddress 
 true 
 boolean setting to facilitate socket multiplexing 


 sync 
 false 
 boolean setting to set endpoint as one-way or request-response 


 ssl 
 false 
 boolean setting to specify whether SSL encrytion is applied to this endpoint 


 sendBufferSize 
 65536 bytes 
 the TCP/UDP buffer sizes to be used during outbound communication 


 receiveBufferSize 
 65536 bytes 
 tthe TCP/UDP buffer sizes to be used during inbound communication 


 corePoolSize 
 10 threads 
 the number of allocated threads at component startup. Defaults to 10 


 maxPoolSize 
 100 threads 
  the maximum number of threads that may be allocated to this endpoint. Defaults to 100 



Registry based Options

Codec Handlers and SSL Keystores can be set via a JNDI Registry that is associated with the Camel Context. The values that could be passed in, are the following



 Name 
 Description 


 passphrase 
 password setting to use in order to encrypt/decrypt payloads sent using SSH 


 keyStoreFile 
 Client side certificate keystore to be used for encryption 


 trustStoreFile 
 Server side certificate keystore to be used for encryption 


 sslHandler 
 Reference to a class that could be used to return an SSL Handler 


 encoder 
 A custom Handler class that can be used to perform special marshalling of outbound payloads. Must override org.jboss.netty.channel.ChannelDownStreamHandler 


 decoder 
 A custom Handler class that can be used to perform special marshalling of inbound payloads. Must override org.jboss.netty.channel.ChannelUpStreamHandler 


 handler 
 A custom Handler class that can be used to perform custom processing of Netty events triggered during communication. Must override org.jboss.netty.channel.SimpleChannelHandler 



Sending Messages to/from a Netty endpoint

Netty Producer 
In Producer mode, the component provides the ability to send payloads to a socket endpoint using either TCP or UDP protocols (with optional SSL support). The producer mode supports both one-way and request-response based operations.

Netty Consumer
In Consumer mode, the component provides the ability to 

	listen on a specified socket using either TCP or UDP protocols (with optional SSL support),
	receive requests on the socket using text/xml, binary and serialized object based payloads and
	send them along on a route as message exchanges.



The consumer mode supports both one-way and request-response based operations.

Usage Samples

Example 1: A UDP based Netty consumer endpoint supporting Request-Reply communication and serialized Object payload


RouteBuilder builder = new RouteBuilder() {
  public void configure() {
from("netty:udp://localhost:5155?sync=true")
  .process(new Processor() {
 public void process(Exchange exchange) throws Exception {
   Poetry poetry = (Poetry) exchange.getIn().getBody();
   poetry.setPoet("Dr. Sarojini Naidu");
   exchange.getOut().setBody(poetry);
 }
   }
}
};



Example 2: A TCP based Netty consumer endpoint supporting One-way communication


RouteBuilder builder 

[CONF] Apache Camel Netty

2010-03-31 Thread confluence







 Netty
 Page edited by Ashwin Karpe

 
  
 
 Netty Component

Available as of Camel 2.3

The netty component in Camel is a socket communication component, based on the JBoss Netty community offering (available under an Apache 2.0 license). Netty is a NIO client server framework which enables quick and easy development of network applications such as protocol servers and clients. Netty greatly simplifies and streamlines network programming such as TCP and UDP socket server.


This camel component supports both producer and consumer endpoints.

The netty component has several options and allows fine-grained control of a number of TCP/UDP communication parameters (buffer sizes, keepAlives, tcpNoDelay etc) and facilitates both In-Only and In-Out communication on a Camel route.

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


dependency
groupIdorg.apache.camel/groupId
artifactIdcamel-netty/artifactId
versionx.x.x/version
!-- use the same version as your Camel core version --
/dependency



URI format

The URI scheme for a netty component is as follows



netty:tcp://localhost:9[?options]
netty:udp://remotehost:9/[?options]



This component supports producer and consumer endpoints for both TCP and UDP.

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

Options



 Name 
 Default Value 
 Description 


 keepAlive 
 true 
 boolean setting to ensure socket is not closed due to inactivity 


 tcpNoDelay 
 true 
 boolean setting to improve TCP protocol performance 


 broadcast 
 false 
 boolean setting to choose Multicast over UDP 


 connectTimeoutMillis 
 10 seconds 
 time to wait for a socket connection to be available 


 receiveTimeoutMillis 
 10 seconds 
 time to wait for a response to be received on a connection 


 reuseAddress 
 true 
 boolean setting to facilitate socket multiplexing 


 sync 
 false 
 boolean setting to set endpoint as one-way or request-response 


 ssl 
 false 
 boolean setting to specify whether SSL encrytion is applied to this endpoint 


 sendBufferSize 
 65536 bytes 
 the TCP/UDP buffer sizes to be used during outbound communication 


 receiveBufferSize 
 65536 bytes 
 tthe TCP/UDP buffer sizes to be used during inbound communication 


 corePoolSize 
 10 threads 
 the number of allocated threads at component startup. Defaults to 10 


 maxPoolSize 
 100 threads 
  the maximum number of threads that may be allocated to this endpoint. Defaults to 100 



Registry based Options

Codec Handlers and SSL Keystores can be set via a JNDI Registry that is associated with the Camel Context. The values that could be passed in, are the following



 Name 
 Description 


 passphrase 
 password setting to use in order to encrypt/decrypt payloads sent using SSH 


 keyStoreFile 
 Client side certificate keystore to be used for encryption 


 trustStoreFile 
 Server side certificate keystore to be used for encryption 


 sslHandler 
 Reference to a class that could be used to return an SSL Handler 


 encoder 
 A custom Handler class that can be used to perform special marshalling of outbound payloads. Must override org.jboss.netty.channel.ChannelDownStreamHandler 


 decoder 
 A custom Handler class that can be used to perform special marshalling of inbound payloads. Must override org.jboss.netty.channel.ChannelUpStreamHandler 


 handler 
 A custom Handler class that can be used to perform custom processing of Netty events triggered during communication. Must override org.jboss.netty.channel.SimpleChannelHandler 



Sending Messages to/from a Netty endpoint

Netty Producer 
In Producer mode, the component provides the ability to send payloads to a socket endpoint using either TCP or UDP protocols (with optional SSL support). The producer mode supports both one-way and request-response based operations.

Netty Consumer
In Consumer mode, the component provides the ability to 

	listen on a specified socket using either TCP or UDP protocols (with optional SSL support),
	receive requests on the socket using text/xml, binary and serialized object based payloads and
	send them along on a route as message exchanges.



The consumer mode supports both one-way and request-response based operations.

Usage Samples

Example 1: A UDP based Netty consumer endpoint supporting Request-Reply communication and serialized Object payload


RouteBuilder builder = new RouteBuilder() {
  public void configure() {
from("netty:udp://localhost:5155?sync=true")
  .process(new Processor() {
 public void process(Exchange exchange) throws Exception {
   Poetry poetry = (Poetry) exchange.getIn().getBody();
   poetry.setPoet("Dr. Sarojini Naidu");
   exchange.getOut().setBody(poetry);
 }
   }
}
};



Example 2: A TCP based Netty consumer endpoint supporting One-way communication


RouteBuilder builder 

[CONF] Apache Camel Component List

2010-03-31 Thread confluence







 Component List
 Page edited by Ashwin Karpe

 
  
 
 

 Component / ArtifactId / URI 
 Description 


 ActiveMQ / activemq-camel


activemq:[topic:]destinationName

 
 For JMS Messaging with Apache ActiveMQ 


 ActiveMQ Journal / activemq-core


activemq.journal:directory-on-filesystem

 
 Uses ActiveMQ's fast disk journaling implementation to store message bodies in a rolling log file 


 AMQP / camel-amqp


amqp:[topic:]destinationName

 
 For Messaging with AMQP protocol 


 Atom / camel-atom


atom:uri

 
 Working with Apache Abdera for atom integration, such as consuming an atom feed. 


 Bean / camel-core


bean:beanName[?method=someMethod]

 
 Uses the Bean Binding to bind message exchanges to beans in the Registry. Is also used for exposing and invoking POJO (Plain Old Java Objects). 


 Browse / camel-core


browse:someName

 
 Provides a simple BrowsableEndpoint which can be useful for testing, visualisation tools or debugging. The exchanges sent to the endpoint are all available to be browsed. 


 Cache / camel-cache


cache://cachename[?options]

 
 The cache component facilitates creation of caching endpoints and processors using EHCache as the cache implementation. 


 Cometd / camel-cometd


cometd://host:port/channelname

 
 Used to deliver messages using the jetty cometd implementation of the bayeux protocol 


 CXF / camel-cxf


cxf:address[?serviceClass=...]

 
 Working with Apache CXF for web services integration 


 CXFRS / camel-cxf


cxfrs:address[?resourcesClasses=...]

 
 Working with Apache CXF for REST services integration 


 DataSet / camel-core


dataset:name

 
 For load  soak testing the DataSet provides a way to create huge numbers of messages for sending to Components or asserting that they are consumed correctly 


 Direct / camel-core


direct:name

 
 Synchronous call to another endpoint 


 Esper / camel-esper in camel-extra


esper:name

 
 Working with the Esper Library for Event Stream Processing 


 Event / camel-spring


event://default
spring-event://default

 
 Working with Spring ApplicationEvents 


 File / camel-core


file://nameOfFileOrDirectory

 
 Sending messages to a file or polling a file or directory. Camel 1.x use this link File. 


 Flatpack / camel-flatpack


flatpack:[fixed|delim]:configFile

 
 Processing fixed width or delimited files or messages using the FlatPack library 


 Freemarker / camel-freemarker


freemarker:someTemplateResource

 
 Generates a response using a Freemarker template 


 FTP / camel-ftp


ftp://host[:port]/fileName

 
 Sending and receiving files over FTP. Camel 1.x use this link FTP. 


 FTPS / camel-ftp


ftps://host[:port]/fileName

 
 Sending and receiving files over FTP Secure (TLS and SSL). 


GAuth / camel-gae


gauth://name[?options]


 Used by web applications to implement an OAuth consumer. See also Camel Components for Google App Engine.


GHttp / camel-gae


ghttp://hostname[:port][/path][?options]
ghttp:///path[?options]


 Provides connectivity to the URL fetch service of Google App Engine but can also be used to receive messages from servlets. See also Camel Components for Google App Engine.


GLogin / camel-gae


gauth://hostname[:port][?options]


 Used by Camel applications outside Google App Engine (GAE) for programmatic login to GAE applications. See also Camel Components for Google App Engine.


GTask / camel-gae


gtask://queue-name


 Supports asynchronous message processing on Google App Engine by using the task queueing service as message queue. See also Camel Components for Google App Engine.


GMail / camel-gae


gmail://u...@gmail.com[?options]
gmail://u...@googlemail.com[?options]


 Supports sending of emails via the mail service of Google App Engine. See also Camel Components for Google App Engine.


 HDFS / camel-hdfs in camel-hdfs


hdfs://path[?options]

 
 For reading/writing from/to an HDFS filesystem 


 Hibernate / camel-hibernate in camel-extra


hibernate://entityName

 
 For using a database as a queue via the Hibernate library 


 HL7 / camel-hl7


mina:tcp://hostname[:port]

 
 For working with the HL7 MLLP protocol and the HL7 model using the HAPI library 


 HTTP / camel-http


http://hostname[:port]

 
 For calling out to external HTTP servers 


 iBATIS / camel-ibatis


ibatis://sqlOperationName

 
 Performs a query, poll, insert, update or delete in a relational database using Apache iBATIS 


 IMap / camel-mail


imap://hostname[:port]

 
 Receiving email using IMap 


 IRC / camel-irc


irc:host[:port]/#room

 
 For IRC communication 


 JavaSpace / camel-javaspace


javaspace:jini://host?spaceName=mySpace?...

 
 Sending and receiving messages through JavaSpace 


 JBI / servicemix-camel


jbi:serviceName

 
 For JBI integration such as working with Apache ServiceMix 


 JCR / camel-jcr


jcr://user:passw...@repository/path/to/node

 
 Storing a message in a JCR (JSR-170) compliant repository like Apache Jackrabbit 

[CONF] Apache Camel MINA

2010-03-31 Thread confluence







 MINA
 Page edited by Ashwin Karpe

 
  
 
 MINA Component

The mina: component is a transport for working with Apache MINA

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


dependency
groupIdorg.apache.camel/groupId
artifactIdcamel-mina/artifactId
versionx.x.x/version
!-- use the same version as your Camel core version --
/dependency



URI format



mina:tcp://hostname[:port][?options]
mina:udp://hostname[:port][?options]
mina:multicast://hostname[:port][?options]
mina:vm://hostname[:port][?options]


From Camel 1.3 onwards 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/Multicast if no codec is specified the default uses a basic ByteBuffer based codec.

Multicast also has a shorthand notation mcast.

The VM protocol is used as a direct forwarding mechanism in the same JVM. See the MINA VM-Pipe API documentation for details.

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 contentmessage 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=valueoption=value...

Options



 Option
 Default Value 
 Description 


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


 codec 
 null 
 Camel 2.0: You must use the  notation to look up your codec in the Registry. For example, use #myCodec to look up a bean with the id value, myCodec. 


 disconnect 
 false 
 Camel 2.3: 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 in 1.3 or later to indicate a text line based codec; if not specified or the value is false, then Object Serialization is assumed over TCP. 


 textlineDelimiter 
 DEFAULT 
 Camel 1.6.0/2.0 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 
 false/true 
 As of 1.3, you can configure the exchange pattern to be either InOnly (default) or InOut. Setting sync=true means a synchronous exchange (InOut), where the client can read the response from MINA (the exchange Out message). The default value has changed in Camel 1.5 to true. In older releases, the default value is false. 


 lazySessionCreation 
 See description 
 As of 1.3, sessions can be lazily created to avoid exceptions, if the remote server is not up and running when the Camel producer is started. From Camel 2.0 onwards, the default is true. In Camel 1.x, the default is false. 


 timeout 
 3 
 As of 1.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 
 As of 1.3, 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. As of 1.3, 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 
 As of 1.3, you can enable the Apache MINA logging filter. Apache MINA uses slf4j logging at INFO level to log all input and output. 


 filters 
 null 
 As of 2.0, you can set a list of Mina IoFilters to register. The filters value must be one of the following: 

	Camel 2.2: comma-separated list of bean references (e.g. #filterBean1,#filterBean2) where each bean must be of type org.apache.mina.common.IoFilter.
	Camel 2.0: a reference to a bean of type Listorg.apache.mina.common.IoFilter.




 encoderMaxLineLength 
 -1 
 As of 2.1, you can set the textline protocol encoder max line length. By default the default value of Mina itself is used which are Integer.MAX_VALUE. 


 decorderMaxLineLength 
 -1 
 As of 2.1, you can set the textline protocol decoder max line length. By default the default value of Mina itself 

[CONF] Apache Camel Netty

2010-03-31 Thread confluence







 Netty
 Page edited by Ashwin Karpe

 
  
 
 Netty Component

Available as of Camel 2.3

The netty component in Camel is a socket communication component, based on the JBoss Netty community offering (available under an Apache 2.0 license). Netty is a NIO client server framework which enables quick and easy development of network applications such as protocol servers and clients. Netty greatly simplifies and streamlines network programming such as TCP and UDP socket server.


This camel component supports both producer and consumer endpoints.

The netty component has several options and allows fine-grained control of a number of TCP/UDP communication parameters (buffer sizes, keepAlives, tcpNoDelay etc) and facilitates both In-Only and In-Out communication on a Camel route.

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


dependency
groupIdorg.apache.camel/groupId
artifactIdcamel-netty/artifactId
versionx.x.x/version
!-- use the same version as your Camel core version --
/dependency



URI format

The URI scheme for a netty component is as follows



netty:tcp://localhost:9[?options]
netty:udp://remotehost:9/[?options]



This component supports producer and consumer endpoints for both TCP and UDP.

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

Options



 Name 
 Default Value 
 Description 


 keepAlive 
 true 
 boolean setting to ensure socket is not closed due to inactivity 


 tcpNoDelay 
 true 
 boolean setting to improve TCP protocol performance 


 broadcast 
 false 
 boolean setting to choose Multicast over UDP 


 connectTimeoutMillis 
 10 seconds 
 time to wait for a socket connection to be available 


 receiveTimeoutMillis 
 10 seconds 
 time to wait for a response to be received on a connection 


 reuseAddress 
 true 
 boolean setting to facilitate socket multiplexing 


 sync 
 false 
 boolean setting to set endpoint as one-way or request-response 


 ssl 
 false 
 boolean setting to specify whether SSL encrytion is applied to this endpoint 


 sendBufferSize 
 65536 bytes 
 the TCP/UDP buffer sizes to be used during outbound communication 


 receiveBufferSize 
 65536 bytes 
 tthe TCP/UDP buffer sizes to be used during inbound communication 


 corePoolSize 
 10 threads 
 the number of allocated threads at component startup. Defaults to 10 


 maxPoolSize 
 100 threads 
  the maximum number of threads that may be allocated to this endpoint. Defaults to 100 



Registry based Options

Codec Handlers and SSL Keystores can be set via a JNDI Registry that is associated with the Camel Context. The values that could be passed in, are the following



 Name 
 Description 


 passphrase 
 password setting to use in order to encrypt/decrypt payloads sent using SSH 


 keyStoreFile 
 Client side certificate keystore to be used for encryption 


 trustStoreFile 
 Server side certificate keystore to be used for encryption 


 sslHandler 
 Reference to a class that could be used to return an SSL Handler 


 encoder 
 A custom Handler class that can be used to perform special marshalling of outbound payloads. Must override org.jboss.netty.channel.ChannelDownStreamHandler 


 decoder 
 A custom Handler class that can be used to perform special marshalling of inbound payloads. Must override org.jboss.netty.channel.ChannelUpStreamHandler 


 handler 
 A custom Handler class that can be used to perform custom processing of Netty events triggered during communication. Must override org.jboss.netty.channel.SimpleChannelHandler 



Sending Messages to/from a Netty endpoint

Netty Producer 
In Producer mode, the component provides the ability to send payloads to a socket endpoint using either TCP or UDP protocols (with optional SSL support). The producer mode supports both one-way and request-response based operations.

Netty Consumer
In Consumer mode, the component provides the ability to 

	listen on a specified socket using either TCP or UDP protocols (with optional SSL support),
	receive requests on the socket using text/xml, binary and serialized object based payloads and
	send them along on a route as message exchanges.



The consumer mode supports both one-way and request-response based operations.

Usage Samples

Example 1: A UDP based Netty consumer endpoint supporting Request-Reply communication and serialized Object payload


RouteBuilder builder = new RouteBuilder() {
  public void configure() {
from("netty:udp://localhost:5155?sync=true")
  .process(new Processor() {
 public void process(Exchange exchange) throws Exception {
   Poetry poetry = (Poetry) exchange.getIn().getBody();
   poetry.setPoet("Dr. Sarojini Naidu");
   exchange.getOut().setBody(poetry);
 }
   }
}
};



Example 2: A TCP based Netty consumer endpoint supporting One-way communication


RouteBuilder builder 

[CONF] Apache Camel Netty

2010-03-31 Thread confluence







 Netty
 Page edited by Ashwin Karpe

 
  
 
 Netty Component

Available as of Camel 2.3

The netty component in Camel is a socket communication component, based 
on the JBoss Netty community offering (available under an Apache 2.0 license). 
Netty is a NIO client server framework which enables quick and easy development 
of network applications such as protocol servers and clients. Netty greatly 
simplifies and streamlines network programming such as TCP and UDP socket server.


This camel component supports both producer and consumer endpoints.

The netty component has several options and allows fine-grained control of a 
number of TCP/UDP communication parameters (buffer sizes, keepAlives, tcpNoDelay 
etc) and facilitates both In-Only and In-Out communication on a Camel route.

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


dependency
groupIdorg.apache.camel/groupId
artifactIdcamel-netty/artifactId
versionx.x.x/version
!-- use the same version as your Camel core version --
/dependency



URI format

The URI scheme for a netty component is as follows



netty:tcp://localhost:9[?options]
netty:udp://remotehost:9/[?options]



This component supports producer and consumer endpoints for both TCP and UDP.

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

Options



 Name 
 Default Value 
 Description 


 keepAlive 
 true 
 boolean setting to ensure socket is not closed due 
to inactivity 


 tcpNoDelay 
 true 
 boolean setting to improve TCP protocol performance 


 broadcast 
 false 
 boolean setting to choose Multicast over UDP 


 connectTimeoutMillis 
 10 seconds 
 time to wait for a socket connection 
to be available 


 receiveTimeoutMillis 
 10 seconds 
 time to wait for a response to be 
received on a connection 


 reuseAddress 
 true 
 boolean setting to facilitate socket multiplexing 


 sync 
 false 
 boolean setting to set endpoint as one-way or request-response 


 ssl 
 false 
 boolean setting to specify whether SSL encryption is applied 
to this endpoint 


 sendBufferSize 
 65536 bytes 
 the TCP/UDP buffer sizes to be used during outbound communication 


 receiveBufferSize 
 65536 bytes 
 tthe TCP/UDP buffer sizes to be used during inbound communication 


 corePoolSize 
 10 threads 
 the number of allocated threads at component startup. 
Defaults to 10 


 maxPoolSize 
 100 threads 
  the maximum number of threads that may be allocated to 
this endpoint. Defaults to 100 



Registry based Options

Codec Handlers and SSL Keystores can be set via a JNDI Registry that is associated 
with the Camel Context. The values that could be passed in, are the following



 Name 
 Description 


 passphrase 
 password setting to use in order to encrypt/decrypt payloads sent using SSH 


 keyStoreFile 
 Client side certificate keystore to be used for encryption 


 trustStoreFile 
 Server side certificate keystore to be used for encryption 


 sslHandler 
 Reference to a class that could be used to return an SSL Handler 


 encoder 
 A custom Handler class that can be used to perform special marshalling 
of outbound payloads. Must override org.jboss.netty.channel.ChannelDownStreamHandler 


 decoder 
 A custom Handler class that can be used to perform special marshalling 
of inbound payloads. Must override org.jboss.netty.channel.ChannelUpStreamHandler 


 handler 
 A custom Handler class that can be used to perform custom processing 
of Netty events triggered during communication. 
Must override org.jboss.netty.channel.SimpleChannelHandler 



Sending Messages to/from a Netty endpoint

Netty Producer 
In Producer mode, the component provides the ability to send payloads 
to a socket endpoint using either TCP or UDP protocols (with optional SSL support). 
The producer mode supports both one-way and request-response based operations.

Netty Consumer
In Consumer mode, the component provides the ability to 

	listen on a specified socket using either TCP or UDP protocols (with optional SSL support),
	receive requests on the socket using text/xml, binary and serialized object based payloads and
	send them along on a route as message exchanges.



The consumer mode supports both one-way and request-response based operations.

Usage Samples

A UDP Netty endpoint supporting Request-Reply and serialized object payload


RouteBuilder builder = new RouteBuilder() {
  public void configure() {
from("netty:udp://localhost:5155?sync=true")
  .process(new Processor() {
 public void process(Exchange exchange) throws Exception {
   Poetry poetry = (Poetry) exchange.getIn().getBody();
   poetry.setPoet("Dr. Sarojini Naidu");
   exchange.getOut().setBody(poetry);
 }
   }
}
};



A TCP based Netty consumer endpoint supporting One-way communication


RouteBuilder builder = new RouteBuilder() {
  

[CONF] Apache Camel Netty

2010-03-31 Thread confluence







 Netty
 Page edited by Ashwin Karpe

 
  
 
 Netty Component

Available as of Camel 2.3

The netty component in Camel is a socket communication component, based 
on the JBoss Netty community offering (available under an Apache 2.0 license). 
Netty is a NIO client server framework which enables quick and easy development 
of network applications such as protocol servers and clients. Netty greatly 
simplifies and streamlines network programming such as TCP and UDP socket server.


This camel component supports both producer and consumer endpoints.

The netty component has several options and allows fine-grained control of a 
number of TCP/UDP communication parameters (buffer sizes, keepAlives, tcpNoDelay 
etc) and facilitates both In-Only and In-Out communication on a Camel route.

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


dependency
groupIdorg.apache.camel/groupId
artifactIdcamel-netty/artifactId
versionx.x.x/version
!-- use the same version as your Camel core version --
/dependency



URI format

The URI scheme for a netty component is as follows



netty:tcp://localhost:9[?options]
netty:udp://remotehost:9/[?options]



This component supports producer and consumer endpoints for both TCP and UDP.

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

Options



 Name 
 Default Value 
 Description 


 keepAlive 
 true 
 boolean setting to ensure socket is not closed due 
to inactivity 


 tcpNoDelay 
 true 
 boolean setting to improve TCP protocol performance 


 broadcast 
 false 
 boolean setting to choose Multicast over UDP 


 connectTimeoutMillis 
 10 seconds 
 time to wait for a socket connection 
to be available 


 receiveTimeoutMillis 
 10 seconds 
 time to wait for a response to be 
received on a connection 


 reuseAddress 
 true 
 boolean setting to facilitate socket multiplexing 


 sync 
 false 
 boolean setting to set endpoint as one-way or request-response 


 ssl 
 false 
 boolean setting to specify whether SSL encryption is applied 
to this endpoint 


 sendBufferSize 
 65536 bytes 
 the TCP/UDP buffer sizes to be used during outbound communication 


 receiveBufferSize 
 65536 bytes 
 tthe TCP/UDP buffer sizes to be used during inbound communication 


 corePoolSize 
 10 threads 
 the number of allocated threads at component startup. 
Defaults to 10 


 maxPoolSize 
 100 threads 
  the maximum number of threads that may be allocated to 
this endpoint. Defaults to 100 



Registry based Options

Codec Handlers and SSL Keystores can be set via a JNDI Registry that is associated 
with the Camel Context. The values that could be passed in, are the following



 Name 
 Description 


 passphrase 
 password setting to use in order to encrypt/decrypt payloads sent using SSH 


 keyStoreFile 
 Client side certificate keystore to be used for encryption 


 trustStoreFile 
 Server side certificate keystore to be used for encryption 


 sslHandler 
 Reference to a class that could be used to return an SSL Handler 


 encoder 
 A custom Handler class that can be used to perform special marshalling 
of outbound payloads. Must override org.jboss.netty.channel.ChannelDownStreamHandler 


 decoder 
 A custom Handler class that can be used to perform special marshalling 
of inbound payloads. Must override org.jboss.netty.channel.ChannelUpStreamHandler 


 handler 
 A custom Handler class that can be used to perform custom processing 
of Netty events triggered during communication. 
Must override org.jboss.netty.channel.SimpleChannelHandler 



Sending Messages to/from a Netty endpoint

Netty Producer 
In Producer mode, the component provides the ability to send payloads 
to a socket endpoint using either TCP or UDP protocols (with optional SSL support). 
The producer mode supports both one-way and request-response based operations.

Netty Consumer
In Consumer mode, the component provides the ability to 

	listen on a specified socket using either TCP or UDP protocols (with optional SSL support),
	receive requests on the socket using text/xml, binary and serialized object based payloads and
	send them along on a route as message exchanges.



The consumer mode supports both one-way and request-response based operations.

Usage Samples

A UDP Netty endpoint using Request-Reply and serialized object payload


RouteBuilder builder = new RouteBuilder() {
  public void configure() {
from("netty:udp://localhost:5155?sync=true")
  .process(new Processor() {
 public void process(Exchange exchange) throws Exception {
   Poetry poetry = (Poetry) exchange.getIn().getBody();
   poetry.setPoet("Dr. Sarojini Naidu");
   exchange.getOut().setBody(poetry);
 }
   }
}
};



A TCP based Netty consumer endpoint using One-way communication


RouteBuilder builder = new RouteBuilder() {
  public void 

[CONF] Apache Camel Netty

2010-03-31 Thread confluence







 Netty
 Page edited by Ashwin Karpe

 
  
 
 Netty Component

Available as of Camel 2.3

The netty component in Camel is a socket communication component, based 
on the JBoss Netty community offering (available under an Apache 2.0 license). 
Netty is a NIO client server framework which enables quick and easy development 
of network applications such as protocol servers and clients. Netty greatly 
simplifies and streamlines network programming such as TCP and UDP socket server.


This camel component supports both producer and consumer endpoints.

The netty component has several options and allows fine-grained control of a 
number of TCP/UDP communication parameters (buffer sizes, keepAlives, tcpNoDelay 
etc) and facilitates both In-Only and In-Out communication on a Camel route.

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


dependency
groupIdorg.apache.camel/groupId
artifactIdcamel-netty/artifactId
versionx.x.x/version
!-- use the same version as your Camel core version --
/dependency



URI format

The URI scheme for a netty component is as follows



netty:tcp://localhost:9[?options]
netty:udp://remotehost:9/[?options]



This component supports producer and consumer endpoints for both TCP and UDP.

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

Options



 Name 
 Default Value 
 Description 


 keepAlive 
 true 
 boolean setting to ensure socket is not closed due 
to inactivity 


 tcpNoDelay 
 true 
 boolean setting to improve TCP protocol performance 


 broadcast 
 false 
 boolean setting to choose Multicast over UDP 


 connectTimeoutMillis 
 10 seconds 
 time to wait for a socket connection 
to be available 


 receiveTimeoutMillis 
 10 seconds 
 time to wait for a response to be 
received on a connection 


 reuseAddress 
 true 
 boolean setting to facilitate socket multiplexing 


 sync 
 false 
 boolean setting to set endpoint as one-way or request-response 


 ssl 
 false 
 boolean setting to specify whether SSL encryption is applied 
to this endpoint 


 sendBufferSize 
 65536 bytes 
 the TCP/UDP buffer sizes to be used during outbound communication 


 receiveBufferSize 
 65536 bytes 
 tthe TCP/UDP buffer sizes to be used during inbound communication 


 corePoolSize 
 10 threads 
 the number of allocated threads at component startup. 
Defaults to 10 


 maxPoolSize 
 100 threads 
  the maximum number of threads that may be allocated to 
this endpoint. Defaults to 100 



Registry based Options

Codec Handlers and SSL Keystores can be set via a JNDI Registry that is associated 
with the Camel Context. The values that could be passed in, are the following



 Name 
 Description 


 passphrase 
 password setting to use in order to encrypt/decrypt payloads sent using SSH 


 keyStoreFile 
 Client side certificate keystore to be used for encryption 


 trustStoreFile 
 Server side certificate keystore to be used for encryption 


 sslHandler 
 Reference to a class that could be used to return an SSL Handler 


 encoder 
 A custom Handler class that can be used to perform special marshalling 
of outbound payloads. Must override org.jboss.netty.channel.ChannelDownStreamHandler 


 decoder 
 A custom Handler class that can be used to perform special marshalling 
of inbound payloads. Must override org.jboss.netty.channel.ChannelUpStreamHandler 


 handler 
 A custom Handler class that can be used to perform custom processing 
of Netty events triggered during communication. 
Must override org.jboss.netty.channel.SimpleChannelHandler 



Sending Messages to/from a Netty endpoint

Netty Producer 
In Producer mode, the component provides the ability to send payloads 
to a socket endpoint using either TCP or UDP protocols (with optional SSL support). 
The producer mode supports both one-way and request-response based operations.

Netty Consumer
In Consumer mode, the component provides the ability to 

	listen on a specified socket using either TCP or UDP protocols (with optional SSL support),
	receive requests on the socket using text/xml, binary and serialized object based payloads and
	send them along on a route as message exchanges.



The consumer mode supports both one-way and request-response based operations.

Usage Samples

A UDP Netty endpoint using Request-Reply and serialized object payload


RouteBuilder builder = new RouteBuilder() {
  public void configure() {
from("netty:udp://localhost:5155?sync=true")
  .process(new Processor() {
 public void process(Exchange exchange) throws Exception {
   Poetry poetry = (Poetry) exchange.getIn().getBody();
   poetry.setPoet("Dr. Sarojini Naidu");
   exchange.getOut().setBody(poetry);
 }
   }
}
};



A TCP based Netty consumer endpoint using One-way communication


RouteBuilder builder = new RouteBuilder() {
  public void