Skip to content

Support for functional listeners with multiple outputs #1543

Open
@mzalewski82

Description

@mzalewski82

Currently contract tests support only one output message.
Spring Cloud Stream since 3.0 has support for functional listeners with multiple input and output messages:
https://docs.spring.io/spring-cloud-stream/docs/3.0.8.RELEASE/reference/html/spring-cloud-stream.html#_functions_with_multiple_input_and_output_arguments

I'd like to have support for multiple output messages. In Groovy API it could look like:

outputMessages ([
    outputMessage {
        sentTo("myOutputExchange1")
        body([
                "text": $(anyNonBlankString())
        ])
    },
    outputMessage {
        sentTo("myOutputExchange2")
        body([
                "text": $(anyNonBlankString())
        ])
    }
])

The only way to handle this situation currently is contract per output but it'a an incomplete and hacky solution.

Sample project with multi output:
https://github.com/mzalewski82/contract-test-challenges/tree/main/multiple-outputs

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions