当RocketMQ使用SQL过滤时,The broker does not support consumer to filter message by SQL92解决

当RocketMQ使用SQL过滤时,启动程序报错The broker does not support consumer to filter me加粗样式ssage by SQL92

当启动服务时会报错

报错信息如下

Exception in thread "main" org.apache.rocketmq.client.exception.MQClientException: CODE: 1  DESC: The broker does not support consumer to filter message by SQL92
For more information, please visit the url, http://rocketmq.apache.org/docs/faq/

截图如下:
在这里插入图片描述

这是因为默认的broker并没有开启对SQL语法的支持,需要修改配置:

打开broker服务器下的broker.conf文件

cd rocketmq/bin
ll
vim broker.conf

当前配置项

在这里插入图片描述

需要添加配置项

enablePropertyFilter=true

修改后的broker.conf配置文件
在这里插入图片描述
然后重新启动broker,并指定刚刚修改的conf配置文件

sh mqbroker -n localhost:9876 -c ../conf/broker.conf 

再次发送消息启动程序,就不会报错。

猜你喜欢

转载自blog.csdn.net/zhangzengxiu/article/details/119083240