rabbitmq - Fanout exchange behaving as Direct exchange in Spring AMQP -
i facing issue while using rabbitmq in fanout exchange due unknown reason behaving direct exchange.
i using following binding , queue configuration
<bean id="testfanout" class="com.test"> <constructor-arg name="exchange" ref="test" /> <constructor-arg name="routingkey" value="test" /> <constructor-arg name="queue" value="testq" /> <constructor-arg name="template"> <bean class="org.springframework.amqp.rabbit.core.rabbittemplate"> <constructor-arg ref="connectionfactory" /> </bean> </constructor-arg> <constructor-arg value="true"/> </bean> <rabbit:fanout-exchange name="test" id="test"> <rabbit:bindings> <rabbit:binding queue="test"/> </rabbit:bindings> </rabbit:fanout-exchange>
now have same code listening same testq on 2 different vm's somehow message send 1 vm listener using round robin algorithm
sender code
channel = ... rabbittemplate template = null; if(channel != null){ template = channel.gettemplate(); if(template != null){ template.setqueue(channel.getqueue()); template.setexchange(channel.getexchange().getname()); template.convertandsend(channel.getroutingkey(), txtmsg);
the routing key ignored fanout exchange.
are sure it's fanout exchange in rabbitmq? don't see rabbitadmin in configuration (which attempt declare exchange , binding).
look @ exchange in rabbitmq ui , check type/bindings.
Comments
Post a Comment