kafka kafka_async {
	bootstrap-servers = "localhost:9092"
	topic = "radius"

	#
	#  This initialises an asynchronous instance of the kafka module.
	#
	#  When running asynchronously, calls to this module return as soon as
	#  the message is enqueued in the local in-memory queue, with delivery
	#  being attempted by a background thread according to the settings
	#  specified below.
	#
	#  WARNING: This has consequences for event durability, for example
	#  acknowledged accounting events will be lost if the process crashes
	#  with events remaining in the local queue.
	#
	#  It can be enabled alongside the synchronous instance to support
	#  messages with different durability strategies, for example:
	#
	#    Acct Stop: Call kafka instance (synchronous) => slow, durable
	#    Acct I-U:  Call kafka_async instance         => fast, not durable
	#
	asynchronous = yes

	global-config {

		#
		#  Local resources can be capped here
		#
		#queue.buffering.max.messages = 1000000
		#queue.buffering.max.kbytes = 10000000

		#
		#  How long a request should wait in the queue in the hope of
		#  batching requests for transmission. The default is not to
		#  wait (0), but batching can result in significant performance
		#  gains with asynchronous delivery.
		#
		linger.ms = 10

		#
		#  There are many additional topic parameters that can be used
		#  (with careful consideration) described in the "Global
		#  configuration properties" here:
		#
		#  https://docs.confluent.io/platform/current/clients/librdkafka/html/md_CONFIGURATION.html
		#
		#message.max.bytes = 1048576
		#socket.send.buffer.bytes = 100000000
		#socket.receive.buffer.bytes = 100000000
		#sasl.mechanism = "SCRAM-SHA-512"
		#security.protocol = "SASL_SSL"
		#ssl.ca.location = "${cadir}"
		#sasl.username = "kafkauser"
		#sasl.password = "kafkapass"
		#  ...
		#

	}

	topic-config {

		#
		#  The message durabily strategy: Number of acks required by all
		#  in-sync replicas. Default of "-1" means all must have acked.
		#
		#request.required.acks = -1

		#
		#  How long a message can remain undelivered in the local
		#  in-memory queue before it is timed out.
		#
		#  Default is determined by librdclient, typically 5 mins.
		#
		#  Set higher than the maximum broker outage that you need to
		#  tollerate without losing events.
		#
		#message.timeout.ms = 3600000

		#
		#  There are many additional topic parameters that can be used
		#  (with careful consideration) described in the "Topic
		#  configuration properties" here:
		#
		#  https://docs.confluent.io/platform/current/clients/librdkafka/html/md_CONFIGURATION.html
		#
		#  ...
		#

	}

	#
	#  Uncomment to generate producer statistics
	#
#	statistics {
#		file = /tmp/kafka_async_stats.json
#	}

	$INCLUDE ${modconfdir}/kafka/messages-json.conf
}
