Gatling kafka plugin - can not use feeder in protobuf messages

Hi,

I started using ru.tinkoff java kafka plugin recommended on Gatling site.
I need to send protobuf kafka message serialized in byte array, but I can not use feeder in send method.

.exec(kafka(“ReqRep”)
.requestReply()
.requestTopic(“inboundTopic”)
.replyTopic(“outboundTopic”)
.send(“#{INCREMENT_NUMBER}”,
EventWrapperBuilder
.createEvent(“#{INCREMENT_NUMBER}”, “#{EVENT_TYPE}”).toByteArray(),
headers,
String.class, byte.class)
)

First param in send method (“#{INCREMENT_NUMBER}”) will work fine, because it’s string, and send() method will recognize it’s value from feeder session, it will take correct number from feeder (1, 2, 3…).
Second param doesn’t work because my custom method will see both values as constants (instead of 1,2,3 it will put constant #{INCREMENT_NUMBER}" and “#{EVENT_TYPE}”.

I also tried to put this byte array value in exec method before:
.exec(session → {
Map<String, Object> sessionAttributes = new HashMap<>();
sessionAttributes.put(“EVENT”, EventWrapperBuilder.createEvent(“INCREMENT_NUMBER”, generateRandomEventCase()).toByteArray());
return session.setAll(sessionAttributes);
})
but this again doesn’t work because in send method java compiler doesn’t allow me to use byte array serialization - java sees my session argument “#{EVENT}” as string (and if I use string.getBytes() to convert to byte array, I’m again getting constant instead of feeder value.

So, please advice if I’m doing something wrong, otherwise it seems that kafka plugin you are recommending is not capable to send protobuf message with feeder, which is industry standard. It can just send “new MyClass()” with constant values.

Any advice?

Best regards,
Mirjana

Hi @mirjana.bojanic,
Since this is a community plugin, it is probably best to post this as an issue on the plugin GitHub repository. There is also a new community Kafka plugin that you might want to try: GitHub - Amerousful/gatling-kafka: Gatling plugin for Kafka

Hi Shaun,

Thank you for suggesting another plugin, but I’m trying to find java plugin.

At first, I wanted to open this ticket on thinkoff GitHub, but there are similar two topics (cause problem is the same - you can not access feeder session from send method):

I will add my comments on these two.

Regards,
Mirjana

Hi Mirjana, I have sent your feedback to our Product team.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.