Console ExamplePage edited by Claus IbsenChanges (2)
Full ContentConsole ExampleAvailable as of Camel 2.10 This example is located in the Camel distribution at examples/camel-example-console. This is a beginner example that demonstrates how to get started with Apache Camel. In this example we integrate with the console using the Stream component. The example is an interactive example that reads input from the console, and then transforms the input to upper case and print it back on the console. This is implemented in a Camel route, in a Spring XML file as shown below. <!-- camelContext is the Camel runtime, where we can host Camel routes --> <camelContext xmlns="http://camel.apache.org/schema/spring"> <route> <!-- read input from the console using the stream component --> <from uri="stream:in?promptMessage=Enter something: "/> <!-- transform the input to upper case using the simple language --> <!-- you can also use other languages such as groovy, ognl, mvel, _javascript_ etc. --> <transform> <simple>${body.toUpperCase()}</simple> </transform> <!-- and then print to the console --> <to uri="stream:out"/> </route> </camelContext>
Change Notification Preferences
View Online
|
View Changes
|
Add Comment
|
- [CONF] Apache Camel > Console Example confluence
- [CONF] Apache Camel > Console Example confluence
- [CONF] Apache Camel > Console Example confluence
- [CONF] Apache Camel > Console Example confluence