开发者社区 > 云原生 > 云消息队列 > 正文

使用阿里云rocketmq发送同步消息报错

问题描述

使用阿里云rocketmq发送同步消息报错,使用示例demo配置好账号信息、组、主题后运行报错:

Caused by: com.aliyun.openservices.ons.shaded.org.apache.rocketmq.client.exception.ClientException: error code: OTHER

    at com.aliyun.openservices.ons.shaded.org.apache.rocketmq.client.impl.producer.ProducerImpl.onExecutionException(ProducerImpl.java:838)

    at com.aliyun.openservices.ons.shaded.org.apache.rocketmq.client.impl.producer.ProducerImpl.send(ProducerImpl.java:351)

    at com.aliyun.openservices.ons.shaded.org.apache.rocketmq.client.impl.producer.ProducerImpl.send(ProducerImpl.java:339)

    at com.aliyun.openservices.ons.shaded.org.apache.rocketmq.client.producer.DefaultMQProducer.send(DefaultMQProducer.java:183)

    at com.aliyun.openservices.ons.client.rocketmq.impl.ProducerImpl.send(ProducerImpl.java:152)

    ... 94 more

Caused by: com.aliyun.openservices.ons.shaded.io.grpc.StatusRuntimeException: PERMISSION_DENIED: Grpc server auth error, request doesn't has topic or group. request=apache.rocketmq.v1.SendMessageRequest, requestId=6afec3dd-7a0d-4350-830f-b6ecc791e7bf, error=permission denied: signature validate failed.-2 Signature not match!, validate=false, akDisabled=false, whiteList=true

    at com.aliyun.openservices.ons.shaded.io.grpc.Status.asRuntimeException(Status.java:534)

    at com.aliyun.openservices.ons.shaded.io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:533)

    at com.aliyun.openservices.ons.shaded.io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39)

    at com.aliyun.openservices.ons.shaded.io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23)

    at com.aliyun.openservices.ons.shaded.io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40)

    at com.aliyun.openservices.ons.shaded.io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:553)

    at com.aliyun.openservices.ons.shaded.io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:68)

    at com.aliyun.openservices.ons.shaded.io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:739)

    at com.aliyun.openservices.ons.shaded.io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:718)

    at com.aliyun.openservices.ons.shaded.io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)

    at com.aliyun.openservices.ons.shaded.io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)

    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

    ... 1 more

期望结果

...

已尝试的方法

...

展开
收起
游客2beay5yfmb2jk 2022-10-12 13:59:28 254 0
1 条回答
写回答
取消 提交回答
  • PERMISSION_DENIED

    这个一般是鉴权问题,可能是AK/SK不匹配。

    如果是4.0系列实例,检查下AK、SK是否填写正确。AK、SK可以参考这篇文档获取:https://help.aliyun.com/document_detail/116401.htm

    如果是5.0系列实例,公网访问时AK、SK参数需要填写成实例的用户名和密码。

    2022-10-12 16:31:10
    赞同 展开评论 打赏

涵盖 RocketMQ、Kafka、RabbitMQ、MQTT、轻量消息队列(原MNS) 的消息队列产品体系,全系产品 Serverless 化。RocketMQ 一站式学习:https://rocketmq.io/

相关产品

  • 云消息队列 MQ
  • 热门讨论

    热门文章

    相关电子书

    更多
    RocketMQ Client-GO 介绍 立即下载
    RocketMQ Prometheus Exporter 打造定制化 DevOps 平台 立即下载
    基于 RocketMQ Prometheus Exporter 打造定制化 DevOps 平台 立即下载