Describe the bug
I executed the command:
go get -u github.com/apache/pulsar/pulsar-client-go/pulsar
Output:
fatal: unable to access 'https://gopkg.in/natefinch/lumberjack.v2/': Operation timed out after 300015 milliseconds with 0 out of 0 bytes received
package gopkg.in/natefinch/lumberjack.v2: exit status 1
@fananchong seems like a connectivity issue. did you try again?
I try again, now this issue is pass. But have a new issue:
uf6e9i0ay01bn3ms3pdxz:~# go get -u github.com/apache/pulsar/pulsar-client-go/pulsar
# github.com/apache/pulsar/pulsar-client-go/pulsar
In file included from go/src/github.com/apache/pulsar/pulsar-client-go/pulsar/c_client.go:24:
./c_go_pulsar.h:22:10: fatal error: pulsar/c/client.h: No such file or directory
22 | #include <pulsar/c/client.h>
| ^~~~~~~~~~~~~~~~~~~
compilation terminated.
You need to install pulsar c++ client package. Go client is a wrapper on top of c++ client https://pulsar.apache.org/docs/latest/clients/Cpp/
@fananchong hello , now pulsar-client-go use the package management method of go mod, you first need to build pulsar-client-cpp, then you can use:
go mod tidy
to get the required dependencies without having to get it separately.
I follow https://github.com/apache/pulsar/issues/3883#issuecomment-475634546 , execute like:
cd pulsar-client-cpp/pkg/rpm/
./docker-build-rpm.sh
cd RPMS/x86_64/
sudo rpm -ivh apache-pulsar-client-2.4.0-1.x86_64.rpm
sudo rpm -ivh apache-pulsar-client-devel-2.4.0-1.x86_64.rpm
now build pass
have 1 new issue:
[fananchong@host-192-168-23-57 pulsar-client-go]$ ./bin/consumer
./bin/consumer: error while loading shared libraries: libpulsar.so.2.4.0-SNAPSHOT: cannot open shared object file: No such file or directory
I execute sudo ldconfig , now it's working.
Most helpful comment
You need to install pulsar c++ client package. Go client is a wrapper on top of c++ client https://pulsar.apache.org/docs/latest/clients/Cpp/