Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
{scrollbar}

On this page, we are going to

Excerpt

provide a brief description for the page to appear in the list of tutorial pages

.

Section

More detailed information about section

...

We have learned about using Camel to do routing inside ServiceMix, but is also possible

Excerpt

use Apache Camel's optional components inside ServiceMix

to provide even more possibilities than those offered by the standard JBI components.

Using MINA for plain TCP communication

ServiceMix itself doesn't have a JBI component to do plain TCP communications, but Camel does have an Apache MINA component that allows you to do this. This component is available as a separate JAR file, so we will have to first add it to our SU. Afterwards, we can just start using it in our routes.

Adding a dependency

To be able to use camel-mina, we will specify if as a <dependency/> in our tutorial-camel-su's pom.xml file:

Code Block
xml
xml

<?xml version="1.0" encoding="UTF-8"?>
<project>
  <parent>
    <artifactId>parent</artifactId>
    <groupId>org.apache.servicemix.tutorial.camel</groupId>
    <version>1.0-SNAPSHOT</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.apache.servicemix.tutorial.camel</groupId>
  <artifactId>tutorial-camel-su</artifactId>
  ...
  <dependencies>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-mina</artifactId>
      <version>${camel-version}</version>
    </dependency>
    ...
 </dependencies>
  ...
</project>

Coding the new routes

Let's look at the necessary modifications to our RouteBuilder implementation:

Code Block

Now, we will just tell the user what to expect from the next tutorial page

...