<h4>Pre-Submission Checklist</h4>



<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Commit message has the format required by CONTRIBUTING guide</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Commits are split per component (core, individual modules, libs, utils, ...)</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Each component has a single commit (if not, squash them into one commit)</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> No commits to README files for modules (changes must be done to docbook files<br>
in <code>doc/</code> subfolder, the README file is autogenerated)</li>
</ul>
<h4>Type Of Change</h4>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Small bug fix (non-breaking change which fixes an issue)</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> New feature (non-breaking change which adds new functionality)</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Breaking change (fix or feature that would change existing functionality)</li>
</ul>
<h4>Checklist:</h4>

<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> PR should be backported to stable branches</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Tested changes locally</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Related to issue #XXXX (replace XXXX with an open issue number)</li>
</ul>
<h4>Description</h4>

<p>Module to produce and send messages to a Kafka server busing librdkafka library.</p>
<p>I copy part of README file here:</p>
<p>Chapter 1. Admin Guide</p>
<p>Table of Contents</p>
<ol>
<li>
<p>Overview</p>
</li>
<li>
<p>Dependencies</p>
<p>2.1. Kamailio Modules<br>
2.2. External Libraries or Applications<br>
2.3. Parameters</p>
<pre><code>    2.3.1. brokers (string)
    2.3.2. configuration (string)
    2.3.3. topic (string)
</code></pre>
<p>2.4. Functions</p>
<pre><code>    2.4.1. kafka_send(topic, msg)
</code></pre>
<p>2.5. RPC Commands</p>
<pre><code>    2.5.1. kafka.stats
    2.5.2. kafka.stats_topic
</code></pre>
</li>
<li>
<p>Overview</p>
<p>This module produces and sends messages to a Kafka server.</p>
</li>
<li>
<p>Dependencies</p>
<p>2.1. Kamailio Modules<br>
2.2. External Libraries or Applications<br>
2.3. Parameters</p>
<pre><code> 2.3.1. brokers (string)
 2.3.2. configuration (string)
 2.3.3. topic (string)
</code></pre>
<p>2.4. Functions</p>
<pre><code> 2.4.1. kafka_send(topic, msg)
</code></pre>
<p>2.5. RPC Commands</p>
<pre><code> 2.5.1. kafka.stats
 2.5.2. kafka.stats_topic
</code></pre>
</li>
</ol>
<p>2.1. Kamailio Modules</p>
<p>The following modules must be loaded before this module:<br>
* none.</p>
<p>2.2. External Libraries or Applications</p>
<p>The following libraries or applications must be installed before<br>
running Kamailio with this module loaded:<br>
* librdkafka: the Apache Kafka C/C++ client library.<br>
<a href="https://github.com/edenhill/librdkafka">https://github.com/edenhill/librdkafka</a></p>
<p>2.3. Parameters</p>
<p>2.3.1. brokers (string)</p>
<p>Specifies a list of brokers separated by commas.</p>
<p>From librdkafka documentation:</p>
<p>brokerlist is a ,-separated list of brokers in the format:<br>
,,</p>
<p>Where each broker is in either the host or URL based format:<br>
* [:]<br>
* ://[:port]</p>
<p> is either PLAINTEXT, SSL, SASL, SASL_PLAINTEXT</p>
<p>The two formats can be mixed but ultimately the value of the<br>
security.protocol config property decides what brokers are allowed.</p>
<p>This parameter is mandatory. There is no default value.</p>
<p>Example 1.1. Set brokers parameter<br>
...<br>
modparam("kafka", "brokers", "localhost:9092")<br>
modparam("kafka", "brokers", "broker1:10000,broker2")<br>
modparam("kafka", "brokers", "SSL://broker3:9000,ssl://broker2")<br>
...</p>
<p>2.3.2. configuration (string)</p>
<p>Specifies a set of general properties.</p>
<p>Each configuration property follows: name = value pattern. And<br>
configuration properties are separated by ;</p>
<p>This parameter is optional, but if it exists it can be configured only<br>
once.</p>
<p>Example 1.2. Set configuration parameter<br>
...<br>
modparam("kafka", "configuration", "topic.metadata.refresh.interval.ms=20000;que<br>
ue.buffering.max.messages=1000000;metadata.request.timeout.ms=90000")</p>
<p>modparam("kafka", "configuration", "topic.metadata.refresh.interval.ms=20000;que<br>
ue.buffering.max.messages=500000;debug=all;metadata.request.timeout.ms=900000")<br>
...</p>
<p>2.3.3. topic (string)</p>
<p>Specifies a topic name and a set of topic properties.</p>
<p>The topic defined in topic parameter has to already exist in Kafka<br>
servers.</p>
<p>Each topic property is a list of attribute = value separated by<br>
semicolon.</p>
<p>name atribute indicates the topic name. It is mandatory. Other<br>
attributes mean names of properties and are optional.</p>
<p>This parameter is optional. Each topic needs a topic parameter so<br>
several topic parameters are allowed.</p>
<p>Example 1.3. Set topic parameter<br>
...<br>
modparam("kafka", "topic", "name=my_topic;request.required.acks=0;request.timeou<br>
t.ms=10000")<br>
modparam("kafka", "topic", "name=second_topic;request.required.acks=0;request.ti<br>
meout.ms=10000")<br>
modparam("kafka", "topic", "name=third_topic")<br>
...</p>
<p>2.4. Functions</p>
<p>2.4.1.  kafka_send(topic, msg)</p>
<p>Send a message to a specific topic via Kafka server.</p>
<p>Parameters:<br>
* topic: (string) name of the topic. It is mandatory.<br>
* msg: (string) message to send. It is mandatory.</p>
<p>Available via KEMI framework as kafka.send.</p>
<p>Example 1.4. kafka_send usage<br>
...</p>
<h1>Send "test message" to topic "my_topic"</h1>
<p>kafka_send("my_topic", "test message");<br>
...</p>
<p>2.5. RPC Commands</p>
<p>2.5.1. kafka.stats</p>
<p>Show statistics about total sent messages and failed to deliver ones.</p>
<p>Example 1.5. kafka.stats usage<br>
...<br>
kamcmd kafka.stats<br>
Total messages: 26  Errors: 0<br>
...</p>
<p>2.5.2. kafka.stats_topic</p>
<p>Show statistics about sent messages and failed to deliver ones for a<br>
specific topic.</p>
<p>Parameter: topic (string) name of the topic. Required.</p>
<p>Example 1.6. kafka.stats usage<br>
...</p>
<h1>Show statistics for my_topic.</h1>
<p>kamcmd kafka.stats_topic "my_topic"<br>
Topic: my_topic  Total messages: 17  Errors: 0<br>
...</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/kamailio/kamailio/pull/2112'>https://github.com/kamailio/kamailio/pull/2112</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>kafka: module to produce and send messages to a Kafka server</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>A</strong>
    <a href="https://github.com/kamailio/kamailio/pull/2112/files#diff-0">src/modules/kafka/Makefile</a>
    (23)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/kamailio/kamailio/pull/2112/files#diff-1">src/modules/kafka/doc/Makefile</a>
    (4)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/kamailio/kamailio/pull/2112/files#diff-2">src/modules/kafka/doc/kafka.xml</a>
    (41)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/kamailio/kamailio/pull/2112/files#diff-3">src/modules/kafka/doc/kafka_admin.xml</a>
    (221)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/kamailio/kamailio/pull/2112/files#diff-4">src/modules/kafka/kafka_mod.c</a>
    (335)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/kamailio/kamailio/pull/2112/files#diff-5">src/modules/kafka/kfk.c</a>
    (1175)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/kamailio/kamailio/pull/2112/files#diff-6">src/modules/kafka/kfk.h</a>
    (96)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/kamailio/kamailio/pull/2112.patch'>https://github.com/kamailio/kamailio/pull/2112.patch</a></li>
  <li><a href='https://github.com/kamailio/kamailio/pull/2112.diff'>https://github.com/kamailio/kamailio/pull/2112.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/pull/2112?email_source=notifications&email_token=ABO7UZMWZS27FJWWNBQI5XTQRHOLNA5CNFSM4JG7GW32YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HVRGCJQ">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZI4NA3X5W6ULD4QXELQRHOLNANCNFSM4JG7GW3Q">unsubscribe</a>.<img src="https://github.com/notifications/beacon/ABO7UZLGX74COIIMOXE77VTQRHOLNA5CNFSM4JG7GW32YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HVRGCJQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/pull/2112?email_source=notifications\u0026email_token=ABO7UZMWZS27FJWWNBQI5XTQRHOLNA5CNFSM4JG7GW32YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HVRGCJQ",
"url": "https://github.com/kamailio/kamailio/pull/2112?email_source=notifications\u0026email_token=ABO7UZMWZS27FJWWNBQI5XTQRHOLNA5CNFSM4JG7GW32YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HVRGCJQ",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>