Skip to content

Commit

Permalink
update to latest kafka streams framework (#456)
Browse files Browse the repository at this point in the history
* update to latest kafka streams framework

* vuln fix
  • Loading branch information
Kishan Sairam Adapa authored Feb 22, 2024
1 parent aca9577 commit d0e409f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ hypertrace-attribute-service = "0.14.38"
hypertrace-config-service = "0.1.60"
hypertrace-grpc-utils = "0.12.6"
hypertrace-serviceFramework = "0.1.68"
hypertrace-kafkaStreams = "0.4.4"
hypertrace-view-generator = "0.4.21"
hypertrace-kafkaStreams = "0.4.7"
hypertrace-view-generator = "0.4.24"
grpc = "1.57.2"

[libraries]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.hypertrace.core.grpcutils.client.GrpcChannelConfig;
import org.hypertrace.core.grpcutils.client.GrpcChannelRegistry;
import org.hypertrace.core.grpcutils.client.RequestContextClientCallCredsProviderFactory;
import org.hypertrace.core.kafka.event.listener.KafkaConsumerUtils;
import org.hypertrace.core.kafka.event.listener.KafkaLiveEventListener;
import org.hypertrace.entity.change.event.v1.EntityChangeEventKey;
import org.hypertrace.entity.change.event.v1.EntityChangeEventValue;
Expand Down Expand Up @@ -99,7 +100,7 @@ public DefaultClientRegistry(
EntityServiceClientConfig.from(config).getCacheConfig(),
cacheLoaderExecutor);
this.entityChangeEventListener =
getEntityChangeEventConsumer(config, edsCacheClient::updateBasedOnChangeEvent);
getEntityChangeEventListener(config, edsCacheClient::updateBasedOnChangeEvent);
this.entityDataClient = EntityDataClient.builder(this.entityServiceChannel).build();
this.entityCache = new EntityCache(this.edsCacheClient, cacheLoaderExecutor);
this.entityAccessor =
Expand Down Expand Up @@ -197,7 +198,7 @@ protected Channel buildChannel(String host, int port, GrpcChannelConfig grpcChan
}

private static Optional<KafkaLiveEventListener<EntityChangeEventKey, EntityChangeEventValue>>
getEntityChangeEventConsumer(
getEntityChangeEventListener(
Config clientsConfig, BiConsumer<EntityChangeEventKey, EntityChangeEventValue> callback) {
if (clientsConfig.hasPath(ENTITY_CHANGE_EVENTS_CONSUMER_ENABLED_KEY)
&& clientsConfig.getBoolean(ENTITY_CHANGE_EVENTS_CONSUMER_ENABLED_KEY)) {
Expand All @@ -206,14 +207,17 @@ protected Channel buildChannel(String host, int port, GrpcChannelConfig grpcChan
Collections.singletonMap(
"schema.registry.url",
clientsConfig.getString(ENTITY_CHANGE_EVENTS_SCHEMA_REGISTRY_URL_KEY));
Config kafkaConfig = clientsConfig.getConfig(ENTITY_CHANGE_EVENTS_CONFIG_KEY);
return Optional.of(
new KafkaLiveEventListener.Builder<EntityChangeEventKey, EntityChangeEventValue>()
.registerCallback(callback)
.build(
consumerName,
clientsConfig.getConfig(ENTITY_CHANGE_EVENTS_CONFIG_KEY),
getEntityChangeEventKeyDeser(deserConfig),
getEntityChangeEventValueDeser(deserConfig)));
kafkaConfig,
KafkaConsumerUtils.getKafkaConsumer(
kafkaConfig,
getEntityChangeEventKeyDeser(deserConfig),
getEntityChangeEventValueDeser(deserConfig))));
}
return Optional.empty();
}
Expand Down

0 comments on commit d0e409f

Please sign in to comment.