gpt4 book ai didi

grails - Rabbitmq:手动创建的用户无法正常工作

转载 作者:行者123 更新时间:2023-12-02 14:30:46 28 4
gpt4 key购买 nike

我刚开始使用 Rabbitmq ,并且尝试将其与grails一起使用。我在grails中成功设置了Rabbitmq。当我使用用户名=“guest”和密码=“guest”创建连接时,它可以正常工作,但是当我尝试使用手动创建的用户时,会引发一些错误,如下所示:

    Error initializing the application: null
java.io.IOException
at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:106)
at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:102)
at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:124)
at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:376)
at com.rabbitmq.client.impl.recovery.RecoveryAwareAMQConnectionFactory.newConnection(RecoveryAwareAMQConnectionFactory.java:36)
at com.rabbitmq.client.impl.recovery.AutorecoveringConnection.init(AutorecoveringConnection.java:83)
at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:595)
at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:637)
at com.budjb.rabbitmq.connection.ConnectionContextImpl.start(ConnectionContextImpl.groovy:101)
at com.budjb.rabbitmq.connection.ConnectionManagerImpl.start(ConnectionManagerImpl.groovy:191)
at com.budjb.rabbitmq.connection.ConnectionManagerImpl$_start_closure4.doCall(ConnectionManagerImpl.groovy:176)
at com.budjb.rabbitmq.connection.ConnectionManagerImpl.start(ConnectionManagerImpl.groovy:174)
at com.budjb.rabbitmq.RabbitContextImpl.startConnections(RabbitContextImpl.groovy:193)
at com.budjb.rabbitmq.RabbitContextImpl.start(RabbitContextImpl.groovy:78)
at com.budjb.rabbitmq.RabbitContextProxy.start(RabbitContextProxy.groovy:188)
at RabbitmqNativeGrailsPlugin$_closure2.doCall(RabbitmqNativeGrailsPlugin.groovy:189)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: com.rabbitmq.client.ShutdownSignalException: connection error
at com.rabbitmq.utility.ValueOrException.getValue(ValueOrException.java:67)
at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:33)
at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:348)
at com.rabbitmq.client.impl.AMQChannel.privateRpc(AMQChannel.java:221)
at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:118)
... 17 more
Caused by: java.io.EOFException
at java.io.DataInputStream.readUnsignedByte(DataInputStream.java:290)
at com.rabbitmq.client.impl.Frame.readFrom(Frame.java:95)
at com.rabbitmq.client.impl.SocketFrameHandler.readFrame(SocketFrameHandler.java:139)
at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:534)
... 1 more

我向该用户提供了所有权限,并将管理员添加为标签。请帮我。

最佳答案

实际上我遇到了同样的问题,您只需先检查或按照以下步骤操作即可:

1)使用命令创建用户sudo rabbitmqctl add_user username password
2)现在为您的用户名设置标签为adminsudo rabbitmqctl set_user_tags username administrator
3)现在通过创建一个新的virtualHostsudo rabbitmqctl add_vhost test
4)之后,给予完全许可sudo rabbitmqctl set_permissions -p test username ".*" ".*" ".*"
5)现在终于在您的配置文件中定义

connection host: "Ip for your server", username: "admin", password: "password" , virtualHost: "test"



现在再次运行您的代码,它将成功运行。

请享用!!

关于grails - Rabbitmq:手动创建的用户无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31669972/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com