Skip to content

Using session attributes inside the avro object builder #21

Open
s-danilov opened this issue Jun 1, 2021 · 2 comments
Open

Using session attributes inside the avro object builder #21

s-danilov opened this issue Jun 1, 2021 · 2 comments
Assignees

Comments

@s-danilov
Copy link

Hi there,
Could you please add the ability to use session attributes in the avro object builder.
For example, I use this code

exec( _.set("text", "Hello"))
.exec(
 kafka("incomeMsg")
 .send("myTopic",
           AvroObject
             .newBuilder()
             .setMessage("${text}")
             .build())
       ) 

I expect that the instance of AvroObject will contain field "Message"="Hello", but it's equal to "${text}", like String

@jigarkhwar jigarkhwar self-assigned this Jun 9, 2021
@Karamanoleff
Copy link

Karamanoleff commented Jun 15, 2021

Hi,
I am facing similar issue when trying to use feeder for kafka messages. This is my example code:

val feeder = Array(
    Map("foo" -> "foo1", "bar" -> "bar1"),
    Map("foo" -> "foo2", "bar" -> "bar2"),
    Map("foo" -> "foo3", "bar" -> "bar3")
  ).random

  val scn = scenario("Kafka Test")
    .feed(feeder)
    .exec(kafka("request")
      .send[String, String]("${foo}", "${bar}"))

In the topic I get "${foo}" for key and "${bar}" for value, instead of their values from feeder (foo1, bar1 ... etc).
Probably related to the issue described above.

@fherling
Copy link

fherling commented Jan 31, 2022

Hi, I am also facing the issue that I cannot inject random avro message to the send method.
Do you have any information if a fix will be available soon?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants