dubee commented on a change in pull request #264: remove use of
messageHubProduce action in health test and use java producer
URL:
https://github.com/apache/incubator-openwhisk-package-kafka/pull/264#discussion_r182158374
##########
File path: tests/src/test/scala/system/health/BasicHealthTest.scala
##########
@@ -163,15 +166,21 @@ class BasicHealthTest
val key = "TheKey"
println("Producing a message")
- withActivation(wsk.activation,
wsk.action.invoke(s"$messagingPackage/$messageHubProduce", Map(
- "user" -> kafkaUtils.getAsJson("user"),
- "password" -> kafkaUtils.getAsJson("password"),
- "kafka_brokers_sasl" -> kafkaUtils.getAsJson("brokers"),
- "topic" -> topic.toJson,
- "key" -> key.toJson,
- "value" -> currentTime.toJson
- ))) {
- _.response.success shouldBe true
+ val producer = kafkaUtils.createProducer()
+ val record = new ProducerRecord(topic, key, currentTime)
+ val future = producer.send(record)
+
+ producer.flush()
+ producer.close()
Review comment:
Is it safe to close the producer before we are guaranteed that the message
was sent?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services