pulsar-client 1.13.2 → 1.14.0-rc.1
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.
- package/.idea/aws.xml +18 -0
- package/.idea/codeStyles/Project.xml +7 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/.idea/misc.xml +7 -0
- package/.idea/modules.xml +9 -0
- package/.idea/pulsar-client-node.iml +46 -0
- package/.idea/pulsar_client_node.iml +8 -0
- package/.idea/vcs.xml +6 -0
- package/index.d.ts +17 -0
- package/package.json +1 -1
- package/src/Client.cc +2 -1
- package/src/Client.h +1 -0
- package/src/ConsumerConfig.cc +66 -0
- package/src/cert.pem +3278 -0
- package/.clang-format +0 -26
- package/.eslintignore +0 -21
- package/.eslintrc.json +0 -22
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -85
- package/.github/workflows/ci-build-release-napi.yml +0 -211
- package/.github/workflows/ci-pr-validation.yml +0 -334
- package/build-support/download-release-artifacts.py +0 -77
- package/build-support/generate-source-archive.sh +0 -28
- package/build-support/pulsar-test-container-start.sh +0 -43
- package/build-support/pulsar-test-service-start.sh +0 -39
- package/build-support/pulsar-test-service-stop.sh +0 -32
- package/build-support/sign-files.sh +0 -32
- package/build-support/stage-release.sh +0 -44
- package/docs/release-process.md +0 -291
- package/examples/certificate/private-key.client-rsa.pem +0 -27
- package/examples/certificate/public-key.client-rsa.pem +0 -9
- package/examples/consumer-schema.js +0 -66
- package/examples/consumer.js +0 -46
- package/examples/consumer_listener.js +0 -44
- package/examples/consumer_tls_auth.js +0 -51
- package/examples/consummer_token_auth.js +0 -50
- package/examples/consummer_token_auth_supplier.js +0 -56
- package/examples/custom_logger.js +0 -60
- package/examples/encryption-consumer.js +0 -47
- package/examples/encryption-producer.js +0 -50
- package/examples/encryption-reader.js +0 -44
- package/examples/producer-schema.js +0 -76
- package/examples/producer.js +0 -48
- package/examples/producer_tls_auth.js +0 -52
- package/examples/producer_token_auth.js +0 -48
- package/examples/producer_token_auth_supplier.js +0 -53
- package/examples/reader.js +0 -43
- package/examples/reader_listener.js +0 -37
- package/license-checker-config.json +0 -43
- package/license-header.txt +0 -16
- package/perf/perf_consumer.js +0 -103
- package/perf/perf_producer.js +0 -118
- package/pkg/linux/Dockerfile_linux_glibc +0 -31
- package/pkg/linux/Dockerfile_linux_musl +0 -32
- package/pkg/linux/build-napi-inside-docker.sh +0 -31
- package/pkg/linux/download-cpp-client.sh +0 -65
- package/pkg/load_test.js +0 -34
- package/pkg/mac/download-cpp-client.sh +0 -36
- package/pkg/windows/download-cpp-client.bat +0 -12
- package/tests/certificate/private-key.client-rsa.pem +0 -27
- package/tests/certificate/public-key.client-rsa.pem +0 -9
- package/tests/certificate/server.crt +0 -20
- package/tests/certificate/server.key +0 -28
- package/tests/client.test.js +0 -122
- package/tests/conf/standalone.conf +0 -308
- package/tests/consumer.test.js +0 -434
- package/tests/docker-load-test.sh +0 -35
- package/tests/end_to_end.test.js +0 -1447
- package/tests/http_utils.js +0 -45
- package/tests/load-test.sh +0 -43
- package/tests/producer.test.js +0 -160
- package/tests/reader.test.js +0 -175
- package/tests/run-unit-tests.sh +0 -35
- package/tsconfig.json +0 -22
- package/tslint.json +0 -9
- package/tstest.ts +0 -408
- package/typedoc.json +0 -15
package/pkg/load_test.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
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');
|
|
21
|
-
|
|
22
|
-
(async () => {
|
|
23
|
-
Pulsar.Client.setLogHandler((level, file, line, message) => {
|
|
24
|
-
console.log('[%s][%s:%d] %s', Pulsar.LogLevel.toString(level), file, line, message);
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
// Create a client
|
|
28
|
-
const clientConfig = {
|
|
29
|
-
serviceUrl: 'pulsar://localhost:6650',
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const client = new Pulsar.Client(clientConfig);
|
|
33
|
-
await client.close();
|
|
34
|
-
})();
|
|
@@ -1,36 +0,0 @@
|
|
|
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
|
-
set -e -x
|
|
22
|
-
|
|
23
|
-
ROOT_DIR=`cd $(dirname $0) && cd ../../ && pwd`
|
|
24
|
-
source $ROOT_DIR/pulsar-client-cpp.txt
|
|
25
|
-
|
|
26
|
-
if [ -z "$ARCH" ]; then
|
|
27
|
-
export ARCH=$(uname -m)
|
|
28
|
-
fi
|
|
29
|
-
|
|
30
|
-
rm -rf $ROOT_DIR/pkg/mac/build-pulsar
|
|
31
|
-
mkdir -p $ROOT_DIR/pkg/mac/build-pulsar/install
|
|
32
|
-
cd $ROOT_DIR/pkg/mac
|
|
33
|
-
curl -L -O ${CPP_CLIENT_BASE_URL}/macos-${ARCH}.zip
|
|
34
|
-
unzip -d $ROOT_DIR/pkg/mac/build-pulsar/install macos-${ARCH}.zip
|
|
35
|
-
rm -rf macos-${ARCH}.zip
|
|
36
|
-
|
|
@@ -1,12 +0,0 @@
|
|
|
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
|
-
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
-----BEGIN RSA PRIVATE KEY-----
|
|
2
|
-
MIIEowIBAAKCAQEAtKWwgqdnTYrOCv+j1MkTWfSH0wCsHZZca9wAW3qP4uuhlBvn
|
|
3
|
-
b10JcFf5ZjzP9BSXK+tHmI8uoN368vEv6yhURHM4yuXqzCxzuAwkQSo39rzX8PGC
|
|
4
|
-
7qdjCN7LDJ3MnqiBIrUsSaEP1wrNsB1kI+o9ER1e5O/uEP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FXoBmo/
|
|
24
|
-
4veRybntytl6WNtagN9xfJoEV/aGJA4u554Ei9sCgYEAtLscB69G9XbWo6YAsgbG
|
|
25
|
-
cBcbwFZku7tyyrcnqptxSza95w0Y9MDVUtMcgOEehLkSeIpdnIgq14Alln753BYJ
|
|
26
|
-
WyNI6s+fYrusaK/aqNniQJaZRFF6K/55dVwKETUwBhsT8a1JuDVKuAXhq0YF/0Ji
|
|
27
|
-
Z/yve3En4WV+agiOP0teQJM=
|
|
28
|
-
-----END PRIVATE KEY-----
|
package/tests/client.test.js
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
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 httpRequest = require('./http_utils');
|
|
21
|
-
const Pulsar = require('../index');
|
|
22
|
-
|
|
23
|
-
const baseUrl = 'http://localhost:8080';
|
|
24
|
-
|
|
25
|
-
(() => {
|
|
26
|
-
describe('Client', () => {
|
|
27
|
-
describe('CreateFailedByUrlSetIncorrect', () => {
|
|
28
|
-
test('No Set Url', async () => {
|
|
29
|
-
await expect(() => new Pulsar.Client({
|
|
30
|
-
operationTimeoutSeconds: 30,
|
|
31
|
-
})).toThrow('Service URL is required and must be specified as a string');
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
test('Set empty url', async () => {
|
|
35
|
-
await expect(() => new Pulsar.Client({
|
|
36
|
-
serviceUrl: '',
|
|
37
|
-
operationTimeoutSeconds: 30,
|
|
38
|
-
})).toThrow('Service URL is required and must be specified as a string');
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
test('Set invalid url', async () => {
|
|
42
|
-
await expect(() => new Pulsar.Client({
|
|
43
|
-
serviceUrl: 'invalid://localhost:6655',
|
|
44
|
-
operationTimeoutSeconds: 30,
|
|
45
|
-
})).toThrow('Invalid scheme: invalid');
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
test('Set not string url', async () => {
|
|
49
|
-
await expect(() => new Pulsar.Client({
|
|
50
|
-
serviceUrl: -1,
|
|
51
|
-
operationTimeoutSeconds: 30,
|
|
52
|
-
})).toThrow('Service URL is required and must be specified as a string');
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
describe('test getPartitionsForTopic', () => {
|
|
56
|
-
test('GetPartitions for empty topic', async () => {
|
|
57
|
-
const client = new Pulsar.Client({
|
|
58
|
-
serviceUrl: 'pulsar://localhost:6650',
|
|
59
|
-
operationTimeoutSeconds: 30,
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
await expect(client.getPartitionsForTopic(''))
|
|
63
|
-
.rejects.toThrow('Failed to GetPartitionsForTopic: InvalidTopicName');
|
|
64
|
-
await client.close();
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
test('Client/getPartitionsForTopic', async () => {
|
|
68
|
-
const client = new Pulsar.Client({
|
|
69
|
-
serviceUrl: 'pulsar://localhost:6650',
|
|
70
|
-
operationTimeoutSeconds: 30,
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
// test on nonPartitionedTopic
|
|
74
|
-
const nonPartitionedTopicName = 'test-non-partitioned-topic';
|
|
75
|
-
const nonPartitionedTopic = `persistent://public/default/${nonPartitionedTopicName}`;
|
|
76
|
-
const nonPartitionedTopicAdminURL = `${baseUrl}/admin/v2/persistent/public/default/${nonPartitionedTopicName}`;
|
|
77
|
-
const createNonPartitionedTopicRes = await httpRequest(
|
|
78
|
-
nonPartitionedTopicAdminURL, {
|
|
79
|
-
headers: {
|
|
80
|
-
'Content-Type': 'application/json',
|
|
81
|
-
},
|
|
82
|
-
method: 'PUT',
|
|
83
|
-
},
|
|
84
|
-
);
|
|
85
|
-
expect(createNonPartitionedTopicRes.statusCode).toBe(204);
|
|
86
|
-
|
|
87
|
-
const nonPartitionedTopicList = await client.getPartitionsForTopic(nonPartitionedTopic);
|
|
88
|
-
expect(nonPartitionedTopicList).toEqual([nonPartitionedTopic]);
|
|
89
|
-
|
|
90
|
-
// test on partitioned with number
|
|
91
|
-
const partitionedTopicName = 'test-partitioned-topic-1';
|
|
92
|
-
const partitionedTopic = `persistent://public/default/${partitionedTopicName}`;
|
|
93
|
-
const partitionedTopicAdminURL = `${baseUrl}/admin/v2/persistent/public/default/${partitionedTopicName}/partitions`;
|
|
94
|
-
const createPartitionedTopicRes = await httpRequest(
|
|
95
|
-
partitionedTopicAdminURL, {
|
|
96
|
-
headers: {
|
|
97
|
-
'Content-Type': 'text/plain',
|
|
98
|
-
},
|
|
99
|
-
data: 4,
|
|
100
|
-
method: 'PUT',
|
|
101
|
-
},
|
|
102
|
-
);
|
|
103
|
-
expect(createPartitionedTopicRes.statusCode).toBe(204);
|
|
104
|
-
|
|
105
|
-
const partitionedTopicList = await client.getPartitionsForTopic(partitionedTopic);
|
|
106
|
-
expect(partitionedTopicList).toEqual([
|
|
107
|
-
'persistent://public/default/test-partitioned-topic-1-partition-0',
|
|
108
|
-
'persistent://public/default/test-partitioned-topic-1-partition-1',
|
|
109
|
-
'persistent://public/default/test-partitioned-topic-1-partition-2',
|
|
110
|
-
'persistent://public/default/test-partitioned-topic-1-partition-3',
|
|
111
|
-
]);
|
|
112
|
-
|
|
113
|
-
const deleteNonPartitionedTopicRes = await httpRequest(nonPartitionedTopicAdminURL, { method: 'DELETE' });
|
|
114
|
-
expect(deleteNonPartitionedTopicRes.statusCode).toBe(204);
|
|
115
|
-
const deletePartitionedTopicRes = await httpRequest(partitionedTopicAdminURL, { method: 'DELETE' });
|
|
116
|
-
expect(deletePartitionedTopicRes.statusCode).toBe(204);
|
|
117
|
-
|
|
118
|
-
await client.close();
|
|
119
|
-
});
|
|
120
|
-
});
|
|
121
|
-
});
|
|
122
|
-
})();
|
|
@@ -1,308 +0,0 @@
|
|
|
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
|
-
### --- General broker settings --- ###
|
|
21
|
-
|
|
22
|
-
# Zookeeper quorum connection string
|
|
23
|
-
zookeeperServers=
|
|
24
|
-
|
|
25
|
-
# Global Zookeeper quorum connection string
|
|
26
|
-
globalZookeeperServers=
|
|
27
|
-
|
|
28
|
-
brokerServicePort=6650
|
|
29
|
-
brokerServicePortTls=6651
|
|
30
|
-
|
|
31
|
-
# Port to use to server HTTP request
|
|
32
|
-
webServicePort=8080
|
|
33
|
-
webServicePortTls=8443
|
|
34
|
-
|
|
35
|
-
# Hostname or IP address the service binds on, default is 0.0.0.0.
|
|
36
|
-
bindAddress=0.0.0.0
|
|
37
|
-
|
|
38
|
-
# Hostname or IP address the service advertises to the outside world. If not set, the value of InetAddress.getLocalHost().getHostName() is used.
|
|
39
|
-
advertisedAddress=localhost
|
|
40
|
-
|
|
41
|
-
# Used to specify multiple advertised listeners for the broker.
|
|
42
|
-
# The value must format as <listener_name>:pulsar://<host>:<port>,
|
|
43
|
-
# multiple listeners should separate with commas.
|
|
44
|
-
# Do not use this configuration with advertisedAddress and brokerServicePort.
|
|
45
|
-
# The Default value is absent means use advertisedAddress and brokerServicePort.
|
|
46
|
-
advertisedListeners=localhost6650:pulsar://localhost:6650,localhost6651:pulsar+ssl://localhost:6651,localhost8443:pulsar+ssl://localhost:8443
|
|
47
|
-
|
|
48
|
-
# Name of the cluster to which this broker belongs to
|
|
49
|
-
clusterName=standalone
|
|
50
|
-
|
|
51
|
-
# Zookeeper session timeout in milliseconds
|
|
52
|
-
zooKeeperSessionTimeoutMillis=30000
|
|
53
|
-
|
|
54
|
-
# Time to wait for broker graceful shutdown. After this time elapses, the process will be killed
|
|
55
|
-
brokerShutdownTimeoutMs=3000
|
|
56
|
-
|
|
57
|
-
# Enable backlog quota check. Enforces action on topic when the quota is reached
|
|
58
|
-
backlogQuotaCheckEnabled=true
|
|
59
|
-
|
|
60
|
-
# How often to check for topics that have reached the quota
|
|
61
|
-
backlogQuotaCheckIntervalInSeconds=60
|
|
62
|
-
|
|
63
|
-
# Default per-topic backlog quota limit
|
|
64
|
-
backlogQuotaDefaultLimitGB=10
|
|
65
|
-
|
|
66
|
-
# Enable the deletion of inactive topics
|
|
67
|
-
brokerDeleteInactiveTopicsEnabled=true
|
|
68
|
-
|
|
69
|
-
# Enable batch index ACK
|
|
70
|
-
acknowledgmentAtBatchIndexLevelEnabled=true
|
|
71
|
-
|
|
72
|
-
# How often to check for inactive topics
|
|
73
|
-
brokerDeleteInactiveTopicsFrequencySeconds=60
|
|
74
|
-
|
|
75
|
-
# How frequently to proactively check and purge expired messages
|
|
76
|
-
messageExpiryCheckIntervalInMinutes=5
|
|
77
|
-
|
|
78
|
-
# Enable check for minimum allowed client library version
|
|
79
|
-
clientLibraryVersionCheckEnabled=false
|
|
80
|
-
|
|
81
|
-
# Allow client libraries with no version information
|
|
82
|
-
clientLibraryVersionCheckAllowUnversioned=true
|
|
83
|
-
|
|
84
|
-
# Path for the file used to determine the rotation status for the broker when responding
|
|
85
|
-
# to service discovery health checks
|
|
86
|
-
statusFilePath=/usr/local/apache/htdocs
|
|
87
|
-
|
|
88
|
-
# Max number of unacknowledged messages allowed to receive messages by a consumer on a shared subscription. Broker will stop sending
|
|
89
|
-
# messages to consumer once, this limit reaches until consumer starts acknowledging messages back
|
|
90
|
-
# Using a value of 0, is disabling unackeMessage limit check and consumer can receive messages without any restriction
|
|
91
|
-
maxUnackedMessagesPerConsumer=50000
|
|
92
|
-
|
|
93
|
-
subscriptionRedeliveryTrackerEnabled=true
|
|
94
|
-
|
|
95
|
-
# Whether to enable the delayed delivery for messages.
|
|
96
|
-
# If disabled, messages will be immediately delivered and there will
|
|
97
|
-
# be no tracking overhead.
|
|
98
|
-
delayedDeliveryEnabled=true
|
|
99
|
-
|
|
100
|
-
# Control the tick time for when retrying on delayed delivery,
|
|
101
|
-
# affecting the accuracy of the delivery time compared to the scheduled time.
|
|
102
|
-
# Default is 1 second.
|
|
103
|
-
delayedDeliveryTickTimeMillis=1000
|
|
104
|
-
|
|
105
|
-
### --- TLS --- ###
|
|
106
|
-
# Path for the TLS certificate file
|
|
107
|
-
tlsCertificateFilePath=/pulsar/test-conf/server.crt
|
|
108
|
-
|
|
109
|
-
# Path for the TLS private key file
|
|
110
|
-
tlsKeyFilePath=/pulsar/test-conf/server.key
|
|
111
|
-
|
|
112
|
-
# Path for the trusted TLS certificate file.
|
|
113
|
-
# This cert is used to verify that any certs presented by connecting clients
|
|
114
|
-
# are signed by a certificate authority. If this verification
|
|
115
|
-
# fails, then the certs are untrusted and the connections are dropped.
|
|
116
|
-
tlsTrustCertsFilePath=/pulsar/test-conf/server.crt
|
|
117
|
-
|
|
118
|
-
### --- Authentication --- ###
|
|
119
|
-
|
|
120
|
-
# Enable authentication
|
|
121
|
-
authenticationEnabled=false
|
|
122
|
-
|
|
123
|
-
# Autentication provider name list, which is comma separated list of class names
|
|
124
|
-
authenticationProviders=false
|
|
125
|
-
|
|
126
|
-
# Enforce authorization
|
|
127
|
-
authorizationEnabled=false
|
|
128
|
-
|
|
129
|
-
# Role names that are treated as "super-user", meaning they will be able to do all admin
|
|
130
|
-
# operations and publish/consume from all topics
|
|
131
|
-
superUserRoles=
|
|
132
|
-
|
|
133
|
-
# Authentication settings of the broker itself. Used when the broker connects to other brokers,
|
|
134
|
-
# either in same or other clusters
|
|
135
|
-
brokerClientAuthenticationPlugin=
|
|
136
|
-
brokerClientAuthenticationParameters=
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
### --- BookKeeper Client --- ###
|
|
140
|
-
|
|
141
|
-
# Authentication plugin to use when connecting to bookies
|
|
142
|
-
bookkeeperClientAuthenticationPlugin=
|
|
143
|
-
|
|
144
|
-
# BookKeeper auth plugin implementatation specifics parameters name and values
|
|
145
|
-
bookkeeperClientAuthenticationParametersName=
|
|
146
|
-
bookkeeperClientAuthenticationParameters=
|
|
147
|
-
|
|
148
|
-
# Timeout for BK add / read operations
|
|
149
|
-
bookkeeperClientTimeoutInSeconds=30
|
|
150
|
-
|
|
151
|
-
# Speculative reads are initiated if a read request doesn't complete within a certain time
|
|
152
|
-
# Using a value of 0, is disabling the speculative reads
|
|
153
|
-
bookkeeperClientSpeculativeReadTimeoutInMillis=0
|
|
154
|
-
|
|
155
|
-
# Enable bookies health check. Bookies that have more than the configured number of failure within
|
|
156
|
-
# the interval will be quarantined for some time. During this period, new ledgers won't be created
|
|
157
|
-
# on these bookies
|
|
158
|
-
bookkeeperClientHealthCheckEnabled=true
|
|
159
|
-
bookkeeperClientHealthCheckIntervalSeconds=60
|
|
160
|
-
bookkeeperClientHealthCheckErrorThresholdPerInterval=5
|
|
161
|
-
bookkeeperClientHealthCheckQuarantineTimeInSeconds=1800
|
|
162
|
-
|
|
163
|
-
# Enable rack-aware bookie selection policy. BK will chose bookies from different racks when
|
|
164
|
-
# forming a new bookie ensemble
|
|
165
|
-
bookkeeperClientRackawarePolicyEnabled=true
|
|
166
|
-
|
|
167
|
-
# Enable region-aware bookie selection policy. BK will chose bookies from
|
|
168
|
-
# different regions and racks when forming a new bookie ensemble
|
|
169
|
-
# If enabled, the value of bookkeeperClientRackawarePolicyEnabled is ignored
|
|
170
|
-
bookkeeperClientRegionawarePolicyEnabled=false
|
|
171
|
-
|
|
172
|
-
# Enable/disable reordering read sequence on reading entries.
|
|
173
|
-
bookkeeperClientReorderReadSequenceEnabled=false
|
|
174
|
-
|
|
175
|
-
# Enable bookie isolation by specifying a list of bookie groups to choose from. Any bookie
|
|
176
|
-
# outside the specified groups will not be used by the broker
|
|
177
|
-
bookkeeperClientIsolationGroups=
|
|
178
|
-
|
|
179
|
-
### --- Managed Ledger --- ###
|
|
180
|
-
|
|
181
|
-
# Number of bookies to use when creating a ledger
|
|
182
|
-
managedLedgerDefaultEnsembleSize=1
|
|
183
|
-
|
|
184
|
-
# Number of copies to store for each message
|
|
185
|
-
managedLedgerDefaultWriteQuorum=1
|
|
186
|
-
|
|
187
|
-
# Number of guaranteed copies (acks to wait before write is complete)
|
|
188
|
-
managedLedgerDefaultAckQuorum=1
|
|
189
|
-
|
|
190
|
-
# Amount of memory to use for caching data payload in managed ledger. This memory
|
|
191
|
-
# is allocated from JVM direct memory and it's shared across all the topics
|
|
192
|
-
# running in the same broker
|
|
193
|
-
managedLedgerCacheSizeMB=1024
|
|
194
|
-
|
|
195
|
-
# Threshold to which bring down the cache level when eviction is triggered
|
|
196
|
-
managedLedgerCacheEvictionWatermark=0.9
|
|
197
|
-
|
|
198
|
-
# Rate limit the amount of writes generated by consumer acking the messages
|
|
199
|
-
managedLedgerDefaultMarkDeleteRateLimit=0.1
|
|
200
|
-
|
|
201
|
-
# Max number of entries to append to a ledger before triggering a rollover
|
|
202
|
-
# A ledger rollover is triggered on these conditions
|
|
203
|
-
# * Either the max rollover time has been reached
|
|
204
|
-
# * or max entries have been written to the ledged and at least min-time
|
|
205
|
-
# has passed
|
|
206
|
-
managedLedgerMaxEntriesPerLedger=50000
|
|
207
|
-
|
|
208
|
-
# Minimum time between ledger rollover for a topic
|
|
209
|
-
managedLedgerMinLedgerRolloverTimeMinutes=10
|
|
210
|
-
|
|
211
|
-
# Maximum time before forcing a ledger rollover for a topic
|
|
212
|
-
managedLedgerMaxLedgerRolloverTimeMinutes=240
|
|
213
|
-
|
|
214
|
-
# Max number of entries to append to a cursor ledger
|
|
215
|
-
managedLedgerCursorMaxEntriesPerLedger=50000
|
|
216
|
-
|
|
217
|
-
# Max time before triggering a rollover on a cursor ledger
|
|
218
|
-
managedLedgerCursorRolloverTimeInSeconds=14400
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
### --- Load balancer --- ###
|
|
223
|
-
|
|
224
|
-
# Enable load balancer
|
|
225
|
-
loadBalancerEnabled=false
|
|
226
|
-
|
|
227
|
-
# Strategy to assign a new bundle
|
|
228
|
-
loadBalancerPlacementStrategy=weightedRandomSelection
|
|
229
|
-
|
|
230
|
-
# Percentage of change to trigger load report update
|
|
231
|
-
loadBalancerReportUpdateThresholdPercentage=10
|
|
232
|
-
|
|
233
|
-
# maximum interval to update load report
|
|
234
|
-
loadBalancerReportUpdateMaxIntervalMinutes=15
|
|
235
|
-
|
|
236
|
-
# Frequency of report to collect
|
|
237
|
-
loadBalancerHostUsageCheckIntervalMinutes=1
|
|
238
|
-
|
|
239
|
-
# Load shedding interval. Broker periodically checks whether some traffic should be offload from
|
|
240
|
-
# some over-loaded broker to other under-loaded brokers
|
|
241
|
-
loadBalancerSheddingIntervalMinutes=30
|
|
242
|
-
|
|
243
|
-
# Prevent the same topics to be shed and moved to other broker more that once within this timeframe
|
|
244
|
-
loadBalancerSheddingGracePeriodMinutes=30
|
|
245
|
-
|
|
246
|
-
# Usage threshold to determine a broker as under-loaded
|
|
247
|
-
loadBalancerBrokerUnderloadedThresholdPercentage=1
|
|
248
|
-
|
|
249
|
-
# Usage threshold to determine a broker as over-loaded
|
|
250
|
-
loadBalancerBrokerOverloadedThresholdPercentage=85
|
|
251
|
-
|
|
252
|
-
# Interval to update namespace bundle resource quotat
|
|
253
|
-
loadBalancerResourceQuotaUpdateIntervalMinutes=15
|
|
254
|
-
|
|
255
|
-
# Usage threshold to determine a broker is having just right level of load
|
|
256
|
-
loadBalancerBrokerComfortLoadLevelPercentage=65
|
|
257
|
-
|
|
258
|
-
# enable/disable namespace bundle auto split
|
|
259
|
-
loadBalancerAutoBundleSplitEnabled=false
|
|
260
|
-
|
|
261
|
-
# interval to detect & split hot namespace bundle
|
|
262
|
-
loadBalancerNamespaceBundleSplitIntervalMinutes=15
|
|
263
|
-
|
|
264
|
-
# maximum topics in a bundle, otherwise bundle split will be triggered
|
|
265
|
-
loadBalancerNamespaceBundleMaxTopics=1000
|
|
266
|
-
|
|
267
|
-
# maximum sessions (producers + consumers) in a bundle, otherwise bundle split will be triggered
|
|
268
|
-
loadBalancerNamespaceBundleMaxSessions=1000
|
|
269
|
-
|
|
270
|
-
# maximum msgRate (in + out) in a bundle, otherwise bundle split will be triggered
|
|
271
|
-
loadBalancerNamespaceBundleMaxMsgRate=1000
|
|
272
|
-
|
|
273
|
-
# maximum bandwidth (in + out) in a bundle, otherwise bundle split will be triggered
|
|
274
|
-
loadBalancerNamespaceBundleMaxBandwidthMbytes=100
|
|
275
|
-
|
|
276
|
-
# maximum number of bundles in a namespace
|
|
277
|
-
loadBalancerNamespaceMaximumBundles=128
|
|
278
|
-
|
|
279
|
-
### --- Replication --- ###
|
|
280
|
-
|
|
281
|
-
# Enable replication metrics
|
|
282
|
-
replicationMetricsEnabled=true
|
|
283
|
-
|
|
284
|
-
# Max number of connections to open for each broker in a remote cluster
|
|
285
|
-
# More connections host-to-host lead to better throughput over high-latency
|
|
286
|
-
# links.
|
|
287
|
-
replicationConnectionsPerBroker=16
|
|
288
|
-
|
|
289
|
-
# Replicator producer queue size
|
|
290
|
-
replicationProducerQueueSize=1000
|
|
291
|
-
|
|
292
|
-
# Default message retention time
|
|
293
|
-
defaultRetentionTimeInMinutes=0
|
|
294
|
-
|
|
295
|
-
# Default retention size
|
|
296
|
-
defaultRetentionSizeInMB=0
|
|
297
|
-
|
|
298
|
-
# How often to check whether the connections are still alive
|
|
299
|
-
keepAliveIntervalSeconds=30
|
|
300
|
-
|
|
301
|
-
# How often broker checks for inactive topics to be deleted (topics with no subscriptions and no one connected)
|
|
302
|
-
brokerServicePurgeInactiveFrequencyInSeconds=60
|
|
303
|
-
|
|
304
|
-
### --- BookKeeper Configuration --- #####
|
|
305
|
-
|
|
306
|
-
# The maximum netty frame size in bytes. Any message received larger than this will be rejected. The default value is 5MB.
|
|
307
|
-
nettyMaxFrameSizeBytes=5253120
|
|
308
|
-
|