Skip to content

Add the possibility to match producer and consumed messages using headers instead of just using the message Key. #100

@mmartin-paxos

Description

@mmartin-paxos

With the current solution, it is only possible to match producer and consumed messages using the key from the sent message. However, in our project, we have an internal key change from produced and consumed messages. This means that with the current implementation we are not able to bind produced messages to consumed one. Therefore Gatling is always returning that the whole flow hasn't been successfully finished.

To solve this issue It can be possible to match consumed and produced messages using some customizable headers, such as correlation-id.

The test scenario would look like snipped below after adding the configurable Headers option:

  val scn: ScenarioBuilder = scenario("Test kafka")
    .feed(feeder)
    .exec(
      kafka("ReqRep")
        .requestReply
        .requestTopic("exp.inbound")
        .replyTopic("exp.outbound", Some("correlation-id"))
        .send[String, String]("test-key", "#{payload}", addHeader("correlation-id", "#{correlationId}"))

In order to make this configurable headers option, we already create a Proof of concept.
You can have a look at the last 3 commits of this Repo: https://github.com/imaculan/gatling-kafka-plugin/commits/header_extractor.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions