Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
java
java
    public String handleOrder(String payload) {
        ...
        return "Order: OK"
   }

Configuring Mina endpoints using Spring bean style

Avaiable as of Camel 2.0

Configuration of Mina endpoints is now possible using regular Spring bean style configuration in the Spring DSL.

However configuring Apache Mina itself is quite complex to setup the acceptor, connector as you can not use simple setters. To resolve this we will leverage the MinaComponent as a Spring factory bean to configure this for us. If you really need to configure this yourself there are setters on the MinaEndpoint to set these when needed.

The sample below shows the factory approach:

Wiki Markup
{snippet:id=e1|lang=xml|url=camel/trunk/components/camel-mina/src/test/resources/org/apache/camel/component/mina/SpringMinaEndpointTest-context.xml}

And then we can refer to our endpoint directly in the route such as:

Wiki Markup
{snippet:id=e2|lang=xml|url=camel/trunk/components/camel-mina/src/test/resources/org/apache/camel/component/mina/SpringMinaEndpointTest-context.xml}
Include Page
CAMEL:Endpoint See Also
CAMEL:Endpoint See Also