...
Code Block | ||
---|---|---|
| ||
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 | ||
---|---|---|
| ||
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 | ||
---|---|---|
| ||
$> 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.
...
- downloading Karaf from an apache.org mirror
- running ./bin/karaf to enter the shell
installing required services:
Code Block language bash $> 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
setting up a service wrapper (so that karaf is always running)
Code Block $> feature:install wrapper
$> wrapper:install
- following the directions provided by this command
...