mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-29 15:05:31 +08:00
16 lines
436 B
C++
16 lines
436 B
C++
#include <gtest/gtest.h>
|
|
#include "producer.h"
|
|
#include "pb/pulsar.pb.h"
|
|
|
|
TEST(CLIENT_CPP, Producer) {
|
|
auto client= std::make_shared<message_client::MsgClient>("pulsar://localhost:6650");
|
|
message_client::MsgProducer producer(client,"test");
|
|
pb::TestData data;
|
|
data.set_id("100");
|
|
data.set_name("pulsar");
|
|
std::string to_string = data.SerializeAsString();
|
|
producer.send(to_string);
|
|
producer.close();
|
|
client->close();
|
|
}
|