Tomcat listens to mq, causing ngxin to forward no request to it, and it will retrieve data from mq, ngxinmq

Source: Internet
Author: User

Tomcat listens to mq, causing ngxin to forward no request to it, and it will retrieve data from mq, ngxinmq

The problems encountered today are described as follows:

Local Configuration

Ngxin port 80

2017at1 8080

Tomcat2 8081

Tomcat3 8082

Problem: the same programs deployed at worker at1, 2, and 3 are all started. nginx performs load balancing on worker AT1 and 2. When a request arrives, nginx distributes the request to tomat1, 2, the result shows that Tomcat 3 is also processing the request by checking the log.

Cause: program mechanism problems. When a request is forwarded to tomat1 or 2, tomcat1 and 2 will accept the request and retrieve the request parameters, such as json strings, and put them in rabbitMQ instead of directly processing it. The program itself has a monitoring mechanism for MQ. When the program finds itself in idle state, it will take the initiative to retrieve and process data in MQ. So although Tomcat R3 does not receive requests forwarded by nginx, It listens to MQ, so that it automatically retrieves and processes the data when queue messages are in MQ, this leads to the problem described in the question.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.