Advertisement
Guest User

axon-distributed-eventbus.xml

a guest
Mar 21st, 2013
767
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 3.79 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2.  
  3. <beans xmlns="http://www.springframework.org/schema/beans"
  4.       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:amqp="http://www.axonframework.org/schema/amqp"
  5.       xmlns:axon="http://www.axonframework.org/schema/core" xmlns:rabbit="http://www.springframework.org/schema/rabbit"
  6.       xmlns:context="http://www.springframework.org/schema/context"
  7.       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  8.            http://www.axonframework.org/schema/amqp http://www.axonframework.org/schema/axon-amqp-2.0.xsd
  9.            http://www.springframework.org/schema/rabbit http://www.springframework.org/schema/rabbit/spring-rabbit-1.0.xsd
  10.            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">
  11.  
  12.     <context:property-placeholder
  13.            location="classpath:axon-distributed-eventbus.conf" system-properties-mode="OVERRIDE"/>
  14.  
  15.     <bean id="transactionManager" class="org.springframework.amqp.rabbit.transaction.RabbitTransactionManager">
  16.         <property name="connectionFactory" ref="connectionFactory"/>
  17.     </bean>
  18.  
  19.     <!-- RabbitMQ Subsystem Configuration -->
  20.  
  21.     <rabbit:connection-factory id="connectionFactory"
  22.                               host="${axon.rabbitmq.host}"
  23.                               port="${axon.rabbitmq.port}"
  24.                               username="${axon.rabbitmq.username}"
  25.                               password="${axon.rabbitmq.password}"
  26.                               channel-cache-size="1"/>
  27.  
  28.     <rabbit:fanout-exchange id="eventBusExchange"
  29.                            name="${axon.rabbitmq.exchange-name}"
  30.                            durable="false"
  31.                            auto-delete="true">
  32.  
  33.         <rabbit:bindings>
  34.             <rabbit:binding queue="eventBusQueue"/>
  35.         </rabbit:bindings>
  36.     </rabbit:fanout-exchange>
  37.  
  38.     <rabbit:queue id="eventBusQueue" name="${axon.rabbitmq.cluster-name}-queue" auto-delete="true" durable="false"/>
  39.  
  40.     <rabbit:admin id="rabbitAdmin" auto-startup="true" connection-factory="connectionFactory"/>
  41.  
  42.     <!-- Distributed EventBus Configuration -->
  43.  
  44.     <amqp:terminal id="terminal"
  45.                   connection-factory="connectionFactory"
  46.                   serializer="serializer"
  47.                   exchange-name="${axon.rabbitmq.exchange-name}"
  48.                   durable="true"
  49.                   transactional="false">
  50.  
  51.         <amqp:default-configuration transaction-manager="transactionManager"
  52.                                    transaction-size="100"
  53.                                    prefetch="100"
  54.                                    queue-name="${axon.rabbitmq.cluster-name}-queue"
  55.                                    exclusive="false"
  56.                                    acknowledge="auto"
  57.                                    concurrency="1"
  58.                                    recovery-interval="1000"
  59.                                    error-handler="loggingErrorHandler"
  60.                                    shutdown-timeout="5000"/>
  61.     </amqp:terminal>
  62.  
  63.     <bean id="loggingErrorHandler" class="org.springframework.scheduling.support.TaskUtils$LoggingErrorHandler"/>
  64.  
  65.     <axon:event-bus id="eventBus" terminal="terminal"/>
  66.  
  67.     <axon:cluster id="cluster" default="true">
  68.         <axon:meta-data>
  69.             <entry key="AMQP.Config">
  70.                 <!-- Uses amqp:default-configuration-->
  71.                 <amqp:configuration/>
  72.             </entry>
  73.         </axon:meta-data>
  74.     </axon:cluster>
  75.  
  76.     <bean id="serializer" class="org.axonframework.serializer.xml.XStreamSerializer"/>
  77. </beans>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement