[英]Spring Integration <inbound-channel-adapter> Rabbit MQ getting disconnected
We are working on a POC to use Spring integration and Rabbit MQ. 我们正在研究使用Spring集成和Rabbit MQ的POC。 We have two modules producer module and consumer module both are runs in different JVMs. 我们有两个模块生产者模块和使用者模块,它们都在不同的JVM中运行。 The Producer module listen on a Folder (input folder) as soon as new files arrives, creates a message then push to (incoming.q.in) queue and also move to process folder. 一旦新文件到达,生产者模块就会侦听文件夹(输入文件夹),创建一条消息,然后推送到(incoming.q.in)队列,然后移至处理文件夹。
The Consumer module then pickups the messages from the incoming.q.in Queue then process the files them move to complete folder. 消费者模块然后从入站队列中的入站消息中提取消息,然后处理它们移至完整文件夹的文件。
Both Producer and Consumer code is working fine but after some ideal item then consumer module is getting disconnecting from Rabbit MQ. 生产者代码和使用者代码都可以正常工作,但是经过一些理想的操作之后,使用者模块将与Rabbit MQ断开连接。 We see messages in incoming.q.in queue but the consumer is not processing. 我们在incoming.q.in队列中看到消息,但使用者没有处理。
When I logged into Rabbit MQ Admin/Management tool “incoming.q.in” consumer list is empty and the message is “... no consumers ...”. 当我登录Rabbit MQ管理员/管理工具“ incoming.q.in”时,消费者列表为空,消息为“ ...没有消费者...”。
The consumer code 消费者代码
<int-amqp:inbound-channel-adapter channel="inBoundfile" queue-names="incoming.q.in" connection-factory="connectionFactory"
error-channel="error.in">
</int-amqp:inbound-channel-adapter>
<int:header-enricher input-channel="inBoundfile" output-channel="serviceInbound">
<int:header name="FILEID" expression="payload.fileID" />
</int:header-enricher>
<int:service-activator ref="routerService" method="processFile" input-channel="serviceInbound" output-channel="fileHandler.router.in" />
....
I appreciate your help. 我感谢您的帮助。
Turn on DEBUG logging on the consumer side; 在使用者端开启DEBUG记录; you'll see lots of logging and reconnection attempts if/when a connection is lost. 如果/当连接断开时,您会看到很多记录和重新连接尝试。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.