-Caused by: com.rabbitmq.client.ShutdownSignalException: connection error; protocol method

  1. Exception in thread "main" java.io.IOException
  2. at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java: 106)
  3. at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java: 102)
  4. at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java: 124)
  5. at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java: 378)
  6. at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java: 678)
  7. at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java: 722)
  8. at upsmart.zhsen.ServerProducer.main(ServerProducer.java: 33)
Caused by: com.rabbitmq.client.ShutdownSignalException: connection error; protocol method: #method<connection.close>(reply-code=530, reply-text=NOT_ALLOWED - access to vhost '/' refused for user 'mq', class-id=10, method-id=40)
  1. at com.rabbitmq.utility.ValueOrException.getValue(ValueOrException.java: 67)
  2. at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java: 33)
  3. at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java: 361)
  4. at com.rabbitmq.client.impl.AMQChannel.privateRpc(AMQChannel.java: 226)
  5. at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java: 118)
  6. ... 4 more

服务器该用户没有分配权限

rabbitmqctl set_permissions -p "/" username ".*" ".*" ".*"

首先,如果没有添加用户,则添加用户,rabbitmq-server只有一个Guest用户

rabbitmqctl add_user username password

删除用户

rabbitmqctl delete_user guest

rabbitmqcrl命令参数

  1. stop [<pid_file>]
  2. stop_app
  3. start_app
  4. wait <pid_file>
  5. reset
  6. force_reset
  7. rotate_logs <suffix>
  8. hipe_compile <directory>
  9. join_cluster <clusternode> [--ram]
  10. cluster_status
  11. change_cluster_node_type disc | ram
  12. forget_cluster_node [--offline]
  13. rename_cluster_node oldnode1 newnode1 [oldnode2] [newnode2 ...]
  14. update_cluster_nodes clusternode
  15. force_boot
  16. sync_queue [-p <vhost>] queue
  17. cancel_sync_queue [-p <vhost>] queue
  18. purge_queue [-p <vhost>] queue
  19. set_cluster_name name
  20. add_user <username> <password>
  21. delete_user <username>
  22. change_password <username> <newpassword>
  23. clear_password <username>
  24. authenticate_user <username> <password>
  25. set_user_tags <username> <tag> ...
  26. list_users
  27. add_vhost <vhost>
  28. delete_vhost <vhost>
  29. list_vhosts [<vhostinfoitem> ...]
  30. set_permissions [-p <vhost>] <user> <conf> <write> <read>
  31. clear_permissions [-p <vhost>] <username>
  32. list_permissions [-p <vhost>]
  33. list_user_permissions <username>
  34. set_parameter [-p <vhost>] <component_name> <name> <value>
  35. clear_parameter [-p <vhost>] <component_name> <key>
  36. list_parameters [-p <vhost>]
  37. set_policy [-p <vhost>] [--priority <priority>] [--apply-to <apply-to>] <name> <pattern> <definition>
  38. clear_policy [-p <vhost>] <name>
  39. list_policies [-p <vhost>]
  40. list_queues [-p <vhost>] [--offline|--online|--local] [<queueinfoitem> ...]
  41. list_exchanges [-p <vhost>] [<exchangeinfoitem> ...]
  42. list_bindings [-p <vhost>] [<bindinginfoitem> ...]
  43. list_connections [<connectioninfoitem> ...]
  44. list_channels [<channelinfoitem> ...]
  45. list_consumers [-p <vhost>]
  46. status
  47. node_health_check
  48. environment
  49. report
  50. eval <expr>
  51. close_connection <connectionpid> <explanation>
  52. trace_on [-p <vhost>]
  53. trace_off [-p <vhost>]
  54. set_vm_memory_high_watermark <fraction>
  55. set_vm_memory_high_watermark absolute <memory_limit>
  56. set_disk_free_limit <disk_limit>
  57. set_disk_free_limit mem_relative <fraction>
  58. encode [--decode] [<value>] [<passphrase>] [--list-ciphers] [--list-hashes]
	   [--cipher <cipher>] [--hash <hash>] [--iterations <iterations>]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值