bakaid commented on a change in pull request #654: MINIFICPP-1050 - Make
PublishKafka's Delivery Guarantee backwards com…
URL: https://github.com/apache/nifi-minifi-cpp/pull/654#discussion_r329440946
##########
File path: extensions/librdkafka/PublishKafka.cpp
##########
@@ -411,6 +414,21 @@ bool PublishKafka::createNewTopic(const
std::shared_ptr<KafkaConnection> &conn,
value = "";
if (context->getProperty(DeliveryGuarantee.getName(), value) &&
!value.empty()) {
+ /*
+ * Because of a previous error in this processor, the default value of
this property was "DELIVERY_ONE_NODE".
+ * As this is not a valid value for "request.required.acks", the following
rd_kafka_topic_conf_set call failed,
+ * but because of an another error, this failure was silently ignored,
meaning that the the default value for
+ * "request.required.acks" did not change, and thus remained "-1". This
means that having "DELIVERY_ONE_NODE" as
+ * the value of this property actually caused the processor to wait for
delivery ACKs from ALL nodes, instead
+ * of just one. In order not to break configurations generated with
earlier versions and keep the same behaviour
+ * as they had, we have to map "DELIVERY_ONE_NODE" to "-1" here.
+ */
+ if (value == "DELIVERY_ONE_NODE") {
+ value = "-1";
+ logger_->log_warn("Using DELIVERY_ONE_NODE as the Delivery Guarantee
property is deprecated and is translated to -1 "
Review comment:
Agreed: https://issues.apache.org/jira/browse/MINIFICPP-1051
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services