服务器搭建
参考如下配置:https://www.cnblogs.com/leju/articles/12787302.html
注意Linux发送的时候需要配置监听IP,要不然发送不成功,在server.properties里面打开这个配置并配置相应的IP

CMake 第三方库
linux下编译,解压第三方库,进入目录下
./configure --cc=/opt/hisi-linux/x86-arm/aarch64-himix100-linux/bin/aarch64-himix100-linux-gcc --prefix=/home/zhubili/Demo/librdkafka-1.4.4 --disable-ssl
(如果不清楚命令 可以输入./configure --help)
然后依次执行make 在src下会生成librdkafka.so和librdkafka.so.1
producer.c
/*
* librdkafka - Apache Kafka C library
*
* Copyright (c) 2017, Magnus Edenhill
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED
最低0.47元/天 解锁文章

443

被折叠的 条评论
为什么被折叠?



