rabbitmq异常处理问题集

这篇具有很好参考价值的文章主要介绍了rabbitmq异常处理问题集。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

3 消息丢列执行先后顺序的问题
下面的代码,一个创建公司,一个创建用户,如果在创建公司的时候判断用户是否存在,就会有问题,因为你以为的发送消息顺序,和数据库写入并不是一回事。
an unexpected connection driver error occured (exception message: socket clo,岁月云——Web系统最佳实践,rabbitmq,分布式

an unexpected connection driver error occured (exception message: socket clo,岁月云——Web系统最佳实践,rabbitmq,分布式

2 unack消息导致rabbitmq一直报错
rabbitmq中一条unacked的消息,导致后台疯狂刷日志。
暴力的解决方案是./rabbitmqctl purge_queue -p eayc user_register_acc,这个不行,就删掉队列。
可是这个只是临时方案。
an unexpected connection driver error occured (exception message: socket clo,岁月云——Web系统最佳实践,rabbitmq,分布式

1 rabbitmq访问不了An unexpected connection driver error occurred (Exception message: Socket closed)
看到这个问题,第一时间想到rabbitmq的问题,应该权限导致的
先创建virtual hosts
an unexpected connection driver error occured (exception message: socket clo,岁月云——Web系统最佳实践,rabbitmq,分布式
接着创建用户并赋予权限,将eayc的virtual hosts权限赋予acc用户即可
an unexpected connection driver error occured (exception message: socket clo,岁月云——Web系统最佳实践,rabbitmq,分布式

15:34:24.250 WARN  com.rabbitmq.client.impl.ForgivingExceptionHandler - An unexpected connection driver error occurred (Exception message: Socket closed)
15:34:24.254 ERROR c.w.e.u.controller.UserExceptionControllerAdvice - java.io.IOException
org.springframework.amqp.AmqpIOException: java.io.IOException
        at org.springframework.amqp.rabbit.support.RabbitExceptionTranslator.convertRabbitAccessException(RabbitExceptionTranslator.java:70)
        at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:602)
        at org.springframework.amqp.rabbit.connection.CachingConnectionFactory.createConnection(CachingConnectionFactory.java:725)
        at org.springframework.amqp.rabbit.connection.ConnectionFactoryUtils.createConnection(ConnectionFactoryUtils.java:252)
        at org.springframework.amqp.rabbit.core.RabbitTemplate.doExecute(RabbitTemplate.java:2210)
        at org.springframework.amqp.rabbit.core.RabbitTemplate.execute(RabbitTemplate.java:2183)
        at org.springframework.amqp.rabbit.core.RabbitTemplate.send(RabbitTemplate.java:1102)
        at org.springframework.amqp.rabbit.core.RabbitTemplate.convertAndSend(RabbitTemplate.java:1167)
        at org.springframework.amqp.rabbit.core.RabbitTemplate.convertAndSend(RabbitTemplate.java:1160)
        at com.whty.eayc.user.service.ext.impl.EaycCompanyExtServiceImpl.sendCompanyAddMsg(EaycCompanyExtServiceImpl.java:232)
        at com.whty.eayc.user.service.ext.impl.EaycCompanyExtServiceImpl.create(EaycCompanyExtServiceImpl.java:145)
        at com.whty.eayc.user.service.ext.impl.EaycCompanyExtServiceImpl$$FastClassBySpringCGLIB$$a9fb13a9.invoke(<generated>)
        at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
        at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)
        at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
        at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708)
        at com.whty.eayc.user.service.ext.impl.EaycCompanyExtServiceImpl$$EnhancerBySpringCGLIB$$4ce4fd0e.create(<generated>)
        at com.whty.eayc.user.controller.CompanyController.create(CompanyController.java:125)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
        at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150)
        at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117)
        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)
        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808)
        at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1071)
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:964)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:665)
        at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:750)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
        at com.whty.framework.web.filter.CorsFilter.doFilter(CorsFilter.java:41)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
        at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
        at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
        at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:177)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
        at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:769)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360)
        at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399)
        at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
        at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:891)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1784)
        at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
        at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
        at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: null
        at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:129)
        at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:125)
        at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:147)
        at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:439)
        at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:1225)
        at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:1173)
        at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.connectAddresses(AbstractConnectionFactory.java:640)
        at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.connect(AbstractConnectionFactory.java:615)
        at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:565)
        ... 76 common frames omitted
Caused by: com.rabbitmq.client.ShutdownSignalException: connection error; protocol method: #method<connection.close>(reply-code=530, reply-text=NOT_ALLOWED - vhost eayc not found, class-id=10, method-id=40)
        at com.rabbitmq.utility.ValueOrException.getValue(ValueOrException.java:66)
        at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:36)
        at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:502)
        at com.rabbitmq.client.impl.AMQChannel.privateRpc(AMQChannel.java:293)
        at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:141)
        ... 82 common frames omitted

跟进后台日志文章来源地址https://www.toymoban.com/news/detail-773805.html

21:06:32.015 ERROR o.s.a.r.listener.SimpleMessageListenerContainer - Failed to check/redeclare auto-delete queue(s).
21:06:32.016 WARN  com.rabbitmq.client.impl.ForgivingExceptionHandler - An unexpected connection driver error occurred (Exception message: Socket closed)
21:06:32.021 INFO  o.s.a.rabbit.connection.CachingConnectionFactory - Attempting to connect to: [10.8.15.220:5672]
21:06:32.021 WARN  com.rabbitmq.client.impl.ForgivingExceptionHandler - An unexpected connection driver error occurred (Exception message: Socket closed)
21:06:32.027 WARN  com.rabbitmq.client.impl.ForgivingExceptionHandler - An unexpected connection driver error occurred (Exception message: Socket closed)

到了这里,关于rabbitmq异常处理问题集的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • Docker: driver failed programming external connectivity on endpoint xxx 问题分析及解决

    重启容器发现无法正常启动,报错: driver failed programming external connectivity on endpoint xxx 首先理清一下我做了什么操作。我记得在我开启docker后,执行 docker-compose up -d 启动完容器后,发现无法连接 MySQL 容器,经查没有关闭防火墙,未开放3306端口,因此执行 systemctl stop firewalld

    2024年02月16日
    浏览(30)
  • rabbitmq消息异常处理

    提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档 在使用rabbitmq时,会因为各种原因(网络波动,系统宕机,程序异常等)导致消息发送失败。rabbitmq也提供了相应的处理机制。 提示:以下是本篇文章正文内容,下面案例可供参考 生产法发送失败 配置回调

    2023年04月09日
    浏览(36)
  • SSLHandshakeException: Remote host closed connection during handshake异常处理

    请求第三方https接口出现SSLHandshakeException: Remote host closed connection during handshake问题,本地正常,服务器异常。原因是服务器jdk版本是jdk1.8_40 现阶段找到三个方案,第一个是jdk1.8_151版本 添加或者修改Javajrelibsecurityjava.security 第二个直接替换jdk版本到jdk1.8_162版本,这个版本直

    2024年04月22日
    浏览(31)
  • rabbitmq消息阻塞情况分析;自动重试处理异常

    消费者因为代码问题出现了异常,此时默认是自动提交的消息,这个 RuntimException 会导致消息直接重新入队,再次投递(进入队首),此时会导致后面的消息被阻塞. auto 自动确认分四种情况,第一种就是正常消费,其他三种则为异常情况 消息成功被消费,没有抛出异常,则自

    2024年02月17日
    浏览(45)
  • Failed to load driver class com.mysql.cj.jdbc.Driver异常-IntellIJ Idea-后端项目连接数据库_添加MyBatis依赖配置问题

    前言 :后端项目连接数据库配置时,添加了如下application.properties的数据库连接配置 项目点击运行,就出现以下系列问题 这种情况通常是由于以下原因之—引起的: 1.没有在项目中引入mysql-connectorjar包,或者引入的包版本与JDBC驱动不匹配。解决方法:在项目pom.xml中添加相关依

    2024年02月05日
    浏览(77)
  • [问题已处理]-Error 803- system has unsupported display driver cuda driver combination

    导语:同一个镜像在不同的显卡驱动的机器上无法使用gpu 。报错Error 803: system has unsupported display driver / cuda driver combination 查看2个镜像对应的cuda driver 同镜像tag ge2206300210 宿主机驱动465.27 镜像cuda driver是465.27 同镜像 tag ge2206300210宿主机驱动470.63 镜像cuda driver是465.27 这里宿主机

    2024年02月09日
    浏览(31)
  • MySQL java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax 关键字异常处理

    使用mybatis插入数据时出现java.sql.SQLSyntaxErrorException异常 收到错误“由:java.sql.SQLSyntaxErrorException:您的SQL语法有错误;检查与您的MySQL服务器版本相对应的手册,了解在第14行的“”附近使用的正确语法。 liquibase回答: You have an error in your SQL syntax; check the manual that corresponds to

    2024年02月15日
    浏览(48)
  • 【rabbitmq】出现问题Channel error on connection

    🎈博客主页:🌈我的主页🌈 🎈欢迎点赞 👍 收藏 🌟留言 📝 欢迎讨论!👏 🎈本文由 【泠青沼~】 原创,首发于 CSDN🚩🚩🚩 🎈由于博主是在学小白一枚,难免会有错误,有任何问题欢迎评论区留言指出,感激不尽!🌠个人主页 问题就是dong.mail.exchange交换机在 / 当前目

    2024年02月04日
    浏览(38)
  • logstash问题记录:Attempted to resurrect connection to dead ES instance, but got an error

    发现kibana中日志不在更新了,停留在了一个时间点没有继续更新,然后就去检查各个服务,发现es、logstash、kibana均正常,不过发现es里面没有新日志产生,初步怀疑是logstash没有成功推送过来日志。 1.检查logstash日志,logstahs是java开发的,笔者将日志记录到了nohup.out文件中 检查

    2024年02月11日
    浏览(77)
  • 解决RabbitMQ管理页面异常/不正确的问题

    我的RabbitMQ是用docker安装的,应该不会是安装的环境有问题。 而且MQ的服务确实是启动了,后端能正常使用,并且管理界面的登录页面也是能正常登录的,就是登录后的界面内容不对,所以怀疑一下是不是还要配置用户才行,然后跟着网上的教程一通乱搞也没解决。 各种排查

    2024年04月23日
    浏览(34)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包