Use namespace features for template + CF

This commit is contained in:
Dave Syer
2011-04-06 12:54:15 +01:00
parent 0b738513d0
commit 1f13fe0537
2 changed files with 3 additions and 10 deletions

View File

@@ -4,11 +4,7 @@
xsi:schemaLocation="http://www.springframework.org/schema/rabbit http://www.springframework.org/schema/rabbit/spring-rabbit.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<bean id="connectionFactory" class="org.springframework.amqp.rabbit.connection.CachingConnectionFactory">
<constructor-arg value="localhost"/>
<property name="username" value="guest"/>
<property name="password" value="guest"/>
</bean>
<rabbit:connection-factory id="connectionFactory"/>
<rabbit:admin connection-factory="connectionFactory"/>

View File

@@ -9,11 +9,8 @@
<bean id="stockServiceGateway" class="org.springframework.amqp.rabbit.stocks.gateway.RabbitStockServiceGateway">
<property name="rabbitTemplate">
<bean class="org.springframework.amqp.rabbit.core.RabbitTemplate">
<property name="connectionFactory" ref="connectionFactory" />
<property name="routingKey" value="app.stock.request" />
<property name="messageConverter" ref="jsonMessageConverter" />
</bean>
<rabbit:template connection-factory="connectionFactory" routing-key="app.stock.request"
message-converter="jsonMessageConverter" />
</property>
<property name="defaultReplyTo" value="fanout://broadcast.responses/" />
</bean>