1

I am trying to search for tika example with camel using spring DSL.

I see the tika connector is available but got no example using spring DSL. I looked all the places including https://github.com/apache/camel/tree/master/examples#examples link but no luck so far.

Can any body please help me on it.

Nicomedes E.
  • 1,326
  • 5
  • 18
  • 27

1 Answers1

0

There's a simple unit test at the official repo that may be used as example, IMHO:

https://github.com/apache/camel/blob/master/components/camel-tika/src/test/java/org/apache/camel/component/tika/TikaDetectTest.java

Take a look at the others unit tests also.

We could transport the route at the aforementioned test to Spring DSL like this:

<?xml version="1.0" encoding="UTF-8"?>
<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.xsd
        http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">

    <camelContext id="tikaCamelContext" xmlns="http://camel.apache.org/schema/spring">
        <route>
            <from uri="direct:start"/>
            <to uri="tika:detect"/>
            <to uri="mock:result"/>
        </route>
    </camelContext>
</beans>

Don't forget to add the component to the pom.xml file:

<dependency>
  <groupId>org.apache.camel</groupId>
  <artifactId>camel-tika</artifactId>
  <version>${camel-version}</version>
</dependency>

Is this what you are looking for?

Ricardo Zanini
  • 1,041
  • 7
  • 12