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

Werner Daehn commented on KAFKA-10226:
--------------------------------------

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)

Reply via email to