1

I need to test MQTT 5 messages with protobuf-encoded contents. Which brotobuf file to be used in order to convert their contents in plain text and vice versa, is transferred by an user property of each message.

From the Karate docs and this post I know, there must be a way to extend Karate's capabilities for such purposes through external libraries. I think, HiveMQ MQTT Client and protocolbuffers/protobuf from Google could be used for this. But I have no idea of how to get started.

It would be great if anyone could sketch the approach in more detail or point me to a similar example. My Java skills are poor, so any hints are appreciated.

Drunda Nibel
  • 101
  • 6

1 Answers1

0

Since you have seen the other posts, I have nothing more to suggest, and yes this does require you to have some Java knowledge.

But the way this works is that the Java side needs to be done once, in a generic way - and after that you just work in Karate, so if you can get some help only for the Java side - that might be one way to approach it.

I just edited the post you linked to point to this answer also which goes into more detail about the approach: https://stackoverflow.com/a/62826394/143475

So you need to get just one Java class working that can "get" messages, "put" messages and convert messages from / to JSON.

Dharman
  • 30,962
  • 25
  • 85
  • 135
Peter Thomas
  • 54,465
  • 21
  • 84
  • 248