pulsar-client 1.6.2 → 1.8.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/.asf.yaml +8 -1
  2. package/.github/PULL_REQUEST_TEMPLATE.md +85 -0
  3. package/.github/workflows/ci-build-release-napi.yml +213 -0
  4. package/.github/workflows/ci-pr-validation.yml +225 -0
  5. package/README.md +87 -68
  6. package/binding.gyp +41 -39
  7. package/{pulsar-test-service-stop.sh → build-support/dep-version.py} +4 -6
  8. package/build-support/download-release-artifacts.py +74 -0
  9. package/build-support/generate-source-archive.sh +28 -0
  10. package/build-support/install-cpp-client.sh +66 -0
  11. package/{pulsar-test-service-start.sh → build-support/pulsar-test-container-start.sh} +11 -21
  12. package/build-support/pulsar-test-service-start.sh +37 -0
  13. package/build-support/pulsar-test-service-stop.sh +32 -0
  14. package/{.github/workflows/nodejs.yml → build-support/sign-files.sh} +13 -12
  15. package/build-support/stage-release.sh +44 -0
  16. package/dependencies.yaml +28 -0
  17. package/docs/release-process.md +262 -0
  18. package/examples/consumer.js +1 -1
  19. package/examples/consumer_listener.js +1 -1
  20. package/examples/consumer_tls_auth.js +1 -1
  21. package/examples/custom_logger.js +60 -0
  22. package/examples/encryption-consumer.js +1 -1
  23. package/examples/encryption-producer.js +1 -1
  24. package/examples/producer.js +1 -1
  25. package/examples/producer_tls_auth.js +1 -1
  26. package/examples/reader.js +1 -1
  27. package/examples/reader_listener.js +1 -1
  28. package/index.d.ts +12 -4
  29. package/index.js +2 -1
  30. package/package.json +16 -13
  31. package/pkg/build-napi-inside-docker.sh +31 -0
  32. package/pkg/linux_glibc/Dockerfile +33 -0
  33. package/pkg/linux_musl/Dockerfile +32 -0
  34. package/pkg/load_test.js +30 -0
  35. package/pkg/mac/build-cpp-deps-lib.sh +186 -0
  36. package/pkg/mac/build-cpp-lib.sh +51 -0
  37. package/{docker-tests.sh → pkg/mac/common.sh} +13 -13
  38. package/pkg/windows/download-cpp-client.bat +12 -0
  39. package/pulsar-client-cpp.txt +2 -0
  40. package/src/AuthenticationAthenz.js +1 -1
  41. package/src/AuthenticationOauth2.js +1 -1
  42. package/src/AuthenticationTls.js +1 -1
  43. package/src/AuthenticationToken.js +1 -1
  44. package/src/Client.cc +84 -58
  45. package/src/Client.h +6 -4
  46. package/src/Consumer.cc +331 -234
  47. package/src/Consumer.h +11 -9
  48. package/src/ConsumerConfig.cc +54 -32
  49. package/src/ConsumerConfig.h +5 -6
  50. package/src/Message.cc +26 -29
  51. package/src/Message.h +4 -4
  52. package/src/MessageId.cc +19 -22
  53. package/src/MessageId.h +5 -6
  54. package/src/MessageListener.h +3 -8
  55. package/src/Producer.cc +116 -133
  56. package/src/Producer.h +3 -3
  57. package/src/ProducerConfig.cc +39 -22
  58. package/src/ProducerConfig.h +2 -2
  59. package/src/Reader.cc +147 -128
  60. package/src/Reader.h +5 -3
  61. package/src/ReaderConfig.cc +14 -20
  62. package/src/ReaderConfig.h +5 -6
  63. package/src/ReaderListener.h +2 -7
  64. package/src/SchemaInfo.cc +78 -0
  65. package/src/SchemaInfo.h +41 -0
  66. package/src/ThreadSafeDeferred.cc +98 -0
  67. package/src/ThreadSafeDeferred.h +85 -0
  68. package/src/pulsar-binding.js +26 -0
  69. package/tests/conf/standalone.conf +6 -0
  70. package/tests/consumer.test.js +2 -2
  71. package/tests/end_to_end.test.js +214 -2
  72. package/tests/producer.test.js +2 -2
  73. package/{run-unit-tests.sh → tests/run-unit-tests.sh} +5 -14
  74. package/pulsar-version.txt +0 -1
@@ -0,0 +1,33 @@
1
+ #
2
+ # Licensed to the Apache Software Foundation (ASF) under one
3
+ # or more contributor license agreements. See the NOTICE file
4
+ # distributed with this work for additional information
5
+ # regarding copyright ownership. The ASF licenses this file
6
+ # to you under the Apache License, Version 2.0 (the
7
+ # "License"); you may not use this file except in compliance
8
+ # with the License. You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing,
13
+ # software distributed under the License is distributed on an
14
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ # KIND, either express or implied. See the License for the
16
+ # specific language governing permissions and limitations
17
+ # under the License.
18
+ #
19
+
20
+ ARG NODE_VERSION
21
+
22
+ FROM node:${NODE_VERSION}-bullseye
23
+
24
+ ARG NODE_VERSION
25
+
26
+ RUN apt-get update -y && \
27
+ apt-get install -y \
28
+ curl \
29
+ g++ \
30
+ make \
31
+ python3
32
+
33
+ CMD ["sh"]
@@ -0,0 +1,32 @@
1
+ #
2
+ # Licensed to the Apache Software Foundation (ASF) under one
3
+ # or more contributor license agreements. See the NOTICE file
4
+ # distributed with this work for additional information
5
+ # regarding copyright ownership. The ASF licenses this file
6
+ # to you under the Apache License, Version 2.0 (the
7
+ # "License"); you may not use this file except in compliance
8
+ # with the License. You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing,
13
+ # software distributed under the License is distributed on an
14
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ # KIND, either express or implied. See the License for the
16
+ # specific language governing permissions and limitations
17
+ # under the License.
18
+ #
19
+
20
+ ARG NODE_VERSION
21
+
22
+ FROM node:${NODE_VERSION}-alpine
23
+
24
+ RUN apk add \
25
+ bash \
26
+ curl \
27
+ python3 \
28
+ make \
29
+ g++ \
30
+ sudo
31
+
32
+ CMD ["sh"]
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Licensed to the Apache Software Foundation (ASF) under one
3
+ * or more contributor license agreements. See the NOTICE file
4
+ * distributed with this work for additional information
5
+ * regarding copyright ownership. The ASF licenses this file
6
+ * to you under the Apache License, Version 2.0 (the
7
+ * "License"); you may not use this file except in compliance
8
+ * with the License. You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing,
13
+ * software distributed under the License is distributed on an
14
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ * KIND, either express or implied. See the License for the
16
+ * specific language governing permissions and limitations
17
+ * under the License.
18
+ */
19
+
20
+ const Pulsar = require('../index.js');
21
+
22
+ (async () => {
23
+ // Create a client
24
+ const clientConfig = {
25
+ serviceUrl: 'pulsar://localhost:6650',
26
+ };
27
+
28
+ const client = new Pulsar.Client(clientConfig);
29
+ await client.close();
30
+ })();
@@ -0,0 +1,186 @@
1
+ #!/usr/bin/env bash
2
+ #
3
+ # Licensed to the Apache Software Foundation (ASF) under one
4
+ # or more contributor license agreements. See the NOTICE file
5
+ # distributed with this work for additional information
6
+ # regarding copyright ownership. The ASF licenses this file
7
+ # to you under the Apache License, Version 2.0 (the
8
+ # "License"); you may not use this file except in compliance
9
+ # with the License. You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing,
14
+ # software distributed under the License is distributed on an
15
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ # KIND, either express or implied. See the License for the
17
+ # specific language governing permissions and limitations
18
+ # under the License.
19
+ #
20
+
21
+ source $(dirname $0)/common.sh
22
+
23
+ cd $ROOT_DIR
24
+
25
+ pip3 install pyyaml
26
+
27
+ dep=$ROOT_DIR/build-support/dep-version.py
28
+ ZLIB_VERSION=$($dep zlib)
29
+ OPENSSL_VERSION=$($dep openssl)
30
+ BOOST_VERSION=$($dep boost)
31
+ PROTOBUF_VERSION=$($dep protobuf)
32
+ ZSTD_VERSION=$($dep zstd)
33
+ SNAPPY_VERSION=$($dep snappy)
34
+ CURL_VERSION=$($dep curl)
35
+
36
+ cd $MAC_BUILD_DIR/build
37
+
38
+ ##############################################################################
39
+ if [ ! -f zlib-${ZLIB_VERSION}.done ]; then
40
+ echo "Building ZLib"
41
+ curl -O -L https://zlib.net/fossils/zlib-${ZLIB_VERSION}.tar.gz
42
+ tar xfz zlib-$ZLIB_VERSION.tar.gz
43
+ pushd zlib-$ZLIB_VERSION
44
+ CFLAGS="-fPIC -O3 -arch ${ARCH} -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET}" ./configure --prefix=$PREFIX
45
+ make -j16
46
+ make install
47
+ popd
48
+
49
+ rm -rf zlib-$ZLIB_VERSION.tar.gz zlib-$ZLIB_VERSION
50
+ touch zlib-${ZLIB_VERSION}.done
51
+ else
52
+ echo "Using cached ZLib"
53
+ fi
54
+
55
+ ###############################################################################
56
+ OPENSSL_VERSION_UNDERSCORE=$(echo $OPENSSL_VERSION | sed 's/\./_/g')
57
+ if [ ! -f openssl-OpenSSL_${OPENSSL_VERSION_UNDERSCORE}.done ]; then
58
+ echo "Building OpenSSL"
59
+ curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_${OPENSSL_VERSION_UNDERSCORE}.tar.gz
60
+ tar xfz OpenSSL_${OPENSSL_VERSION_UNDERSCORE}.tar.gz
61
+ pushd openssl-OpenSSL_${OPENSSL_VERSION_UNDERSCORE}
62
+ if [ $ARCH = 'arm64' ]; then
63
+ PLATFORM=darwin64-arm64-cc
64
+ else
65
+ PLATFORM=darwin64-x86_64-cc
66
+ fi
67
+ ./Configure --prefix=$PREFIX no-shared no-unit-test $PLATFORM
68
+ make -j8
69
+ make install_sw
70
+ popd
71
+
72
+ rm -rf OpenSSL_${OPENSSL_VERSION_UNDERSCORE}.tar.gz openssl-OpenSSL_${OPENSSL_VERSION_UNDERSCORE}
73
+ touch openssl-OpenSSL_${OPENSSL_VERSION_UNDERSCORE}.done
74
+ else
75
+ echo "Using cached OpenSSL"
76
+ fi
77
+
78
+ ###############################################################################
79
+ BOOST_VERSION_=${BOOST_VERSION//./_}
80
+ DIR=boost-src-${BOOST_VERSION}
81
+ if [ ! -f $DIR.done ]; then
82
+ echo "Building Boost"
83
+ curl -O -L https://boostorg.jfrog.io/artifactory/main/release/${BOOST_VERSION}/source/boost_${BOOST_VERSION_}.tar.gz
84
+ tar xfz boost_${BOOST_VERSION_}.tar.gz
85
+ rm -rf $DIR
86
+ mv boost_${BOOST_VERSION_} $DIR
87
+
88
+ pushd $DIR
89
+ ./bootstrap.sh --prefix=$PREFIX --with-libraries=system
90
+ ./b2 address-model=64 cxxflags="-fPIC -arch ${ARCH} -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET}" \
91
+ link=static threading=multi \
92
+ variant=release \
93
+ install
94
+ popd
95
+
96
+ rm -rf $DIR boost_${BOOST_VERSION_}.tar.gz
97
+ touch $DIR.done
98
+ else
99
+ echo "Using cached Boost"
100
+ fi
101
+
102
+ ###############################################################################
103
+ if [ ! -f protobuf-${PROTOBUF_VERSION}.done ]; then
104
+ echo "Building Protobuf"
105
+ curl -O -L https://github.com/google/protobuf/releases/download/v${PROTOBUF_VERSION}/protobuf-cpp-${PROTOBUF_VERSION}.tar.gz
106
+ tar xfz protobuf-cpp-${PROTOBUF_VERSION}.tar.gz
107
+ pushd protobuf-${PROTOBUF_VERSION}
108
+ CXXFLAGS="-fPIC -arch arm64 -arch x86_64 -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET}" \
109
+ ./configure --prefix=$PREFIX
110
+ make -j16 V=1
111
+ make install
112
+ popd
113
+
114
+ pushd install/lib
115
+ echo "Propose target arch static lib" ${ARCH}
116
+ mv libprotobuf.a libprotobuf_universal.a
117
+ lipo libprotobuf_universal.a -thin ${ARCH} -output libprotobuf.a
118
+ popd
119
+
120
+ rm -rf protobuf-${PROTOBUF_VERSION} protobuf-cpp-${PROTOBUF_VERSION}.tar.gz
121
+ touch protobuf-${PROTOBUF_VERSION}.done
122
+ else
123
+ echo "Using cached Protobuf"
124
+ fi
125
+
126
+ ###############################################################################
127
+ if [ ! -f zstd-${ZSTD_VERSION}.done ]; then
128
+ echo "Building ZStd"
129
+ curl -O -L https://github.com/facebook/zstd/releases/download/v${ZSTD_VERSION}/zstd-${ZSTD_VERSION}.tar.gz
130
+ tar xfz zstd-${ZSTD_VERSION}.tar.gz
131
+ pushd zstd-${ZSTD_VERSION}
132
+ CFLAGS="-fPIC -O3 -arch ${ARCH} -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET}" \
133
+ PREFIX=$PREFIX \
134
+ make -j16 -C lib install
135
+ popd
136
+
137
+ rm -rf zstd-${ZSTD_VERSION} zstd-${ZSTD_VERSION}.tar.gz
138
+ touch zstd-${ZSTD_VERSION}.done
139
+ else
140
+ echo "Using cached ZStd"
141
+ fi
142
+
143
+ ###############################################################################
144
+ if [ ! -f snappy-${SNAPPY_VERSION}.done ]; then
145
+ echo "Building Snappy"
146
+ curl -O -L https://github.com/google/snappy/archive/refs/tags/${SNAPPY_VERSION}.tar.gz
147
+ tar xfz ${SNAPPY_VERSION}.tar.gz
148
+ pushd snappy-${SNAPPY_VERSION}
149
+ CXXFLAGS="-fPIC -O3 -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET}" \
150
+ cmake . -DCMAKE_OSX_ARCHITECTURES=${ARCH} -DCMAKE_INSTALL_PREFIX=$PREFIX -DSNAPPY_BUILD_TESTS=OFF -DSNAPPY_BUILD_BENCHMARKS=OFF
151
+ make -j16
152
+ make install
153
+ touch .done
154
+ popd
155
+
156
+ rm -rf snappy-${SNAPPY_VERSION} ${SNAPPY_VERSION}.tar.gz
157
+ touch snappy-${SNAPPY_VERSION}.done
158
+ else
159
+ echo "Using cached Snappy"
160
+ fi
161
+
162
+ ###############################################################################
163
+ if [ ! -f curl-${CURL_VERSION}.done ]; then
164
+ echo "Building LibCurl"
165
+ CURL_VERSION_=${CURL_VERSION//./_}
166
+ curl -O -L https://github.com/curl/curl/releases/download/curl-${CURL_VERSION_}/curl-${CURL_VERSION}.tar.gz
167
+ tar xfz curl-${CURL_VERSION}.tar.gz
168
+ pushd curl-${CURL_VERSION}
169
+ CFLAGS="-fPIC -arch ${ARCH} -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET}" \
170
+ ./configure --with-ssl=$PREFIX \
171
+ --without-nghttp2 \
172
+ --without-libidn2 \
173
+ --disable-ldap \
174
+ --without-brotli \
175
+ --without-secure-transport \
176
+ --disable-ipv6 \
177
+ --prefix=$PREFIX \
178
+ --host=$ARCH-apple-darwin
179
+ make -j16 install
180
+ popd
181
+
182
+ rm -rf curl-${CURL_VERSION} curl-${CURL_VERSION}.tar.gz
183
+ touch curl-${CURL_VERSION}.done
184
+ else
185
+ echo "Using cached LibCurl"
186
+ fi
@@ -0,0 +1,51 @@
1
+ #!/usr/bin/env bash
2
+ #
3
+ # Licensed to the Apache Software Foundation (ASF) under one
4
+ # or more contributor license agreements. See the NOTICE file
5
+ # distributed with this work for additional information
6
+ # regarding copyright ownership. The ASF licenses this file
7
+ # to you under the Apache License, Version 2.0 (the
8
+ # "License"); you may not use this file except in compliance
9
+ # with the License. You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing,
14
+ # software distributed under the License is distributed on an
15
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
+ # KIND, either express or implied. See the License for the
17
+ # specific language governing permissions and limitations
18
+ # under the License.
19
+ #
20
+
21
+ source $(dirname $0)/common.sh
22
+
23
+ PULSAR_DIR=${MAC_BUILD_DIR}/build-pulsar
24
+ PULSAR_PREFIX=${PULSAR_DIR}/install
25
+ mkdir -p $PULSAR_PREFIX
26
+ cd $PULSAR_DIR
27
+
28
+ ## Fetch from official release
29
+ curl -O -L "$CPP_CLIENT_BASE_URL"/apache-pulsar-client-cpp-${CPP_CLIENT_VERSION}.tar.gz
30
+ tar xfz apache-pulsar-client-cpp-${CPP_CLIENT_VERSION}.tar.gz
31
+ pushd apache-pulsar-client-cpp-${CPP_CLIENT_VERSION}
32
+ rm -f CMakeCache.txt
33
+ cmake . \
34
+ -DCMAKE_OSX_ARCHITECTURES=${ARCH} \
35
+ -DCMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} \
36
+ -DCMAKE_INSTALL_PREFIX=$PULSAR_PREFIX \
37
+ -DCMAKE_BUILD_TYPE=Release \
38
+ -DCMAKE_PREFIX_PATH=$PREFIX \
39
+ -DCMAKE_INSTALL_LIBDIR=$PULSAR_PREFIX/lib \
40
+ -DLINK_STATIC=ON \
41
+ -DBUILD_TESTS=OFF \
42
+ -DBUILD_PYTHON_WRAPPER=OFF \
43
+ -DBUILD_DYNAMIC_LIB=OFF \
44
+ -DPROTOC_PATH=$PREFIX/bin/protoc
45
+ make -j16 install
46
+ mkdir -p $ROOT_DIR/pkg/lib/
47
+ cp -r lib/libpulsarwithdeps.a $ROOT_DIR/pkg/lib/
48
+ popd
49
+
50
+ rm -rf apache-pulsar-client-cpp-${CPP_CLIENT_VERSION}.tar.gz apache-pulsar-client-cpp-${CPP_CLIENT_VERSION}
51
+
@@ -1,4 +1,3 @@
1
- #!/bin/bash
2
1
  #
3
2
  # Licensed to the Apache Software Foundation (ASF) under one
4
3
  # or more contributor license agreements. See the NOTICE file
@@ -18,20 +17,21 @@
18
17
  # under the License.
19
18
  #
20
19
 
21
- ROOT_DIR=$(git rev-parse --show-toplevel)
22
- cd $ROOT_DIR
23
-
24
- BUILD_IMAGE_NAME="${BUILD_IMAGE_NAME:-apachepulsar/pulsar-build}"
25
- BUILD_IMAGE_VERSION="${BUILD_IMAGE_VERSION:-ubuntu-16.04}"
20
+ set -e -x
26
21
 
27
- IMAGE="$BUILD_IMAGE_NAME:$BUILD_IMAGE_VERSION"
22
+ if [ -z "$ARCH" ]; then
23
+ export ARCH=$(uname -m)
24
+ fi
28
25
 
29
- echo "---- Testing Pulsar node client using image $IMAGE"
26
+ export MACOSX_DEPLOYMENT_TARGET=11.0
30
27
 
31
- docker pull $IMAGE
28
+ MAC_BUILD_DIR=`cd $(dirname $0); pwd`
29
+ ROOT_DIR=$(git rev-parse --show-toplevel)
30
+ source $ROOT_DIR/pulsar-client-cpp.txt
32
31
 
33
- DOCKER_CMD="docker run -i -v $ROOT_DIR:/pulsar-client-node $IMAGE"
32
+ cd $MAC_BUILD_DIR
33
+ mkdir -p build
34
+ cd build
35
+ mkdir -p install
36
+ export PREFIX=`pwd`/install
34
37
 
35
- # Start Pulsar standalone instance
36
- # and execute the tests
37
- $DOCKER_CMD bash -c "cd /pulsar-client-node && ./run-unit-tests.sh"
@@ -0,0 +1,12 @@
1
+ cd %~dp0
2
+ set arch=%1
3
+ if "%arch%" == "" (
4
+ reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x86" > NUL && set arch=x86 || set arch=x64
5
+ )
6
+ for /F "delims== tokens=1,2" %%a in (..\..\pulsar-client-cpp.txt) do set "%%a=%%b"
7
+ curl -O -L %CPP_CLIENT_BASE_URL%/%arch%-windows-static.tar.gz
8
+ tar -xvzf %arch%-windows-static.tar.gz
9
+ move %arch%-windows-static pulsar-cpp
10
+ dir
11
+
12
+
@@ -0,0 +1,2 @@
1
+ CPP_CLIENT_BASE_URL=https://archive.apache.org/dist/pulsar/pulsar-client-cpp-3.1.0/
2
+ CPP_CLIENT_VERSION=3.1.0
@@ -17,7 +17,7 @@
17
17
  * under the License.
18
18
  */
19
19
 
20
- const PulsarBinding = require('bindings')('Pulsar');
20
+ const PulsarBinding = require('./pulsar-binding');
21
21
 
22
22
  class AuthenticationAthenz {
23
23
  constructor(params) {
@@ -16,7 +16,7 @@
16
16
  * specific language governing permissions and limitations
17
17
  * under the License.
18
18
  */
19
- const PulsarBinding = require('bindings')('Pulsar');
19
+ const PulsarBinding = require('./pulsar-binding');
20
20
 
21
21
  class AuthenticationOauth2 {
22
22
  constructor(params) {
@@ -17,7 +17,7 @@
17
17
  * under the License.
18
18
  */
19
19
 
20
- const PulsarBinding = require('bindings')('Pulsar');
20
+ const PulsarBinding = require('./pulsar-binding');
21
21
 
22
22
  class AuthenticationTls {
23
23
  constructor(params) {
@@ -17,7 +17,7 @@
17
17
  * under the License.
18
18
  */
19
19
 
20
- const PulsarBinding = require('bindings')('Pulsar');
20
+ const PulsarBinding = require('./pulsar-binding');
21
21
 
22
22
  class AuthenticationToken {
23
23
  constructor(params) {