@@ -250,15 +250,14 @@ public class Kafka3ConnectionService extends AbstractControllerService implement
250
250
private static final String CONNECTION_STEP = "Kafka Broker Connection" ;
251
251
private static final String TOPIC_LISTING_STEP = "Kafka Topic Listing" ;
252
252
253
- private volatile Properties clientProperties ;
254
253
private volatile ServiceConfiguration serviceConfiguration ;
255
254
private volatile Properties producerProperties ;
256
255
private volatile Properties consumerProperties ;
257
256
private volatile String uri ;
258
257
259
258
@ OnEnabled
260
259
public void onEnabled (final ConfigurationContext configurationContext ) {
261
- clientProperties = getClientProperties (configurationContext );
260
+ final Properties clientProperties = getClientProperties (configurationContext );
262
261
serviceConfiguration = getServiceConfiguration (configurationContext );
263
262
producerProperties = getProducerProperties (configurationContext , clientProperties );
264
263
consumerProperties = getConsumerProperties (configurationContext , clientProperties );
@@ -312,8 +311,7 @@ public KafkaConsumerService getConsumerService(final PollingContext pollingConte
312
311
final ByteArrayDeserializer deserializer = new ByteArrayDeserializer ();
313
312
final Consumer <byte [], byte []> consumer = new KafkaConsumer <>(properties , deserializer , deserializer );
314
313
315
- final Kafka3ConsumerService consumerService = new Kafka3ConsumerService (getLogger (), consumer , subscription );
316
- return consumerService ;
314
+ return new Kafka3ConsumerService (getLogger (), consumer , subscription );
317
315
}
318
316
319
317
private Subscription createSubscription (final PollingContext pollingContext ) {
@@ -360,9 +358,11 @@ public String getBrokerUri() {
360
358
public List <ConfigVerificationResult > verify (final ConfigurationContext configurationContext , final ComponentLog verificationLogger , final Map <String , String > variables ) {
361
359
final List <ConfigVerificationResult > results = new ArrayList <>();
362
360
361
+ // Build Admin Client Properties based on configured values and defaults from Consumer Properties
363
362
final Properties clientProperties = getClientProperties (configurationContext );
364
- clientProperties .putAll (variables );
365
- try (final Admin admin = Admin .create (clientProperties )) {
363
+ final Properties consumerProperties = getConsumerProperties (configurationContext , clientProperties );
364
+ consumerProperties .putAll (variables );
365
+ try (final Admin admin = Admin .create (consumerProperties )) {
366
366
final ListTopicsResult listTopicsResult = admin .listTopics ();
367
367
368
368
final KafkaFuture <Collection <TopicListing >> requestedListings = listTopicsResult .listings ();
0 commit comments