Просмотр исходного кода

kafka: doc about kafka_send_key function.

Vicente Hernando 5 лет назад
Родитель
Сommit
f0134bb58f
1 измененных файлов с 34 добавлено и 0 удалено
  1. 34 0
      src/modules/kafka/doc/kafka_admin.xml

+ 34 - 0
src/modules/kafka/doc/kafka_admin.xml

@@ -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>