Versions Compared

Key

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

...

Code Block
languagejava
XPathBuilder xpath = new XPathBuilder("/rdf:RDF/rdf:Description/rdf:type[@rdf:resource='http://fedora.info/definitions/v4/rest-api#indexable']")
xpath.namespace("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#")


from("activemq:topic:fedora")
  .to("fcrepo:localhost:8080/fedora/rest")
  .filter(xpath)
  .to("fcrepo:localhost:8080/fedora/rest?accept=application/json&transform=default")
  .to("http4:localhost:8080/solr/core/update");

...

Code Block
languagescala
val xpath = new XPathBuilder("/rdf:RDF/rdf:Description/rdf:type[@rdf:resource='http://fedora.info/definitions/v4/rest-api#indexable']")
xpath.namespace("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#")
 
"activemq:topic:fedora" ==> {
    to("fcrepo:localhost:8080/fedora/rest")
    filter(xpath) {
        to("fcrepo:localhost:8080/fedora/rest?accept=application/json&transform=default")
        to("http4:localhost:8080/solr/core/update")
    }
}

...

Camel routes can be deployed in any JVM container. In order to deploy to Jetty or Tomcat, the route must be built as a WAR file. This command will get you started:

...

Code Block
languagebash
$> mvn archetype:generate \

...


  

...

-DarchetypeGroupId=org.apache.camel.archetypes \

...


  

...

-DarchetypeArtifactId=camel-archetype-war \

...


 

...

 -DarchetypeVersion=2.14.0 \

...


 

...

 -DgroupId=org.example.camel \

...


  

...

-DartifactId=my-camel-route \

...


  

...

-Dversion=1.0.0-SNAPSHOT \

...


 

...

 

...

-Dpackage=org.example.camel

After the project has been built (mvn install), you will find the WAR file in ./target. That file can simply be copied to the webapps directory of your Jetty/Tomcat server.

...

  1. downloading Karaf from an apache.org mirror
  2. running ./bin/karaf to enter the shell
  3. installing required services:

    Code Block
    languagebash
    $> feature:repo-add camel 2.14.0

    
    $> feature:repo-add activemq 5.10.0

    
    $> feature:install camel

    
    $> feature:install activemq-camel

    
    
    # display available camel features

    
    $> feature:list | grep camel

    
    
    # install camel features, as needed

    
    $> feature:install camel-http4
  4. setting up a service wrapper (so that karaf is always running)

    Code Block
    $> feature:install wrapper

    
    $> wrapper:install
  5. following the directions provided by this command

...