KafkaConnectionResolver

Helper class that resolves a Kafka connection and credential parameters, validates them and generates connection options.

Inherits: IReferenceable, IConfigurable

Description

The KafkaConnectionResolver class is used to resolve Kafka connections and credential parameters, validate them and generate connection options.

Configuration parameters

  • connection(s):
    • discovery_key: (optional) key to retrieve the connection from IDiscovery
    • host: host name or IP address
    • port: port number
    • uri: resource URI or connection string with all parameters in it
  • credential(s):
    • store_key: (optional) key to retrieve the credentials from ICredentialStore
    • username: username
    • password: user’s password

References

  • *:discovery:*:*:1.0 - (optional) IDiscovery services
  • *:credential-store:*:*:1.0 - (optional) credential stores to resolve credentials

Fields

_connectionResolver

Connection resolver

protected _connectionResolver: ConnectionResolver

_credentialResolver

Credential resolver

protected _credentialResolver: CredentialResolver

Instance methods

Compose

Composes Kafka connection options from connection and credential parameters.

public ConfigParams Compose(IContext context, List<ConnectionParams> connections, CredentialParams credential)

Configure

Configures the component by passing its configuration parameters.

public void Configure(ConfigParams config)

  • config: ConfigParams - configuration parameters to be set.

ResolveAsync

Resolves Kafka connection options from connection and credential parameters.

public Task<ConfigParams> ResolveAsync(IContext context)

  • context: IContext - (optional) a context to trace execution through a call chain.
  • returns: Task<ConfigParams> - resolved Kafka connection options.

SetReferences

Sets references to dependent components.

public void SetReferences(IReferences references)

  • references: IReferences - references to locate the component’s dependencies.