Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export interface ClientConfig {
ioThreads?: number;
messageListenerThreads?: number;
concurrentLookupRequest?: number;
useTls?: boolean;
tlsTrustCertsFilePath?: string;
tlsCertificateFilePath?: string;
tlsPrivateKeyFilePath?: string;
Expand Down
4 changes: 2 additions & 2 deletions pulsar-client-cpp.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
CPP_CLIENT_BASE_URL=https://archive.apache.org/dist/pulsar/pulsar-client-cpp-4.0.1
CPP_CLIENT_VERSION=4.0.1
CPP_CLIENT_BASE_URL=https://dist.apache.org/repos/dist/dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-4.1.0-candidate-1/
CPP_CLIENT_VERSION=4.1.0
6 changes: 0 additions & 6 deletions src/Client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ static const std::string CFG_OP_TIMEOUT = "operationTimeoutSeconds";
static const std::string CFG_IO_THREADS = "ioThreads";
static const std::string CFG_LISTENER_THREADS = "messageListenerThreads";
static const std::string CFG_CONCURRENT_LOOKUP = "concurrentLookupRequest";
static const std::string CFG_USE_TLS = "useTls";
static const std::string CFG_TLS_TRUST_CERT = "tlsTrustCertsFilePath";
static const std::string CFG_TLS_VALIDATE_HOSTNAME = "tlsValidateHostname";
static const std::string CFG_TLS_ALLOW_INSECURE = "tlsAllowInsecureConnection";
Expand Down Expand Up @@ -187,11 +186,6 @@ Client::Client(const Napi::CallbackInfo &info) : Napi::ObjectWrap<Client>(info)
}
}

if (clientConfig.Has(CFG_USE_TLS) && clientConfig.Get(CFG_USE_TLS).IsBoolean()) {
Napi::Boolean useTls = clientConfig.Get(CFG_USE_TLS).ToBoolean();
pulsar_client_configuration_set_use_tls(cClientConfig.get(), useTls.Value());
}

if (clientConfig.Has(CFG_TLS_TRUST_CERT) && clientConfig.Get(CFG_TLS_TRUST_CERT).IsString()) {
Napi::String tlsTrustCertsFilePath = clientConfig.Get(CFG_TLS_TRUST_CERT).ToString();
pulsar_client_configuration_set_tls_trust_certs_file_path(cClientConfig.get(),
Expand Down
22 changes: 12 additions & 10 deletions tests/end_to_end.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@
});

let consumer2Recv = 0;
while (true) {

Check warning on line 321 in tests/end_to_end.test.js

View workflow job for this annotation

GitHub Actions / Run unit tests (3.10)

Unexpected constant condition
try {
const msg = await consumer2.receive(3000);
await new Promise((resolve) => setTimeout(resolve, 10));
Expand Down Expand Up @@ -363,7 +363,7 @@
topic,
startMessageId: Pulsar.MessageId.earliest(),
receiverQueueSize: 10,
listener: async (message, reader) => {

Check warning on line 366 in tests/end_to_end.test.js

View workflow job for this annotation

GitHub Actions / Run unit tests (3.10)

'reader' is defined but never used

Check warning on line 366 in tests/end_to_end.test.js

View workflow job for this annotation

GitHub Actions / Run unit tests (3.10)

'message' is defined but never used
await new Promise((resolve) => setTimeout(resolve, 10));
reader1Recv += 1;
},
Expand Down Expand Up @@ -395,7 +395,7 @@
await client.close();
});

test('Message Listener error handling', async () => {

Check warning on line 398 in tests/end_to_end.test.js

View workflow job for this annotation

GitHub Actions / Run unit tests (3.10)

Test has no assertions
const client = new Pulsar.Client({
serviceUrl: 'pulsar://localhost:6650',
});
Expand Down Expand Up @@ -431,7 +431,7 @@
subscription: 'sync',
subscriptionType: 'Shared',
subscriptionInitialPosition: 'Earliest',
listener: (message, messageConsumer) => {

Check warning on line 434 in tests/end_to_end.test.js

View workflow job for this annotation

GitHub Actions / Run unit tests (3.10)

'messageConsumer' is defined but never used

Check warning on line 434 in tests/end_to_end.test.js

View workflow job for this annotation

GitHub Actions / Run unit tests (3.10)

'message' is defined but never used
throw new Error('consumer1 callback expected error');
},
});
Expand All @@ -441,7 +441,7 @@
subscription: 'async',
subscriptionType: 'Shared',
subscriptionInitialPosition: 'Earliest',
listener: async (message, messageConsumer) => {

Check warning on line 444 in tests/end_to_end.test.js

View workflow job for this annotation

GitHub Actions / Run unit tests (3.10)

'messageConsumer' is defined but never used

Check warning on line 444 in tests/end_to_end.test.js

View workflow job for this annotation

GitHub Actions / Run unit tests (3.10)

'message' is defined but never used
throw new Error('consumer2 callback expected error');
},
});
Expand Down Expand Up @@ -1409,14 +1409,15 @@
});
}

// 2. Verify message order (based on key dictionary order)
// 2. Verify message order follows the first sequence id per key-based batch,
// matching pulsar-client-cpp#546.
const expected = [
{ key: 'A', value: '0' },
{ key: 'A', value: '5' },
{ key: 'B', value: '1' },
{ key: 'B', value: '3' },
{ key: 'C', value: '2' },
{ key: 'C', value: '4' },
{ key: 'A', value: '0' },
{ key: 'A', value: '5' },
];

expect(received).toEqual(expected);
Expand All @@ -1438,17 +1439,18 @@

// 2. Receive messages and verify their order and keys
const msg1 = await receiveAndAck();
expect(msg1.getData().toString()).toBe('2');
expect(msg1.getOrderingKey().toString()).toBe('B');
expect(msg1.getData().toString()).toBe('0');
expect(msg1.getOrderingKey().toString()).toBe('A');
expect(msg1.getPartitionKey()).toBe('B');

const msg2 = await receiveAndAck();
expect(msg2.getData().toString()).toBe('0');
expect(msg2.getOrderingKey()).toBe('A');
expect(msg2.getPartitionKey()).toBe('B');
expect(msg2.getData().toString()).toBe('1');
expect(msg2.getOrderingKey().toString()).toBe('A');
expect(msg2.getPartitionKey()).toBe('');

const msg3 = await receiveAndAck();
expect(msg3.getData().toString()).toBe('1');
expect(msg3.getOrderingKey().toString()).toBe('A');
expect(msg3.getData().toString()).toBe('2');
expect(msg3.getOrderingKey().toString()).toBe('B');
});
});
})();
1 change: 0 additions & 1 deletion tstest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ import Pulsar = require('./index');
ioThreads: 4,
messageListenerThreads: 4,
concurrentLookupRequest: 100,
useTls: false,
tlsTrustCertsFilePath: '/path/to/ca-cert.pem',
tlsValidateHostname: false,
tlsAllowInsecureConnection: false,
Expand Down
Loading