@@ -34,6 +34,7 @@ Producer::Producer(RdKafka::Conf* gconfig, RdKafka::Conf* tconfig):
3434 m_partitioner_cb () {
3535 std::string errstr;
3636
37+ m_gconfig->set (" default_topic_conf" , m_tconfig, errstr);
3738 m_gconfig->set (" dr_cb" , &m_dr_cb, errstr);
3839 }
3940
@@ -124,7 +125,7 @@ void Producer::New(const Nan::FunctionCallbackInfo<v8::Value>& info) {
124125 return Nan::ThrowError (errstr.c_str ());
125126 }
126127
127- Producer* producer = new Producer (gconfig, gconfig );
128+ Producer* producer = new Producer (gconfig, tconfig );
128129
129130 // Wrap it
130131 producer->Wrap (info.This ());
@@ -190,32 +191,13 @@ void Producer::Disconnect() {
190191 delete m_client;
191192 m_client = NULL ;
192193 }
193-
194- RdKafka::wait_destroyed (1000 );
195194}
196195
197196Baton Producer::Produce (ProducerMessage* msg) {
198197 return Produce (msg->Payload (), msg->Size (), msg->GetTopic (),
199198 msg->partition , msg->key );
200199}
201200
202- Baton Producer::Produce (void * message, size_t size, std::string topic_name,
203- int32_t partition, std::string *key) {
204- std::string errstr;
205-
206- RdKafka::Topic* topic =
207- RdKafka::Topic::create (m_client, topic_name, m_tconfig, errstr);
208-
209- if (errstr.empty ()) {
210- // Cede ownership of the pointer to this function
211- return Produce (message, size, topic, partition, key);
212- }
213-
214- // We own the pointer here so we need to free it
215- free (message);
216- return Baton (RdKafka::ERR__INVALID_ARG);
217- }
218-
219201Baton Producer::Produce (void * message, size_t size, RdKafka::Topic* topic,
220202 int32_t partition, std::string *key) {
221203 RdKafka::ErrorCode response_code;
0 commit comments