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

Merged
merged 2 commits into from
Aug 16, 2024

Conversation

docknight
Copy link
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
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
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
Member

Thank you @docknight

@yesnault yesnault merged commit 8a094a8 into ovh:master Aug 16, 2024
2 checks passed
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