Skip to content

Conversation

@julianladisch
Copy link
Contributor

https://folio-org.atlassian.net/browse/CIRC-2003

Purpose

Fail on startup if Kafka config is invalid.

Otherwise changes to the circulation rules will not be used on check-in and check-out.

Approach

When Kafka listener throws an exception, no longer swallow it but pass it back.

@julianladisch julianladisch requested review from a team and OleksandrVidinieiev December 1, 2025 16:47
@okolawole-ebsco
Copy link

Could this be considered a breaking change? I'm thinking maybe there needs to be more before we get this out there.

@julianladisch
Copy link
Contributor Author

Before this PR the server responded with 200 OK on the /admin/health endpoint. The failing Kafka connection was in the log but not reported on the /admin/health endpoint.

With this PR the /admin/health endpoint does not respond because the HTTP server starts listening only after a connection to Kafka has been made:

10:10:36 [] [] [] [] INFO  Launcher             start:: server starting
10:10:36 [] [] [] [] INFO  ventConsumerVerticle buildConfig:: building config for EventConsumerVerticle
10:10:36 [] [] [] [] INFO  VertxAssistant       Deploying verticle: EventConsumerVerticle
10:10:36 [] [] [] [] INFO  ventConsumerVerticle buildKafkaConfig:: building Kafka config
10:10:36 [] [] [] [] INFO  ventConsumerVerticle buildKafkaConfig:: KafkaConfig(kafkaHost=localhost, kafkaPort=9092, okapiUrl=http://okapi:9130, replicationFactor=1, envId=folio, maxRequestSize=4000000)
10:10:36 [] [] [] [] INFO  ventConsumerVerticle start:: starting verticle
10:10:36 [] [] [] [] INFO  ventConsumerVerticle createConsumers:: creating consumers
10:10:36 [] [] [] [] INFO  afkaModuleIdProvider UniqueKafkaModuleIdProvider:: KafkaAdminClient config: {compression.type=gzip, ssl.protocol=TLSv1.2, enable.idempotence=true, request.timeout.ms=30000, batch.size=16384, ssl.keystore.location=null, bootstrap.servers=localhost:9092, delivery.timeout.ms=120000, retry.backoff.ms=100, key.serializer=org.apache.kafka.common.serialization.StringSerializer, ssl.truststore.type=JKS, security.protocol=PLAINTEXT, ssl.keystore.type=JKS, value.serializer=org.apache.kafka.common.serialization.StringSerializer, ssl.truststore.location=null, ssl.keystore.password=null, ssl.key.password=null, interceptor.classes=org.folio.kafka.interceptors.TenantIdCheckInterceptor, ssl.truststore.password=null, max.in.flight.requests.per.connection=5, linger.ms=0, ssl.endpoint.identification.algorithm=null}
10:10:36 [] [] [] [] INFO  ventConsumerVerticle createConsumer:: creating consumer for event type CIRCULATION_RULES_UPDATED
10:10:36 [] [] [] [] INFO  afkaModuleIdProvider getModuleId:: getting unique module ID: eventType=CIRCULATION_RULES_UPDATED
10:11:36 [] [] [] [] ERROR ventConsumerVerticle start:: verticle start failed
org.apache.kafka.common.KafkaException: Failed to find brokers to send ListGroups
        at org.apache.kafka.clients.admin.KafkaAdminClient$22.handleFailure(KafkaAdminClient.java:3430) ~[mod-circulation.jar:?]
        at org.apache.kafka.clients.admin.KafkaAdminClient$Call.handleTimeoutFailure(KafkaAdminClient.java:942) ~[mod-circulation.jar:?]
        at org.apache.kafka.clients.admin.KafkaAdminClient$Call.fail(KafkaAdminClient.java:908) ~[mod-circulation.jar:?]
        at org.apache.kafka.clients.admin.KafkaAdminClient$TimeoutProcessor.handleTimeouts(KafkaAdminClient.java:1038) ~[mod-circulation.jar:?]
        at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.timeoutPendingCalls(KafkaAdminClient.java:1117) ~[mod-circulation.jar:?]
        at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.processRequests(KafkaAdminClient.java:1471) ~[mod-circulation.jar:?]
        at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.run(KafkaAdminClient.java:1435) ~[mod-circulation.jar:?]
        at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]
Caused by: org.apache.kafka.common.errors.TimeoutException: Timed out waiting for a node assignment. Call: findAllBrokers
10:11:36 [] [] [] [] ERROR Launcher             deployVerticle:: deployment of EventConsumerVerticle failed: org.apache.kafka.common.KafkaException: Failed to find brokers to send ListGroups
java.util.concurrent.CompletionException: org.apache.kafka.common.KafkaException: Failed to find brokers to send ListGroups
…

@julianladisch
Copy link
Contributor Author

I'm thinking maybe there needs to be more before we get this out there.

What more is needed to merge this to master for Trillium?

@julianladisch julianladisch requested review from a team and okolawole-ebsco December 2, 2025 09:33
@okolawole-ebsco
Copy link

I'm thinking maybe there needs to be more before we get this out there.

What more is needed to merge this to master for Trillium?

I'm not sure if our processes handles it, but having this information in the release notes would be good. Otherwise, just an update to NEWS.md will be fine.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 8, 2025

@julianladisch
Copy link
Contributor Author

@okolawole-ebsco: What more is needed to get this merged to master for Trillium?

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
72.7% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants