栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

RocketMQ发送消息报错 The name or value of property can not be null or blank string!

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

RocketMQ发送消息报错 The name or value of property can not be null or blank string!

异常日志:

org.springframework.messaging.MessagingException: The name or value of property can not be null or blank string!; nested exception is java.lang.IllegalArgumentException: The name or value of property can not be null or blank string!
at org.apache.rocketmq.spring.core.RocketMQTemplate.syncSend(RocketMQTemplate.java:534)
at org.apache.rocketmq.spring.core.RocketMQTemplate.syncSend(RocketMQTemplate.java:466)
at org.apache.rocketmq.spring.core.RocketMQTemplate.syncSend(RocketMQTemplate.java:454)
at org.apache.rocketmq.spring.core.RocketMQTemplate.doSend(RocketMQTemplate.java:850)
at org.apache.rocketmq.spring.core.RocketMQTemplate.doSend(RocketMQTemplate.java:53)
at org.springframework.messaging.core.AbstractMessageSendingTemplate.send(AbstractMessageSendingTemplate.java:108)
 

报错源码在org.apache.rocketmq.common.message.Message

    public void putUserProperty(String name, String value) {
        if (MessageConst.STRING_HASH_SET.contains(name)) {
            throw new RuntimeException(String.format("The Property<%s> is used by system, input another please", name));
        } else if (value != null && !value.trim().isEmpty() && name != null && !name.trim().isEmpty()) {
            this.putProperty(name, value);
        } else {
            throw new IllegalArgumentException("The name or value of property can not be null or blank string!");
        }
    }

原因是putUserProperty()方法传参含有空值

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/986537.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号