apache / rocketmq

Apache RocketMQ is a cloud native messaging and streaming platform, making it simple to build event-driven applications.
https://rocketmq.apache.org/
Apache License 2.0
21.28k stars 11.71k forks source link

sql98 cannot support at rocketmq 4.2.0 #310

Closed xgj1988 closed 6 years ago

xgj1988 commented 6 years ago

There is a error . Exception in thread "main" org.apache.rocketmq.client.exception.MQClientException: CODE: 1 DESC: The broker does not support consumer to filter message by SQL92

But I see the code source,I cannot set enablePropertyFilter = true in broker.conf 。There is not API to modify the property .

dominicqi commented 6 years ago

@xgj1988 为什么不能在配置文件中设置 enablePropertyFilter = true 呢?我的版本也是4.2.0. 我在配置文件中设置enablePropertyFilter=true是生效的。或者你可以在启动的时候使用./mqbroker enablePropertyFilter=ture. Admin Tool中的UpdateBrokerConfigSubCommand 应该可以动态修改。

xgj1988 commented 6 years ago

@dominicqi 是这样配置撒。。 在broker.conf里面增加 enablePropertyFilter = true ,true 应该是大小写都如所谓撒。(应该是broker.conf里面加吧。。中间有空格吧)。其实关键是我看他的源代码,BrokerConfig.java 里面 调用setPropertyFilter地方木有啊(只有 IntegrationTestBase 这里面调用了。)。

dominicqi commented 6 years ago

@xgj1988 MixAll.properties2Object(properties, brokerConfig); 你可以看下BrokerStartup.java中的启动流程。这部分配置是通过反射实现的.

xgj1988 commented 6 years ago

@dominicqi 好嘛。。启动的时候要带上 -c ../conf/broker.conf 但是要他的 spring-boot-starter-rocketmq rocketMQTemplate 不支持 setUserPropertiy 。

xgj1988 commented 6 years ago

@dominicqi 是可以的。。但是就是会自动带上USES_,,放在headers 里面

vsair commented 6 years ago

Hi, you could add enablePropertyFilter=true to broker's config file, or you could use tool mqadmin to update this property dynamic.