In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the knowledge of "what is the message processing method of activemq dead letter queue". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
1. The reason for the emergence of the dead letter queue
It has nothing to do with the expected transaction, retry, downtime, and dei.
Cannot display ObjectMessage body. Reason: Failed to build body from content. Serializable class not available to broker. Reason: java.lang.ClassNotFoundException: xxx
Should this message be processed when the entity class is not serialized? Then I try again and get rid of the entity class serialization, which will be a direct exception at run time, for an unknown reason.
two。 How do I handle messages in a dead letter queue?
The idea of this monitoring is correct, that is, there is something wrong with the implementation, and the monitoring is always out of reach.
1: manual treatment (too tired)
2: scheduled tasks (too performance-consuming)
3: monitor the dead letter queue
4: dead letter queue write library
In addition, when processing the message, it will be inconsistent with the expected result. The business is to like / cancel the like. If the original purpose is to cancel the like, but the operation fails to redis, there is no data to enter the dead letter queue database. During this period, I like this data, and then cancel it. If I deal with this message at this time, I will like it, which is inconsistent with the original purpose.
3. Monitoring + time
Create a listener to listen to the dead letter queue ActiveMQ.DLQ queue for messages, and consume if there are any messages. Each time mq marks a timestamp before joining the queue, the message of the dead letter queue is taken out and compared with the operation time in the current database. If the last recorded time is longer than the message time, it will not be processed, otherwise the message will be compensated. Redis+mq+mysql is the same when synchronizing data.
Will there be a backlog of messages in 4.redis+mq with 10, 000 concurrency?
No, the reason for the backlog is that the business system no longer monitors a queue. Even if there are 10,000 concurrent requests from colleagues, queuing consumption will certainly occur, but the backlog will not occur. In addition, if this happens, you need to send an SMS alarm and delete the queue manually or by script.
Maximum waiting queues
5. One queue per service, how to deal with useless queues?
For each service you contact, you need to customize the queue name. Some queues are waiting, and some are not handling the business all the time. You can customize to close the queues that are not working during the monitoring time, and then open them if necessary, so as to reduce the pressure on other queues.
For configuration, please see line 47 of activemq.xml.
ConstantPendingMessageLimitStrategy is used to prevent slow topic consumers from hindering producers and affecting other consumers by limiting the number of messages retained
6. Why is it that 30,000 missions are expected to be carried out with inconsistent results?
In order to test whether the business will frequently cancel and confirm that there are inconsistencies, the single interface has been tested for 10, 000 times and tested for 3 times. So far, a total of 3 times have been executed, the first time is 8552, the second time, and the third time is successful. In theory, it is a total of 28552 times, but the result is 28527. Ideally, there is no error log in the analysis of the resulting tree species in jmeter.
I don't know why. It is useless to check Scroll.
This queue adds time and
How to solve the concurrent competitive key problem of redis is similar, and the treatment scheme is also similar.
This is the end of the content of "what is the message handling method of activemq Dead letter queue". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.