Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem of various error reports in Rabbit mq

2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces how to solve the problem of various error reports in Rabbit mq, which has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand.

1. The producer succeeded in producing the message but did not enter the queue. There is no error, but there is no information on the graphical page, and of course consumers can't spend.

Reason: consider that there are no messages on the page, then first rule out the consumer, whether the producer has the correct name when creating the queue, whether the RoutingKey is correct and whether the Arg is correct when binding the switch.

two。 The producer sent it successfully, and the consumer log is brushing the screen.

Org.springframework.amqp.rabbit.listener.exception.ListenerExecutionFailedException: Listener method'no match' threw exceptionat org.springframework.amqp.rabbit.listener.adapter.MessagingMessageListenerAdapter.invokeHandler (MessagingMessageListenerAdapter.java:198) ~ [spring-rabbit-2.1.5.RELEASE.jar:2.1.5.RELEASE] at org.springframework.amqp.rabbit.listener.adapter.MessagingMessageListenerAdapter.onMessage (MessagingMessageListenerAdapter.java:127) ~ [spring-rabbit-2.1.5.RELEASE.jar:2.1.5.RELEASE] at org.springframework. Amqp.rabbit.listener.AbstractMessageListenerContainer.doInvokeListener (AbstractMessageListenerContainer.java:1552) ~ [spring-rabbit-2.1.5.RELEASE.jar:2.1.5.RELEASE] at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.actualInvokeListener (AbstractMessageListenerContainer.java:1478) ~ [spring-rabbit-2.1.5.RELEASE.jar:2.1.5.RELEASE] at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.invokeListener (AbstractMessageListenerContainer.java:1466) ~ [spring-rabbit-2.1.5.RELEASE. Jar:2.1.5.RELEASE] at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.doExecuteListener (AbstractMessageListenerContainer.java:1461) ~ [spring-rabbit-2.1.5.RELEASE.jar:2.1.5.RELEASE] at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.executeListener (AbstractMessageListenerContainer.java:1410) ~ [spring-rabbit-2.1.5.RELEASE.jar:2.1.5.RELEASE] at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.doReceiveAndExecute (SimpleMessageListenerContainer.java:870) ) [spring-rabbit-2.1.5.RELEASE.jar:2.1.5.RELEASE] at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.receiveAndExecute (SimpleMessageListenerContainer.java:854) [spring-rabbit-2.1.5.RELEASE.jar:2.1.5.RELEASE] at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.access$1600 (SimpleMessageListenerContainer.java:78) [spring-rabbit-2.1.5.RELEASE.jar:2.1.5.RELEASE] at org.springframework. Amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.mainLoop (SimpleMessageListenerContainer.java:1137) [spring-rabbit-2.1.5.RELEASE.jar:2.1.5.RELEASE] at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run (SimpleMessageListenerContainer.java:1043) [spring-rabbit-2.1.5.RELEASE.jar:2.1.5.RELEASE] at java.lang.Thread.run (Thread.java:748) [na:1.8.0_131] Caused by: org.springframework.amqp .AmqpException: No method found for class [Bat org.springframework.amqp.rabbit.listener.adapter.DelegatingInvocableHandler.getHandlerForPayload (DelegatingInvocableHandler.java:149) ~ [spring-rabbit-2.1.5.RELEASE.jar:2.1.5.RELEASE] at org.springframework.amqp.rabbit.listener.adapter.DelegatingInvocableHandler.invoke (DelegatingInvocableHandler.java:129) ~ [spring-rabbit-2.1.5.RELEASE.jar:2.1.5.RELEASE] at org.springframework.amqp.rabbit.listener.adapter.HandlerAdapter.invoke ( HandlerAdapter.java:60) ~ [spring-rabbit-2.1.5.RELEASE.jar:2.1.5.RELEASE] at org.springframework.amqp.rabbit.listener.adapter.MessagingMessageListenerAdapter.invokeHandler (MessagingMessageListenerAdapter.java:190) ~ [spring-rabbit-2.1.5.RELEASE.jar:2.1.5.RELEASE]... 12 common frames omitted

Why are you brushing the screen? Look at what the authorities say.

If retries are not enabled and the listener throws an exception, by default the delivery will be retried indefinitely. You can modify this behavior in two ways; set the defaultRequeueRejectedproperty to falseand zero re-deliveries will be attempted; or, throw an AmqpRejectAndDontRequeueExceptionto signal the message should be rejected. This is the mechanism used when retries are enabled and the maximum delivery attempts are reached. If retry is not enabled and the listener throws an exception, the delivery will be retried indefinitely by default. You can modify this behavior in two ways; you can set the defaultRequeueRejected property to false and zero resubmit will be attempted; or if you throw an AmqpRejectAndDontRequeueException to signal, you should reject the message. This is the mechanism used to enable retry and reach the maximum delivery attempt.

Baidu asked consumers to put @ RabbitListener on the method for a while.

@ RabbitListener (queues = "delay_queue_order_cancel") @ RabbitHandler public BaseResult cancelOrder (String orderNumber) {BaseResult baseResult = new BaseResult (); return baseResult;}

3. The same consumer log is scanned on the screen, and the bold sentence says that the request message does not contain the reply-to attribute, and the default response exchange is not set. It means that the method you monitor consumption has a return value, which is not allowed by default.

Caused by: org.springframework.amqp.rabbit.listener.adapter.ReplyFailureException: Failed to send reply with payload 'InvocationResult [returnValue=BaseResult {code=1, message='success', token='null', data=0} ReturnType=class com.mjt.api.boot.common.BaseResult]'at org.springframework.amqp.rabbit.listener.adapter.AbstractAdaptableMessageListener.doHandleResult (AbstractAdaptableMessageListener.java:363) at org.springframework.amqp.rabbit.listener.adapter.AbstractAdaptableMessageListener.handleResult (AbstractAdaptableMessageListener.java:321) at org.springframework.amqp.rabbit.listener.adapter.MessagingMessageListenerAdapter.onMessage (MessagingMessageListenerAdapter.java:129) at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.doInvokeListener (AbstractMessageListenerContainer.java:1514)... 10 common frames omittedCaused by: org.springframework .amqp.AmqpException: Cannot determine ReplyTo message property value: Request message does not contain reply-to property And no default response Exchange was set.at org.springframework.amqp.rabbit.listener.adapter.AbstractAdaptableMessageListener.getReplyToAddress (AbstractAdaptableMessageListener.java:443) at org.springframework.amqp.rabbit.listener.adapter.AbstractAdaptableMessageListener.doHandleResult (AbstractAdaptableMessageListener.java:359)... 13 common frames omitted Thank you for reading this article carefully. I hope the article "how to solve the problem of reporting errors in Rabbit mq" shared by the editor will be helpful to you. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report