Skip to content

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

Merged
yesnault merged 2 commits into
ovh:masterfrom
docknight:feat/rabbitmq-rpc
Aug 16, 2024
Merged

feat(executor/rabbitmq): Add support for RPC#798
yesnault merged 2 commits into
ovh:masterfrom
docknight:feat/rabbitmq-rpc

Conversation

@docknight
Copy link
Copy Markdown
Contributor

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 <tzavrsnik@gmail.com>
@docknight docknight force-pushed the feat/rabbitmq-rpc branch from 8a4bbb8 to 0e2a062 Compare June 11, 2024 11:49
Copy link
Copy Markdown
Member

@yesnault yesnault left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @docknight

Can you provide some documentation about that into
https://github.com/ovh/venom/blob/master/executors/rabbitmq/README.md please?

Signed-off-by: Tomaž Završnik <tzavrsnik@gmail.com>
@docknight
Copy link
Copy Markdown
Contributor Author

@yesnault I've extended the documentation with an introduction of supported execution types and an example of using the RPC execution type in a testsuite.

@docknight docknight requested a review from yesnault August 14, 2024 19:41
@yesnault
Copy link
Copy Markdown
Member

Thank you @docknight

@yesnault yesnault merged commit 8a094a8 into ovh:master Aug 16, 2024
storagebits pushed a commit to storagebits/venom that referenced this pull request Apr 17, 2026
* feat(executor/rabbitmq): Add support for RPC

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

Signed-off-by: Tomaž Završnik <tzavrsnik@gmail.com>

* docs(executor/rabbitmq): Update RabbitMQ executor docs.

Signed-off-by: Tomaž Završnik <tzavrsnik@gmail.com>
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.

2 participants