Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(executor/rabbitmq): Add support for RPC #798

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

docknight
Copy link

Description

Introduced new client type to use for testing RPC pattern using Direct Reply-to.
This can not be achieved using existing client types (publisher and subscriber), because a Direct reply-to has some specific requirements and the client must have a reply consumer running before publishing a request.
The new client type is simply referred to as 'client' to indicate a client-server communication using RPC pattern.
It can be used to test a server that is expected to respond to the received message by sending a reply using Direct Reply-to feature of RabbitMQ.

Usage

Example testsuite:

name: TestSuite RabbitMQ
testcases:
  - name: Send data and await reply
    steps:
      - type: rabbitmq
        addrs: "{{.addrs}}"
        user: "{{.user}}"
        password: "{{.password}}"
        clientType: client
        exchange: test-exchange
        exchangeType: direct
        durable: true
        routingKey: OrderDetailsRequest
        messages: 
          - value: '{{.messageFromVariableFile}}'
            contentType: application/json
            contentEncoding: utf8
            persistant: false
            durable: true
        assertions: 
          - result.bodyjson.bodyjson0 ShouldContainKey Status
          - result.bodyjson.bodyjson0.Status ShouldEqual Ok

In the above example, a direct-reply-to consumer will first be started and then a message will be published to the exchange using the provided routing key. Then, the test executor will wait for the reply to be received on the direct reply queue. Existing logic of the subscriber client type will be used to parse the results, close the connection and validate against assertions.

Introduced new client type to use for testing RPC pattern using Direct Reply-to.

Signed-off-by: Tomaž Završnik <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant