liunaijie commented on code in PR #6657:
URL: https://github.com/apache/seatunnel/pull/6657#discussion_r1561957270
##########
seatunnel-connectors-v2/connector-kafka/src/main/java/org/apache/seatunnel/connectors/seatunnel/kafka/sink/KafkaSinkFactory.java:
##########
@@ -39,23 +39,26 @@ public String factoryIdentifier() {
@Override
public OptionRule optionRule() {
return OptionRule.builder()
- .required(Config.FORMAT, Config.BOOTSTRAP_SERVERS)
- .conditional(
- Config.FORMAT,
- Arrays.asList(
- MessageFormat.JSON,
- MessageFormat.CANAL_JSON,
- MessageFormat.TEXT,
- MessageFormat.OGG_JSON,
- MessageFormat.AVRO),
- Config.TOPIC)
+ .required(Config.TOPIC, Config.BOOTSTRAP_SERVERS)
.optional(
+ Config.FORMAT,
Config.KAFKA_CONFIG,
Config.ASSIGN_PARTITIONS,
Config.TRANSACTION_PREFIX,
Config.SEMANTICS,
Config.PARTITION,
Config.PARTITION_KEY_FIELDS)
+ .conditional(
Review Comment:
removed.
I have some question about the `optional` rule. we know if in `required`,
then we must pass the parameter. if in `optional`, we can pass or not pass this
parameter.
But we still can pass some unknown parameter to the config, like this
```hacon
sink {
kafka {
topic = ""
bootstrap.servers = ""
k1 = v1
k2 = v2
}
}
```
i pass 2 parameter k1 and k2. it is not in option list and won't be use in
feature.
So what's the `option` rule value? it can't control anything
--
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]