You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Werner Daehn (Jira)" <ji...@apache.org> on 2020/07/08 17:27:00 UTC

[jira] [Comment Edited] (KAFKA-10226) KStream without SASL information should return error in confluent cloud

    [ https://issues.apache.org/jira/browse/KAFKA-10226?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17153768#comment-17153768 ] 

Werner Daehn edited comment on KAFKA-10226 at 7/8/20, 5:26 PM:
---------------------------------------------------------------

Here is my verdict after testing:

Producer, Consumer, KStreams, AdminClient all do *not* throw an exception. I have not found a method to figure out if the provided values are valid.

 

Test case:

{{try {}}

{{    Map<String, Object> producerprops = new HashMap<>();}}
 {{    producerprops.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, 'pkc-41wq6.eu-west-2.aws.confluent.cloud:1234');}}
 {{    producerprops.put(ProducerConfig.ACKS_CONFIG, "all");}}
 {{    producerprops.put(ProducerConfig.RETRIES_CONFIG, 0);}}
 {{    producerprops.put(ProducerConfig.BATCH_SIZE_CONFIG, 16384);}}
 {{    producerprops.put(ProducerConfig.LINGER_MS_CONFIG, 1);}}
 {{    producerprops.put(ProducerConfig.BUFFER_MEMORY_CONFIG, 33554432);}}
 {{    producerprops.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, ByteArraySerializer.class);}}
 {{    producerprops.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, ByteArraySerializer.class);}}
 {{    this.producer = new KafkaProducer<byte[], byte[]>(producerprops);}}

{{} catch (Throwable e) {}}
 {{    e.printStacktrace();}}
 {{}}}

 

If you execute this code segment it will not create an exception, although the port is not valid for sure. Just by looking at the this.producer I cannot tell if the connection is valid or not.
 When a end user configures the Kafka properties, the expectation is to get concise feedback.

Invalid hostname I get as feedback. Invalid port or security I do not.

 

As this is so basic, I wonder why nobody has ever raised that or rather I do not know something. Any ideas?

 


was (Author: wdaehn):
Here is my verdict after testing:

Producer, Consumer, KStreams, AdminClient all do *not* throw an exception. I have not found a method to figure out if the provided values are valid.

 

Test case:

{{try {}}

{{    Map<String, Object> producerprops = new HashMap<>();}}
{{    producerprops.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, 'wrong.aws.confluent.cloud:9092');}}
{{    producerprops.put(ProducerConfig.ACKS_CONFIG, "all");}}
{{    producerprops.put(ProducerConfig.RETRIES_CONFIG, 0);}}
{{    producerprops.put(ProducerConfig.BATCH_SIZE_CONFIG, 16384);}}
{{    producerprops.put(ProducerConfig.LINGER_MS_CONFIG, 1);}}
{{    producerprops.put(ProducerConfig.BUFFER_MEMORY_CONFIG, 33554432);}}
{{    producerprops.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, ByteArraySerializer.class);}}
{{    producerprops.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, ByteArraySerializer.class);}}
{{    this.producer = new KafkaProducer<byte[], byte[]>(producerprops);}}

{{} catch (Throwable e) {}}
{{    e.printStacktrace();}}
{{}}}

 

If you execute this code segment it will not create an exception, although the hostname is not running a Kafka instance for sure. Just by looking at the this.producer I cannot tell if the connection is valid or not.
When a end user configures the Kafka properties, the expectation is to get concise feedback. hostname cannot be resolved. server refuses connection at that port. Server does not respond. Endpoint is fine but the security settings are missing.

 

As this is so basic, I wonder why nobody has ever raised that or rather I do not know something. Any ideas?

 

> KStream without SASL information should return error in confluent cloud
> -----------------------------------------------------------------------
>
>                 Key: KAFKA-10226
>                 URL: https://issues.apache.org/jira/browse/KAFKA-10226
>             Project: Kafka
>          Issue Type: Bug
>          Components: clients, streams
>    Affects Versions: 2.5.0
>            Reporter: Werner Daehn
>            Priority: Minor
>
> I have create a KStream against the Confluent cloud and wondered why no data has been received from the source. Reason was that I forgot to add the SASL api keys and secrets.
>  
> For end users this might lead to usability issues. If the KStream wants to read from a topic and is not allowed to, this should raise an error, not be silently ignored.
>  
> Hoe do producer/consumer clients handle that situation?



--
This message was sent by Atlassian Jira
(v8.3.4#803005)