LibraryLink ToToggle FramesPrintFeedback

Chapter 25. JCR

The jcr: component allows you to add nodes to a JCR (JSR-170) compliant content repository (e.g. Apache Jackrabbit).

jcr://user:password@repository/path/to/node

The repository element of the URI is used to look up the JCR Repository object in the Camel context registry.

If a message is sent to a producer endpoint created by this component:

All message properties are converted to node properties, except for the CamelJcrNodeName (you can refer to JcrConstants.NODE_NAME in your code), which is used to determine the node name.

The snippet below will create a node named node under the /home/test node in the content repository. One additional attribute will be added to the node as well: my.contents.property will contain the body of the message being sent.

from("direct:a").setProperty(JcrConstants.JCR_NODE_NAME, constant("node"))
    .setProperty("my.contents.property", body()).to("jcr://user:pass@repository/home/test");