Allow getting background queue out of kafka handle base

This commit is contained in:
Matias Fontanini
2018-10-27 09:34:42 -07:00
parent 8dc94869fd
commit 19baa03cea
2 changed files with 15 additions and 0 deletions

View File

@@ -46,6 +46,7 @@
#include "configuration.h" #include "configuration.h"
#include "macros.h" #include "macros.h"
#include "logging.h" #include "logging.h"
#include "queue.h"
namespace cppkafka { namespace cppkafka {
@@ -239,6 +240,19 @@ public:
*/ */
const Configuration& get_configuration() const; const Configuration& get_configuration() const;
#if RD_KAFKA_VERSION >= RD_KAFKA_ADMIN_API_SUPPORT_VERSION
/**
* \brief Gets the background queue
*
* This translates into a call to rd_kafka_queue_get_background
*
* \return The background queue
*/
Queue get_background_queue() const {
return Queue::make_queue(rd_kafka_queue_get_background(handle_.get()));
}
#endif
/** /**
* \brief Gets the length of the out queue * \brief Gets the length of the out queue
* *

View File

@@ -46,5 +46,6 @@
// See: https://github.com/edenhill/librdkafka/issues/1792 // See: https://github.com/edenhill/librdkafka/issues/1792
#define RD_KAFKA_QUEUE_REFCOUNT_BUG_VERSION 0x000b0500 //v0.11.5.00 #define RD_KAFKA_QUEUE_REFCOUNT_BUG_VERSION 0x000b0500 //v0.11.5.00
#define RD_KAFKA_HEADERS_SUPPORT_VERSION 0x000b0402 //v0.11.4.02 #define RD_KAFKA_HEADERS_SUPPORT_VERSION 0x000b0402 //v0.11.4.02
#define RD_KAFKA_ADMIN_API_SUPPORT_VERSION 0x000b0500 //v0.11.5.00
#endif // CPPKAFKA_MACROS_H #endif // CPPKAFKA_MACROS_H