Hello everyone.
Let’s cut to the chase.
I have Scala function that just posts some messages to Kafka topic hence it returns Unit type.
Obviously I can’t use this function in scenario since exec expects Chainbuilder type.
Desperately trying to figure out how to make it return proper type but I can’t due to lack of Scala experience.
All tries led to failure.
Function:
def sendMessage(topic: String, request: Vector[Map[String, String]]) = {
println("sending messages...")
val generatedMessages = request.flatMap(_.map { request => new KeyedMessage[String, String](topic, request._1, request._2) })
producer.send(queueMessages: _*)
}
`
val messages = Vector(Map(“foo” → “bar”), Map(“foo1” → “bar1”))
val publishMessages = kafkaProducer.sendKeyedMessages(Config.Kafka.topic, messages)
`
Hoping for assistance…
Regards,
Oleg