RabbitMQConnectionResolver

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

Description

The RabbitMQConnectionResolver class allows you to resolve RabbitMQ 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

Constructors

NewRabbitMQConnectionResolver

Create new instance of RabbitMQConnectionResolver

NewRabbitMQConnectionResolver() *RabbitMQConnectionResolver

Fields

ConnectionResolver

Connection resolver

ConnectionResolver: *ConnectionResolver

CredentialResolver

Credential resolver

CredentialResolver: *CredentialResolver

Instance methods

Compose

Composes RabbitMQ connection options from connection and credential parameters.

(c *RabbitMQConnectionResolver) Compose(context IContext, connection *ConnectionParams, credential *CredentialParams) (options *ConfigParams, err error)

  • context: IContext - (optional) a context to trace execution through a call chain.
  • connections: *ConnectionParams - connection parameters
  • credential: *CredentialParams - credential parameters
  • returns: (options *ConfigParams, err error) - resolved RabbitMQ connection options

Configure

Configures the component by passing its configuration parameters.

(c *RabbitMQConnectionResolver) Configure(ctx context.Context, config *cconf.ConfigParams)

  • ctx: context.Context - operation context.
  • config: ConfigParams - configuration parameters to be set.

Resolve

Resolves RabbitMQ connection options from connection and credential parameters.

(c *RabbitMQConnectionResolver) Resolve(context IContext) (options *ConfigParams, err error)

  • context: IContext - (optional) a context to trace execution through a call chain.
  • returns: (options *ConfigParams, err error) - resolved RabbitMQ connection options.

SetReferences

Sets references to dependent components.

(c *RabbitMQConnectionResolver) SetReferences(ctx context.Context, references IReferences)

  • ctx: context.Context - operation context.
  • references: IReferences - references to locate the component’s dependencies.