Skip to content

Add support for AMQP #199

Description

@diedoman

Reason/Context

The required function to set up the AMQP connection is already present in the connections package, but not yet exported under the ensemble package.

After forking the repo and adding this function I was able to get RabbitMQ events sent by our application validated using microcks-testcontainers-go, so the used containers seem to support this as well.

Description

As mentioned above, I was able to successfully validate events that were sent from our application to rabbitMQ using AMQP. Some small 'bumps' that I ran into in the process:

  • You cannot use the ensemble.WithSecret() function when using async. It tries to use the API client against the asyncminion instead of the microcks container. I did some local changes to make it use the microcks container instead, but doing so causes the testcontainers to fail their setup (no clue why). As a workaround I used the microcks go-client manually after starting ensemble, which works fine
  • when you send a TestRequest with FilteredOperations, and the operation does not exist, no error is returned. Your test will succeed (success: True) and error will be unset. Not sure if this is intended behaviour or not.
  • the client-go package in go.mod is set to v0.3.0, but there is also a tag for 0.4.0? I think maybe something went wrong when tagging it, because go.mod cannot find it itself (probably because of the missing v in front of the version)

Implementation ideas

Export a function to set AMQP connection

// WithAMQPConnection configures a connection to an AMQP Broker.
func WithAMQPConnection(connection generic.Connection) Option {
	return func(e *MicrocksContainersEnsemble) error {
		e.asyncMinionContainerOptions.Add(async.WithAMQPConnection(connection))
		return nil
	}
}

Add simple testcase with ensemble and RabbitMQ

Would make sense to include a testcase that spins up RMQ with ensemble next to it, so as to validate the proper behaviour of the above function

ExternalSecrets

As mentioned, using the ExternalSecrets function did not work out because the asyncminion is being addressed instead of the Microcks container. After changing this locally I was not able to get it running either. Did not see any testcases surrounding the ExternalSecrets function, so perhaps it is not working as expected? I think it would make more sense to handle this in a separate issue description (if so, please let me known so I can add a separate issue for that then).

Metadata

Metadata

Assignees

No one assigned

    Labels

    component/settingsRelates to API/settings availableskeep-openKeep open to avoid stale botkind/enhancementEnhancement of existing feature

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions