chennaji9 opened a new issue, #11319:
URL: https://github.com/apache/rocketmq/issues/11319
### Description
`docs/en/Example_Filter.md` documents SQL92 filtering end to end (grammar,
producer with `putUserProperty`, consumer with `MessageSelector.bySql`) but
never mentions that the broker must be configured with
`enablePropertyFilter=true` before any SQL subscription works:
```java
// common/src/main/java/org/apache/rocketmq/common/BrokerConfig.java:178
private boolean enablePropertyFilter = false;
```
```java
//
broker/src/main/java/org/apache/rocketmq/broker/processor/ClientManageProcessor.java:267
if (!this.brokerController.getBrokerConfig().isEnablePropertyFilter()) {
response.setCode(ResponseCode.SYSTEM_ERROR);
response.setRemark("The broker does not support consumer to filter
message by " + subscriptionData.getExpressionType());
return response;
}
```
A reader who follows the page against a default broker gets `SYSTEM_ERROR`
("The broker does not support consumer to filter message by SQL92") at
`consumer.start()` with no hint from the documentation that a broker-side
switch exists. The bundled example code already knows about this —
`example/src/main/java/org/apache/rocketmq/example/filter/SqlFilterConsumer.java:34`
carries the comment "// Don't forget to set enablePropertyFilter=true in
broker" — but the documentation page does not.
Also, the interface snippet in section 2 is malformed:
```
public void subscribe(finalString topic, final MessageSelector
messageSelector)
```
`finalString` is missing a space (and the line contains a non-breaking space
before `MessageSelector`), so the signature cannot be copied as-is.
### Expected behavior
Section 2 "Usage constraints" should state the `enablePropertyFilter=true`
broker prerequisite (default `false`) with a pointer to
`broker.conf`/`updateBrokerConfig`, and the interface snippet should be
syntactically valid Java.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]