Browse Source

Add back in old publishMessage() function so older code can link

Signed-off-by: Dan S. Camper <dan.camper@lexisnexisrisk.com>
Dan S. Camper 5 years ago
parent
commit
84775f3ffb
2 changed files with 31 additions and 0 deletions
  1. 11 0
      plugins/kafka/kafka.cpp
  2. 20 0
      plugins/kafka/kafka.hpp

+ 11 - 0
plugins/kafka/kafka.cpp

@@ -921,6 +921,17 @@ namespace KafkaPlugin
     // Advertised Entry Point Functions
     //--------------------------------------------------------------------------
 
+    ECL_KAFKA_API bool ECL_KAFKA_CALL publishMessage(ICodeContext* ctx, const char* brokers, const char* topic, const char* message, const char* key)
+    {
+        std::call_once(pubCacheInitFlag, setupPublisherCache, ctx->queryContextLogger().queryTraceLevel());
+
+        Publisher* pubObjPtr = publisherCache->getPublisher(brokers, topic, POLL_TIMEOUT);
+
+        pubObjPtr->sendMessage(message, key);
+
+        return true;
+    }
+
     ECL_KAFKA_API bool ECL_KAFKA_CALL publishMessage(ICodeContext* ctx, const char* brokers, const char* topic, size32_t lenMessage, const char* message, size32_t lenKey, const char* key)
     {
         std::call_once(pubCacheInitFlag, setupPublisherCache, ctx->queryContextLogger().queryTraceLevel());

+ 20 - 0
plugins/kafka/kafka.hpp

@@ -350,6 +350,26 @@ extern "C++"
         /**
          * Queues the message for publishing to a topic on a Kafka cluster.
          *
+         * @param   ctx                 The execution context
+         * @param   brokers             One or more Kafka brokers, in the
+         *                              format 'name[:port]' where 'name'
+         *                              is either a host name or IP address;
+         *                              multiple brokers can be delimited
+         *                              with commas
+         * @param   topic               The name of the topic
+         * @param   message             The message to send
+         * @param   key                 The key to use for the message
+         *
+         * @return  true if the message was cached successfully
+         */
+        ECL_KAFKA_API bool ECL_KAFKA_CALL publishMessage(ICodeContext* ctx, const char* brokers, const char* topic, const char* message, const char* key);
+
+        //----------------------------------------------------------------------
+
+        /**
+         * Queues the message for publishing to a topic on a Kafka cluster.
+         *
+         * @param   ctx                 The execution context
          * @param   brokers             One or more Kafka brokers, in the
          *                              format 'name[:port]' where 'name'
          *                              is either a host name or IP address;