In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "how to troubleshoot abnormal amqp protocol links". In daily operation, I believe many people have doubts about how to troubleshoot abnormal amqp protocol links. The editor has consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts of "how to troubleshoot abnormal amqp protocol links". Next, please follow the editor to study!
Preface
Amqp is a general message queue data transfer protocol, and a typical MQ application RabbitMQ implements the amqp protocol. Therefore, when we use amqp-client to link rabbitmq, we can use amqp's link protocol to connect to rabbitmq. However, when bloggers try to use amqp protocol links, they encounter a hidden connection protocol specification problem, so record it here.
Problem background
Amqp-client version: 5.4.x
Amqp-url
Abnormal information
Exception one:
11 socket closed at java.net.SocketInputStream.socketRead0 4915 12.329 [AMQP Connection 192.168.1.226] ERROR com.rabbitmq.client.impl.ForgivingExceptionHandler-An unexpected connection driver error occuredjava.net.SocketException: socket closed at java.net.SocketInputStream.socketRead0 (Native Method) ~ [?: 1.8.0277] at java.net.SocketInputStream.socketRead (SocketInputStream.java:116) ~ [?: 1.8.01477] at java.net.SocketInputStream.read ) ~ [?: 1.8.0 / 77] at java.net.SocketInputStream.read (SocketInputStream.java:141) ~ [?: 1.8.0 / 77] at java.io.BufferedInputStream.fill (BufferedInputStream.java:246) ~ [?: 1.8.0 / 77] at java.io.BufferedInputStream.read (BufferedInputStream.java:265) ~ [?: 1.8.0 / 77] at java.io.DataInputStream.readUnsignedByte (DataInputStream Java: 288) ~ [?: 1.8.0 / 77] at com.rabbitmq.client.impl.Frame.readFrom (Frame.java:91) ~ [amqp-client-5.4.3.jar:5.4.3] at com.rabbitmq.client.impl.SocketFrameHandler.readFrame (SocketFrameHandler.java:164) ~ [amqp-client-5.4.3.jar:5.4.3] at com.rabbitmq.client.impl.AMQConnection$MainLoop.run ( AMQConnection.java:596) [amqp-client-5.4.3.jar:5.4.3] at java.lang.Thread.run (Thread.java:745) [?: 1.8.0 / 77] Disconnected from the target VM Address: '127.0.0.1 transport:' socket'
Exception 2:
Java.lang.IllegalArgumentException: Multiple segments in path of AMQP URI: /% 2Fapp/kl at com.rabbitmq.client.ConnectionFactory.setUri (ConnectionFactory.java:348) at com.rabbitmq.client.ConnectionFactory.setUri (ConnectionFactory.java:370) at com.jd.blockchain.consensus.mq.factory.RabbitFactory.initConnectionFactory (RabbitFactory.java:42) at com.jd.blockchain.consensus.mq.factory.RabbitFactory.main (RabbitFactory.java:52) cause analysis abnormal one analysis:
First of all, the above exception is thrown because the rabbitmq server rejected your operation and interrupted your connection, so the general application does not report an error when it starts to establish a connection, but sends the error of the data Times link. The reason for rejecting the operation is that the currently linked account does not have the permission to operate with vhost. So for this reason, it is likely to be the following problems:
1. The current account does not have permission
2. The current account does not have permission to operate a specific vhost.
The problem of many people on the Internet is the first one, forgetting to assign permission to the account. The blogger's problem is that there is a problem with the connection string of amqp, which leads to the wrong vhost, so the appearance is that there is no permission. The default vhost for rabbitmq is "/", and the vhost represented by the amqp://keking:kk123456@192.168.1.226:5672/ connection string is not "/", but "".
Anomaly 2 analysis:
Aiming at the problem of exception 2, in the amqp link protocol, the diagonal bar directory of vhost needs to be replaced by% 2f, otherwise the client will throw an incorrect exception when splitting the link when parsing URI.
Solve the problem
Details of the amqp link agreement are as follows:
So, to link to the vhost of "/", the correct link should add "% 2f" to the end, as shown in
"amqp://keking:kk123456@192.168.1.226:5672/%2f"
At this point, the study on "how to troubleshoot amqp protocol link anomalies" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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.