Skip to content

Kafka header from feeder #110

Open
Open
@Killen911

Description

@Killen911

Hi.
Is possible to send kafka headers from feeder in this plugin?
Need something like this:
.exec(kafka("my-topic").send[String,String]("{ \"kafka\": \"message\"", session => session("headers")))

Activity

3alster

3alster commented on Feb 6, 2023

@3alster

It's possible to set a header from a session parameter like this

   .exec(s => s.set("custom", new RecordHeaders().add("test-header", s("kekey").as[Array[Byte]])))
   .exec(
      kafka("BasicRequest")
        .send[String, String]("foo", "foo", "#{custom}"),
    )```
partheebanMani

partheebanMani commented on Jun 14, 2023

@partheebanMani

@3alster I tried as suggested in Java, but I am getting error as header is in string , expected is 'Header' format

WhatsApp Image 2023-06-14 at 15 16 39

3alster

3alster commented on Jul 6, 2023

@3alster

Hi @partheebanMani, that's because you mixed up the types, just use RecordHeaders type instead of the Session for the headers variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

        Participants

        @3alster@Killen911@partheebanMani

        Issue actions

          Kafka header from feeder · Issue #110 · Tinkoff/gatling-kafka-plugin