Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?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:amqp="http://www.axonframework.org/schema/amqp"
- xmlns:axon="http://www.axonframework.org/schema/core" xmlns:rabbit="http://www.springframework.org/schema/rabbit"
- 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
- http://www.axonframework.org/schema/amqp http://www.axonframework.org/schema/axon-amqp-2.0.xsd
- http://www.springframework.org/schema/rabbit http://www.springframework.org/schema/rabbit/spring-rabbit-1.0.xsd
- http://www.axonframework.org/schema/core http://www.axonframework.org/schema/axon-core-2.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
- <context:property-placeholder
- location="classpath:axon-distributed-eventbus.conf" system-properties-mode="OVERRIDE"/>
- <bean id="transactionManager" class="org.springframework.amqp.rabbit.transaction.RabbitTransactionManager">
- <property name="connectionFactory" ref="connectionFactory"/>
- </bean>
- <!-- RabbitMQ Subsystem Configuration -->
- <rabbit:connection-factory id="connectionFactory"
- host="${axon.rabbitmq.host}"
- port="${axon.rabbitmq.port}"
- username="${axon.rabbitmq.username}"
- password="${axon.rabbitmq.password}"
- channel-cache-size="1"/>
- <rabbit:fanout-exchange id="eventBusExchange"
- name="${axon.rabbitmq.exchange-name}"
- durable="false"
- auto-delete="true">
- <rabbit:bindings>
- <rabbit:binding queue="eventBusQueue"/>
- </rabbit:bindings>
- </rabbit:fanout-exchange>
- <rabbit:queue id="eventBusQueue" name="${axon.rabbitmq.cluster-name}-queue" auto-delete="true" durable="false"/>
- <rabbit:admin id="rabbitAdmin" auto-startup="true" connection-factory="connectionFactory"/>
- <!-- Distributed EventBus Configuration -->
- <amqp:terminal id="terminal"
- connection-factory="connectionFactory"
- serializer="serializer"
- exchange-name="${axon.rabbitmq.exchange-name}"
- durable="true"
- transactional="false">
- <amqp:default-configuration transaction-manager="transactionManager"
- transaction-size="100"
- prefetch="100"
- queue-name="${axon.rabbitmq.cluster-name}-queue"
- exclusive="false"
- acknowledge="auto"
- concurrency="1"
- recovery-interval="1000"
- error-handler="loggingErrorHandler"
- shutdown-timeout="5000"/>
- </amqp:terminal>
- <bean id="loggingErrorHandler" class="org.springframework.scheduling.support.TaskUtils$LoggingErrorHandler"/>
- <axon:event-bus id="eventBus" terminal="terminal"/>
- <axon:cluster id="cluster" default="true">
- <axon:meta-data>
- <entry key="AMQP.Config">
- <!-- Uses amqp:default-configuration-->
- <amqp:configuration/>
- </entry>
- </axon:meta-data>
- </axon:cluster>
- <bean id="serializer" class="org.axonframework.serializer.xml.XStreamSerializer"/>
- </beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement