poorbarcode commented on code in PR #20958:
URL: https://github.com/apache/pulsar/pull/20958#discussion_r1301159436
##########
pulsar-websocket/src/main/java/org/apache/pulsar/websocket/ProducerHandler.java:
##########
@@ -356,7 +479,27 @@ protected ProducerBuilder<byte[]>
getProducerBuilder(PulsarClient client) {
builder.addEncryptionKey(key);
}
}
- return builder;
+ }
+
+ private void printWarnLogIfSettingBatchedParams() {
+ if (clientSideEncrypt &&
queryParams.containsKey("batchingMaxMessages")) {
+ log.warn("Since clientSideEncrypt is true, the param
batchingEnabled of producer will be ignored");
+ }
+ if (queryParams.containsKey("batchingMaxMessages")) {
+ log.warn("Since batchingEnabled is false, the param
batchingMaxMessages of producer will be ignored");
+ }
+ if (queryParams.containsKey("maxPendingMessages")) {
+ log.warn("Since batchingEnabled is false, the param
maxPendingMessages of producer will be ignored");
+ }
+ if (queryParams.containsKey("batchingMaxPublishDelay")) {
+ log.warn("Since batchingEnabled is false, the param
batchingMaxPublishDelay of producer will be ignored");
+ }
+ }
Review Comment:
The parameters `batchingMaxMessages`, `batchingMaxMessages`,
`maxPendingMessages`, `batchingMaxPublishDelay`, and `compressionType` will be
discarded when a WSS producer is registering with a JSON typed
`encryptionKeys`. Print these logs to let users know these parameters will not
be used. Maybe print a INFO level log is better?
And this behavior was explained in the PIP
https://github.com/apache/pulsar/pull/20923/files#diff-bdaca0e5fd3a5a0847fa77db82b66797d718cf469c90e81a0755a7e8eaa67c2fR96-R97
##########
pulsar-websocket/src/main/java/org/apache/pulsar/websocket/ProducerHandler.java:
##########
@@ -356,7 +479,27 @@ protected ProducerBuilder<byte[]>
getProducerBuilder(PulsarClient client) {
builder.addEncryptionKey(key);
}
}
- return builder;
+ }
+
+ private void printWarnLogIfSettingBatchedParams() {
+ if (clientSideEncrypt &&
queryParams.containsKey("batchingMaxMessages")) {
+ log.warn("Since clientSideEncrypt is true, the param
batchingEnabled of producer will be ignored");
+ }
+ if (queryParams.containsKey("batchingMaxMessages")) {
+ log.warn("Since batchingEnabled is false, the param
batchingMaxMessages of producer will be ignored");
+ }
+ if (queryParams.containsKey("maxPendingMessages")) {
+ log.warn("Since batchingEnabled is false, the param
maxPendingMessages of producer will be ignored");
+ }
+ if (queryParams.containsKey("batchingMaxPublishDelay")) {
+ log.warn("Since batchingEnabled is false, the param
batchingMaxPublishDelay of producer will be ignored");
+ }
+ }
Review Comment:
The parameters `batchingMaxMessages`, `batchingMaxMessages`,
`maxPendingMessages`, `batchingMaxPublishDelay`, and `compressionType` will be
discarded when a WSS producer is registering with a JSON typed
`encryptionKeys`. Print these logs to let users know these parameters will not
be used. Maybe print an INFO level log is better?
And this behavior was explained in the PIP
https://github.com/apache/pulsar/pull/20923/files#diff-bdaca0e5fd3a5a0847fa77db82b66797d718cf469c90e81a0755a7e8eaa67c2fR96-R97
--
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]