Skip to content
This repository has been archived by the owner on Jan 3, 2019. It is now read-only.

Commit

Permalink
Added config to use an internal broker for isolation from repo broker
Browse files Browse the repository at this point in the history
  • Loading branch information
ajs6f committed Nov 25, 2013
1 parent b7660d4 commit 03c29ec
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 16 deletions.
11 changes: 11 additions & 0 deletions fcrepo-jms-indexer-core/pom.xml
Expand Up @@ -133,6 +133,17 @@
<artifactId>httpmime</artifactId>
</dependency>
<!-- End of Solr Indexer libs -->
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-spring</artifactId>
<version>5.9.0</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

<build>
Expand Down
@@ -1,27 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:amq="http://activemq.apache.org/schema/core"
xmlns:c="http://www.springframework.org/schema/c"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
">
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">

<context:property-placeholder/>

<bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="failover:tcp://${jms.host:localhost}:${jms.port:61616}"/>
</bean>
<bean id="connectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory"
p:brokerUrl="failover:vm://localhost"/>

<!-- the internal broker -->
<amq:broker id="internalBroker" persistent="false">
<amq:destinations>
<amq:topic name="fedora"/>
</amq:destinations>
<amq:transportConnectors>
<amq:transportConnector uri="vm://localhost"/>
</amq:transportConnectors>
<amq:networkConnectors>
<amq:networkConnector
uri="static:(failover:(tcp://${org.fcrepo.jms.brokerHost:0.0.0.0}:${org.fcrepo.jms.brokerPort:61617}))"
/>
</amq:networkConnectors>
</amq:broker>

<!-- ActiveMQ queue to listen for events -->
<bean id="destination" class="org.apache.activemq.command.ActiveMQTopic">
<constructor-arg value="fedora" />
</bean>
<bean id="destination" class="org.apache.activemq.command.ActiveMQTopic"
c:name="fedora"/>

<!-- and this is the message listener container -->
<bean id="jmsContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
<property name="connectionFactory" ref="connectionFactory"/>
<property name="destination" ref="destination"/>
<property name="messageListener" ref="indexerGroup" />
</bean>
<bean id="jmsContainer"
class="org.springframework.jms.listener.DefaultMessageListenerContainer"
p:connectionFactory-ref="connectionFactory" p:destination-ref="destination"
p:messageListener-ref="indexerGroup"/>

</beans>
</beans>

0 comments on commit 03c29ec

Please sign in to comment.