exmaple_1.hocon 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. plugin_kafka {
  2. connection {
  3. client_id = "kafka_client"
  4. bootstrap_hosts = ["10.3.64.223:9192", "10.3.64.223:9292", "10.3.64.223:9392"]
  5. connect_timeout = 5s
  6. connection_strategy = per_partition
  7. min_metadata_refresh_interval = 5s
  8. query_api_versions = true
  9. request_timeout = 3s
  10. sasl {
  11. mechanism = plain
  12. username = "username"
  13. password = "password"
  14. }
  15. ssl {
  16. enable = false
  17. }
  18. health_check_interval = 32s
  19. }
  20. producer {
  21. max_batch_bytes = 896KB
  22. compression = no_compression
  23. partition_strategy = random
  24. encode_payload_type = plain
  25. }
  26. hooks = [
  27. {
  28. endpoint = message.publish
  29. filter = "test/#"
  30. kafka_topic = emqx_msg_publish
  31. kafka_message = {
  32. timestamp = "${.timestamp}"
  33. value = "${.}"
  34. key = "${.clientid}"
  35. }
  36. }
  37. , {
  38. endpoint = client.connected
  39. kafka_topic = emqx_client_connected
  40. kafka_message = {
  41. timestamp = "${.timestamp}"
  42. value = "${.}"
  43. key = "${.proto_name}"
  44. }
  45. }
  46. , {
  47. endpoint = client.disconnected
  48. kafka_topic = emqx_client_disconnected
  49. kafka_message = {
  50. timestamp = "${.timestamp}"
  51. value = "${.reason}"
  52. key = "${.clientid}"
  53. }
  54. }
  55. ]
  56. }