Interface OdysseyRequestManager
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
DefaultOdysseyRequestManager
Interface for managing asynchronous requests to Odyssey (Schema Registry).
Implementation ensures Controller threads are not blocked waiting for external service calls.
When Odyssey is disabled, the integration manager is null and the legacy code path is used instead - no request manager is instantiated.
For each Odyssey request (which may be a batch), a single SchemaRegistryClient should be
created using createClient(String) and passed to both validate and createAssociations.
This ensures connection reuse within a request while avoiding global client caching.
Implementations:
- DefaultOdysseyRequestManager: Full implementation with HTTP calls to Schema Registry
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Gracefully shuts down the manager, cleaning up resources.createAssociations(List<TopicAssociationInfo> topics, boolean topicAlreadyExists, io.confluent.kafka.schemaregistry.client.SchemaRegistryClient client) Creates associations with Odyssey.io.confluent.kafka.schemaregistry.client.SchemaRegistryClientcreateClient(String schemaRegistryUrl) Creates a SchemaRegistryClient for the given URL.validate(Map<String, ParsedAssociations> topicAssociations, String namespace, io.confluent.kafka.schemaregistry.client.SchemaRegistryClient client)
-
Method Details
-
createClient
io.confluent.kafka.schemaregistry.client.SchemaRegistryClient createClient(String schemaRegistryUrl) Creates a SchemaRegistryClient for the given URL. The client should be reused for all operations within a single Odyssey request.- Parameters:
schemaRegistryUrl- The Schema Registry endpoint URL- Returns:
- A configured SchemaRegistryClient (with cacheCapacity=0 for minimal overhead)
-
validate
CompletableFuture<Map<String, OdysseyResult>> validate(Map<String, ParsedAssociations> topicAssociations, String namespace, io.confluent.kafka.schemaregistry.client.SchemaRegistryClient client) -
createAssociations
CompletableFuture<Map<String, OdysseyResult>> createAssociations(List<TopicAssociationInfo> topics, boolean topicAlreadyExists, io.confluent.kafka.schemaregistry.client.SchemaRegistryClient client) Creates associations with Odyssey.- Parameters:
topics- List of topics with their association informationtopicAlreadyExists- If true, uses INSERT-only semantics (topic already exists)client- The SchemaRegistryClient- Returns:
- CompletableFuture with Map of topic name to result
-
close
void close()Gracefully shuts down the manager, cleaning up resources.- Specified by:
closein interfaceAutoCloseable
-