消息队列 RocketMQ 版

发送消息报错

最近更新时间:2024-08-15 16:47:41

我的收藏

客户 Producer 发消息失败,出现 ACL exception 的报错

Caused by: org.apache.rocketmq.client.exception.MQBrokerException: CODE: 1 DESC: org.apache.rocketmq.acl.common.AclException: [PRODUCE] Token authentication failed, please check, org.streamnative.pulsar.handlers.rocketmq.inner.RocketMQBrokerController$3.doBeforeRequest(RocketMQBrokerController.java:475)
For more information, please visit the url, http://rocketmq.apache.org/docs/faq/
at org.apache.rocketmq.client.impl.MQClientAPIImpl.processSendResponse(MQClientAPIImpl.java:665)
at org.apache.rocketmq.client.impl.MQClientAPIImpl.sendMessageSync(MQClientAPIImpl.java:505)
at org.apache.rocketmq.client.impl.MQClientAPIImpl.sendMessage(MQClientAPIImpl.java:487)
at org.apache.rocketmq.client.impl.MQClientAPIImpl.sendMessage(MQClientAPIImpl.java:431)
at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.sendKernelImpl(DefaultMQProducerImpl.java:854)
at org.apache.rocketmq.client.impl.producer.DefaultMQProducerImpl.sendDefaultImpl(DefaultMQProducerImpl.java:584)
... 3 more
可能原因如下:
AK SK 配置不正确。access-key/secret-key 配置不正确会抛出AclException
access-key:namespace 配置权限中的角色密钥。
secret-key:namespace 配置权限中的角色名称。

客户接入的时候报错 RemotingConnectException

Caused by: org.apache.rocketmq.remoting.exception.RemotingConnectException: connect to [rocketmq-vsxssa.rocketmq.ap-gz.qcloud.tencenttdmq.com:5098] failed
at org.apache.rocketmq.remoting.netty.NettyRemotingClient.getAndCreateNameserverChannel(NettyRemotingClient.java:445)
at org.apache.rocketmq.remoting.netty.NettyRemotingClient.getAndCreateChannel(NettyRemotingClient.java:400)
at org.apache.rocketmq.remoting.netty.NettyRemotingClient.invokeSync(NettyRemotingClient.java:369)
at org.apache.rocketmq.client.impl.MQClientAPIImpl.getTopicRouteInfoFromNameServer(MQClientAPIImpl.java:1363)
at org.apache.rocketmq.client.impl.MQClientAPIImpl.getTopicRouteInfoFromNameServer(MQClientAPIImpl.java:1353)
at org.apache.rocketmq.client.impl.factory.MQClientInstance.updateTopicRouteInfoFromNameServer(MQClientInstance.java:622)
... 6 more
大部分时候是接入点填写错误,接入点可以在集群基本信息页面的网络模块获取。
集群接入地址默认支持 VPC 内网访问。
集群公网接入地址,默认不开通。如需开通公网访问,虚拟集群可提交工单申请,专享集群可以通过调整公网带宽来开启/关闭公网访问。建议公网访问只在作为测试使用。
注意:
VPC 内网访问时,需要使用同一地域的 CVM 机器或者其他能成功访问 VPC 的环境。可使用 ping 或者 telnet 测试网络是否成功连接,网络不通时会抛出 RemotingConnectException 错误。