kafka: doc about kafka_send_key function.
authorVicente Hernando <vhernando@systemonenoc.com>
Mon, 18 May 2020 14:22:41 +0000 (16:22 +0200)
committerVicente Hernando <vhernando@systemonenoc.com>
Wed, 20 May 2020 11:59:04 +0000 (13:59 +0200)
src/modules/kafka/doc/kafka_admin.xml

index 09c0eaf..34ae1cf 100644 (file)
@@ -185,6 +185,40 @@ modparam("kafka", "topic", "name=third_topic")
 ...
 # Send "test message" to topic "my_topic"                      
 kafka_send("my_topic", "test message");
+...
+                 </programlisting>
+               </example>
+         </section>
+         <section id="kafka.f.kafka_send_key">
+               <title>
+                 <function moreinfo="none">kafka_send_key(topic, msg, key)</function>
+               </title>
+               <para>
+                 Send a message with an associated key to a specific topic via Kafka server.
+               </para>
+               <para>
+                 This function returns -1 for all sort of errors. (So execution of script continues)
+               </para>
+               <para>
+                 Parameters:
+                 <itemizedlist>
+                       <listitem><emphasis>topic</emphasis>: (string) name of the topic.
+                       It is mandatory.</listitem>
+                       <listitem><emphasis>msg</emphasis>: (string) message to send.
+                       It is mandatory.</listitem>
+                       <listitem><emphasis>key</emphasis>: (string) associate this key with the message.
+                       It is mandatory.</listitem>
+                 </itemizedlist>
+               </para>
+               <para>
+                 Available via KEMI framework as <emphasis>kafka.send_key</emphasis>.
+               </para>
+               <example>
+                 <title><function>kafka_send_key</function> usage</title>
+                 <programlisting format="linespecific">
+...
+# Send "test message" to topic "my_topic" with key "my_key"                    
+kafka_send_key("my_topic", "test message", "my_key");
 ...
                  </programlisting>
                </example>