JSR-170 message store
derek.adams Apr 10, 2007 4:46 PMThere have been a few posts about implementing a JSR-170 (aka JCR) message store as an alternative to the default database implementation. I wrote a simple implementation using the Apache Jackrabbit libraries as a base. The new implementation has been checked into the SVN trunk and is available for testing. The required libraries and configuration files are now packaged as part of the jbossesb.sar.
To enable the JCR message store, add the following property to the "core" section of jbossesb-properties.xml in the root of the jboss-esb.sar:
<property name="org.jboss.soa.esb.persistence.base.plugin.jcr" value="org.jboss.internal.soa.esb.persistence.format.jcr.JCRMessageStorePlugin"/>
This adds the JCR plugin to the MessageStoreFactory plugins list. The JCR message store can use an existing repository via JNDI or can create a standalone instance locally on the app server. The following list of properties should be added in the "dbstore" section of jbossesb-properties.xml to configure repository access:
<property name="org.jboss.soa.esb.persistence.jcr.jndi.path" value="jcr"/> <property name="org.jboss.soa.esb.persistence.jcr.username" value="username"/> <property name="org.jboss.soa.esb.persistence.jcr.password" value="password"/> <property name="org.jboss.soa.esb.persistence.jcr.root.node.path" value="JBossESB/MessageStore"/>
jcr.jndi.path - optional path in JNDI where the repository is found. If not specified, a new repository will be created based on the repository.xml located in the root of jbossesb.sar. In this case, repository data is stored in the JBossAS/server/{servername}/data/repository directory.
jcr.username - username for getting a repository session
jcr.password - password for gettging a repository session
jcr.root.node.path - the path relative to the root of the repository where messages will be stored
An easy test for whether the JCR message store is configured properly is to add the org.jboss.soa.esb.actions.persistence.StoreJCRMessage action onto an existing service. The action will attempt to store the current message to the JCR store.
Let me know if you run into any problems.
Thanks,
Derek