Page History
...
- You will need to make a few jars available to Fedora so it can load and process the ActiveMQ configuration file. Drop the jars
xbean-spring-3.4.3.jar
andspring-context-2.5.6.jar
files into the Fedora webapp WEB-INF/lib directory. It Fedora 3.8, updated copies of these jars are already included. Most Spring applications provide these jars; if you are using Apache ServicemixServiceMix as the container for your remote broker, they can be found in theSERVICEMIX_HOME/lib
directory. Create the Fedora
activemq.xml
file, put it inFEDORA_HOME/server/config (
in newer versions like Fedora 3.8 useFEDORA_HOME/server/config/spring
)Code Block xml xml borderStyle solid <beans xmlns:amq="http://activemq.apache.org/schema/core"> <!-- ActiveMQ JMS Broker configuration --> <amq:broker id="broker" useShutdownHook="false"> <amq:managementContext> <amq:managementContext connectorPort="1093" createConnector="false"/> </amq:managementContext> <!-- Your remote broker, configured with failover --> <amq:networkConnectors> <amq:networkConnector uri="static:(failover:(tcp://0.0.0.0:61617))"/> </amq:networkConnectors> <!-- The directory where Fedora will store the ActiveMQ data --> <amq:persistenceAdapter> <amq:amqPersistenceAdapter directory="file:./data/amq"/> </amq:persistenceAdapter> </amq:broker> <!-- Set this to prevent objects from being serialized when passed along to your embedded broker; saves some overhead processing --> <bean id="jmsConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory"> <property name="objectMessageSerializationDefered" value="false"/> </bean> </beans>
This piece of the config file creates the bridge to the remote broker, configured in failover mode:
Code Block xml xml borderStyle solid <amq:networkConnectors> <amq:networkConnector uri="static:(failover:(tcp://0.0.0.0:61617))"/> </amq:networkConnectors>
Configure Fedora to read the
activemq.xml
file upon startup, create the embedded broker.
Make sure messaging is enabled infedora.fcfg
:Code Block xml xml borderStyle solid <module role="org.fcrepo.server.messaging.Messaging" class="org.fcrepo.server.messaging.MessagingModule"> <comment>Fedora's Java Messaging Service (JMS) Module</comment> <param name="enabled" value="true"/> [...]
Also change the
java.naming.provider.url
parameter:Code Block xml xml borderStyle solid <param name="java.naming.provider.url" value="vm://localhost?brokerConfig=xbean:file:/path/to/fedora_home/server/config/activemq.xml"/> In newer versions like Fedora 3.8 <param name="java.naming.provider.url" value="vm://localhost?brokerConfig=xbean:file:/path/to/fedora_home/server/config/spring/activemq.xml"/>
- Restart Fedora, and start up your remote broker (or the other way around: it no longer matters).
The ActiveMQ failover transport documentation contains a list of useful parameters that you can use to configure connection management to the remote broker (max reconnect attempts, period between reconnects, etc.)
...
Overview
Content Tools