example_2.hocon 548 B

12345678910111213141516171819202122232425262728
  1. plugin_kafka {
  2. connection {
  3. bootstrap_hosts = ["10.3.64.223:9192"]
  4. sasl {
  5. mechanism = plain
  6. username = "username"
  7. password = "password"
  8. }
  9. }
  10. producer {
  11. encode_payload_type = base64
  12. }
  13. hooks = [
  14. {endpoint = client.connect}
  15. , {
  16. endpoint = message.publish
  17. filter = "test/#"
  18. kafka_topic = emqx_msg_publish
  19. kafka_message = {
  20. timestamp = "${.timestamp}"
  21. value = "{topic:${.topic},payload:${.payload},qos:${.qos}}"
  22. key = "${.clientid}"
  23. }
  24. }
  25. ]
  26. }