diff options
author | Adheli Tavares <adheli.tavares@est.tech> | 2023-12-18 16:26:59 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2023-12-18 16:26:59 +0000 |
commit | 0813b37bd1f7421f1a777fdaff0e05f9b035fa32 (patch) | |
tree | 4c57df885b7fd917f0481125003089aaf82f66d5 | |
parent | eaa1466a8da236f6a069dfa0c647dc35711716e6 (diff) | |
parent | 01795004ab3cda12d3d3aa1fbeb341e0067a19cf (diff) |
Merge "Add default fetch timeout for kafka client"
-rw-r--r-- | policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/IndexedKafkaTopicSourceFactory.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/IndexedKafkaTopicSourceFactory.java b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/IndexedKafkaTopicSourceFactory.java index 45a8be3f..1d586e43 100644 --- a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/IndexedKafkaTopicSourceFactory.java +++ b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/event/comm/bus/IndexedKafkaTopicSourceFactory.java @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2022 Nordix Foundation. + * Copyright (C) 2022-2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -96,6 +96,8 @@ class IndexedKafkaTopicSourceFactory implements KafkaTopicSourceFactory { .servers(servers) .topic(topic) .managed(true) + .fetchTimeout(PolicyEndPointProperties.DEFAULT_TIMEOUT_MS_FETCH) + .fetchLimit(PolicyEndPointProperties.DEFAULT_LIMIT_FETCH) .useHttps(false).build()); } @@ -117,6 +119,15 @@ class IndexedKafkaTopicSourceFactory implements KafkaTopicSourceFactory { } var kafkaTopicSource = this.build(KafkaPropertyUtils.makeBuilder(props, topic, servers) + .consumerGroup(props.getString( + PolicyEndPointProperties.PROPERTY_TOPIC_SOURCE_CONSUMER_GROUP_SUFFIX, null)) + .consumerInstance(props.getString( + PolicyEndPointProperties.PROPERTY_TOPIC_SOURCE_CONSUMER_INSTANCE_SUFFIX, null)) + .fetchTimeout(props.getInteger( + PolicyEndPointProperties.PROPERTY_TOPIC_SOURCE_FETCH_TIMEOUT_SUFFIX, + PolicyEndPointProperties.DEFAULT_TIMEOUT_MS_FETCH)) + .fetchLimit(props.getInteger(PolicyEndPointProperties.PROPERTY_TOPIC_SOURCE_FETCH_LIMIT_SUFFIX, + PolicyEndPointProperties.DEFAULT_LIMIT_FETCH)) .build()); newKafkaTopicSources.add(kafkaTopicSource); |