You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2020/12/28 15:26:20 UTC

[GitHub] [camel-kafka-connector] apupier opened a new issue #821: Investigate usage of NO_DEFAULT_VALUE instead of null for properties

apupier opened a new issue #821:
URL: https://github.com/apache/camel-kafka-connector/issues/821


   All properties without explicit default values are exposed with the `null` identifier.
   In Camel Kafka Configef, there is a specific Object when there is no Default Value [org.apache.kafka.common.config.ConfigDef.NO_DEFAULT_VALUE](https://github.com/a0x8o/kafka/blob/b324a6a2bf26e9ee0b5b34252a3b251859c624fe/clients/src/main/java/org/apache/kafka/common/config/ConfigDef.java#L85) .
   
   it sounds better to use it as I think that what is really wanted is to say that there is no default value, not that the default value is `null`
   
   nota: using a Properties file, i do not think that we can express that the provided value is null.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [camel-kafka-connector] valdar commented on issue #821: Investigate usage of NO_DEFAULT_VALUE instead of null for properties

Posted by GitBox <gi...@apache.org>.
valdar commented on issue #821:
URL: https://github.com/apache/camel-kafka-connector/issues/821#issuecomment-752802728


   I seem to remember, but I will double check, that properties with `ConfigDef.NO_DEFAULT_VALUE` requires a value to be specified in the config properties... otherwise an error is thrown at connector startup; basically meaning that there is no way to have an "optional no default value properties".


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [camel-kafka-connector] apupier commented on issue #821: Investigate usage of NO_DEFAULT_VALUE instead of null for properties

Posted by GitBox <gi...@apache.org>.
apupier commented on issue #821:
URL: https://github.com/apache/camel-kafka-connector/issues/821#issuecomment-752128393


   The ConfigDefs have null values. Consequently, I think that the table in documentation are generated with null displayed. Also the ConfigDef.hasDefaultValue() method returns true although the property has no default value.
   
   here it is planned that it would display "none": https://github.com/valdar/camel-kafka-connector/commit/c89703d5b19fa45ca30ec24e75fc6e92ed028439#diff-b35efa8afb4067fa0c36710e7cb3fe91b124cb6d1d9725bbcaf739c2af5c4e6bR33 but it is never the case as the ConfigDef.NO_DEFAULT_VALUE is never used.
   
   to avoid another layer of indirection, the COnfigDef are provided directly through the catalog for the "Basic configuration": https://github.com/valdar/camel-kafka-connector/blob/b07fd705f91eac57d7ba09e0959f9f2ec496e85c/camel-kafka-connector-catalog/src/main/java/org/apache/camel/kafkaconnector/catalog/CamelKafkaConnectorCatalog.java#L185-L191
   
   
   Can you clarify what is the limitation with Camel?
   I do not understand what is limiting the fact to use the ConfigDef.NO_DEFAULT_VALUE in the config def. The Kafka properties reader is not returning null when asking for a property that is not explicitly set in case the ConfigDef.NO_DEFAULT_VALUE is set in the ConfigDef?
   
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [camel-kafka-connector] valdar closed issue #821: Investigate usage of NO_DEFAULT_VALUE instead of null for properties

Posted by GitBox <gi...@apache.org>.
valdar closed issue #821:
URL: https://github.com/apache/camel-kafka-connector/issues/821


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [camel-kafka-connector] valdar commented on issue #821: Investigate usage of NO_DEFAULT_VALUE instead of null for properties

Posted by GitBox <gi...@apache.org>.
valdar commented on issue #821:
URL: https://github.com/apache/camel-kafka-connector/issues/821#issuecomment-752122629


   The problem is that camel has no such distinction, `null` means "there is no default value". So what we decided to do in https://github.com/apache/camel-kafka-connector/issues/563 was to keep null and remove `defaultValue` attribute from json catalog if there is no default value (i.e. if default value is `null`)


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [camel-kafka-connector] valdar commented on issue #821: Investigate usage of NO_DEFAULT_VALUE instead of null for properties

Posted by GitBox <gi...@apache.org>.
valdar commented on issue #821:
URL: https://github.com/apache/camel-kafka-connector/issues/821#issuecomment-757982541


   I confirm that properties with `ConfigDef.NO_DEFAULT_VALUE` requires a value to be specified in the actual config properties file. 
   So I close this, if you have any further suggestion or better idea how to handle this feel free to reopen it and comment @apupier .


----------------------------------------------------------------
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:
users@infra.apache.org