You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/07/01 17:12:51 UTC
[GitHub] [pulsar-client-node] dionjansen opened a new pull request #101: Get redelivery count
dionjansen opened a new pull request #101:
URL: https://github.com/apache/pulsar-client-node/pull/101
Implements: #98
Implementation by @frejonb, resolved merge conflicts with upstream for version `1.2.0-rc.0`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar-client-node] massakam removed a comment on pull request #101: Get redelivery count
Posted by GitBox <gi...@apache.org>.
massakam removed a comment on pull request #101:
URL: https://github.com/apache/pulsar-client-node/pull/101#issuecomment-653389146
retest this please
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar-client-node] massakam commented on a change in pull request #101: Get redelivery count
Posted by GitBox <gi...@apache.org>.
massakam commented on a change in pull request #101:
URL: https://github.com/apache/pulsar-client-node/pull/101#discussion_r449416029
##########
File path: tests/end_to_end.test.js
##########
@@ -116,6 +116,52 @@ const Pulsar = require('../index.js');
await client.close();
});
+ test('getRedeliveryCount', async () => {
+ const client = new Pulsar.Client({
+ serviceUrl: 'pulsar://localhost:6650',
+ operationTimeoutSeconds: 30,
+ });
+
+ const topic = 'persistent://public/default/produce-consume';
+ const producer = await client.createProducer({
+ topic,
+ sendTimeoutMs: 30000,
+ batchingEnabled: true,
+ });
+ expect(producer).not.toBeNull();
+
+ const consumer = await client.subscribe({
+ topic,
+ subscriptionType: "Shared",
+ subscription: 'sub1',
+ ackTimeoutMs: 10000,
+ nAckRedeliverTimeoutMs: 100,
+ });
+
+ expect(consumer).not.toBeNull();
+
+ const message = 'my-message';
+ producer.send({
+ data: Buffer.from(message),
+ });
+ await producer.flush();
+
+ let redeliveryCount;
+ let msg
Review comment:
```suggestion
let msg;
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar-client-node] massakam commented on pull request #101: Get redelivery count
Posted by GitBox <gi...@apache.org>.
massakam commented on pull request #101:
URL: https://github.com/apache/pulsar-client-node/pull/101#issuecomment-653387998
retest this please
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar-client-node] massakam removed a comment on pull request #101: Get redelivery count
Posted by GitBox <gi...@apache.org>.
massakam removed a comment on pull request #101:
URL: https://github.com/apache/pulsar-client-node/pull/101#issuecomment-653492247
retest this please
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar-client-node] massakam merged pull request #101: Get redelivery count
Posted by GitBox <gi...@apache.org>.
massakam merged pull request #101:
URL: https://github.com/apache/pulsar-client-node/pull/101
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar-client-node] massakam commented on pull request #101: Get redelivery count
Posted by GitBox <gi...@apache.org>.
massakam commented on pull request #101:
URL: https://github.com/apache/pulsar-client-node/pull/101#issuecomment-653493731
retest this please
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar-client-node] dionjansen commented on pull request #101: Get redelivery count
Posted by GitBox <gi...@apache.org>.
dionjansen commented on pull request #101:
URL: https://github.com/apache/pulsar-client-node/pull/101#issuecomment-653489056
@massakam sorry for the mess I hadn't actually ran the code locally, linter works fine for me now. One unit test is failing though:
```
FAIL tests/consumer.test.js
Consumer
Create
✓ No Topic (11ms)
✓ Not String Topic (1ms)
✓ No Subscription (1ms)
✓ Not String Subscription
✓ Not Exist Tenant (3ms)
✓ Not Exist Namespace (1ms)
✓ Not Positive NAckRedeliverTimeout
Close
✕ throws error on subsequent calls to close (2ms)
● Consumer › Close › throws error on subsequent calls to close
Failed to create consumer: ConnectError
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar-client-node] massakam edited a comment on pull request #101: Get redelivery count
Posted by GitBox <gi...@apache.org>.
massakam edited a comment on pull request #101:
URL: https://github.com/apache/pulsar-client-node/pull/101#issuecomment-653300365
The C `pulsar_message_get_redelivery_count` function has been added since version 2.5.0.
https://github.com/apache/pulsar/pull/5677
In order to compile this code, we need to upgrade the C++ library version to 2.5.0 or later. Could you update the version written in this file?
https://github.com/apache/pulsar-client-node/blob/master/pulsar-version.txt
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar-client-node] massakam commented on pull request #101: Get redelivery count
Posted by GitBox <gi...@apache.org>.
massakam commented on pull request #101:
URL: https://github.com/apache/pulsar-client-node/pull/101#issuecomment-653300365
The C `pulsar_message_get_redelivery_count` function has been added since version 2.5.0.
https://github.com/apache/pulsar/pull/5677
In order to compile this code, we need to upgrade the C++ library version to 2.5.0 or later.
https://github.com/apache/pulsar-client-node/blob/master/pulsar-version.txt
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar-client-node] massakam commented on a change in pull request #101: Get redelivery count
Posted by GitBox <gi...@apache.org>.
massakam commented on a change in pull request #101:
URL: https://github.com/apache/pulsar-client-node/pull/101#discussion_r449416195
##########
File path: tests/end_to_end.test.js
##########
@@ -116,6 +116,52 @@ const Pulsar = require('../index.js');
await client.close();
});
+ test('getRedeliveryCount', async () => {
+ const client = new Pulsar.Client({
+ serviceUrl: 'pulsar://localhost:6650',
+ operationTimeoutSeconds: 30,
+ });
+
+ const topic = 'persistent://public/default/produce-consume';
+ const producer = await client.createProducer({
+ topic,
+ sendTimeoutMs: 30000,
+ batchingEnabled: true,
+ });
+ expect(producer).not.toBeNull();
+
+ const consumer = await client.subscribe({
+ topic,
+ subscriptionType: "Shared",
+ subscription: 'sub1',
+ ackTimeoutMs: 10000,
+ nAckRedeliverTimeoutMs: 100,
+ });
+
+ expect(consumer).not.toBeNull();
+
+ const message = 'my-message';
+ producer.send({
+ data: Buffer.from(message),
+ });
+ await producer.flush();
+
+ let redeliveryCount;
+ let msg
+ for (let index = 0; index < 3; index++) {
Review comment:
```suggestion
for (let index = 0; index < 3; index += 1) {
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar-client-node] massakam commented on pull request #101: Get redelivery count
Posted by GitBox <gi...@apache.org>.
massakam commented on pull request #101:
URL: https://github.com/apache/pulsar-client-node/pull/101#issuecomment-653497111
@dionjansen Hmm... I don't know why it failed, but all the tests passed on Jenkins.
```
PASS tests/consumer.test.js
Consumer
Create
â No Topic (9ms)
â Not String Topic (1ms)
â No Subscription (1ms)
â Not String Subscription (1ms)
â Not Exist Tenant (277ms)
â Not Exist Namespace (4ms)
â Not Positive NAckRedeliverTimeout (1ms)
Close
â throws error on subsequent calls to close (1385ms)
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar-client-node] massakam commented on pull request #101: Get redelivery count
Posted by GitBox <gi...@apache.org>.
massakam commented on pull request #101:
URL: https://github.com/apache/pulsar-client-node/pull/101#issuecomment-653295833
retest this please
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar-client-node] dionjansen edited a comment on pull request #101: Get redelivery count
Posted by GitBox <gi...@apache.org>.
dionjansen edited a comment on pull request #101:
URL: https://github.com/apache/pulsar-client-node/pull/101#issuecomment-653489056
@massakam sorry for the mess I hadn't actually ran the code locally, linter works fine for me now. One unit test is failing though:
```
FAIL tests/consumer.test.js
Consumer
Create
✓ No Topic (11ms)
✓ Not String Topic (1ms)
✓ No Subscription (1ms)
✓ Not String Subscription
✓ Not Exist Tenant (3ms)
✓ Not Exist Namespace (1ms)
✓ Not Positive NAckRedeliverTimeout
Close
✕ throws error on subsequent calls to close (2ms)
● Consumer › Close › throws error on subsequent calls to close
Failed to create consumer: ConnectError
```
*fyi I don't have a pulsar cluster running on localhost atm, so all the e2e tests fail but that is to be expected I guess*
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar-client-node] massakam removed a comment on pull request #101: Get redelivery count
Posted by GitBox <gi...@apache.org>.
massakam removed a comment on pull request #101:
URL: https://github.com/apache/pulsar-client-node/pull/101#issuecomment-653387998
retest this please
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar-client-node] massakam commented on pull request #101: Get redelivery count
Posted by GitBox <gi...@apache.org>.
massakam commented on pull request #101:
URL: https://github.com/apache/pulsar-client-node/pull/101#issuecomment-653492247
retest this please
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar-client-node] massakam removed a comment on pull request #101: Get redelivery count
Posted by GitBox <gi...@apache.org>.
massakam removed a comment on pull request #101:
URL: https://github.com/apache/pulsar-client-node/pull/101#issuecomment-653295833
retest this please
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar-client-node] massakam commented on a change in pull request #101: Get redelivery count
Posted by GitBox <gi...@apache.org>.
massakam commented on a change in pull request #101:
URL: https://github.com/apache/pulsar-client-node/pull/101#discussion_r449415870
##########
File path: tests/end_to_end.test.js
##########
@@ -116,6 +116,52 @@ const Pulsar = require('../index.js');
await client.close();
});
+ test('getRedeliveryCount', async () => {
+ const client = new Pulsar.Client({
+ serviceUrl: 'pulsar://localhost:6650',
+ operationTimeoutSeconds: 30,
+ });
+
+ const topic = 'persistent://public/default/produce-consume';
+ const producer = await client.createProducer({
+ topic,
+ sendTimeoutMs: 30000,
+ batchingEnabled: true,
+ });
+ expect(producer).not.toBeNull();
+
+ const consumer = await client.subscribe({
+ topic,
+ subscriptionType: "Shared",
Review comment:
```suggestion
subscriptionType: 'Shared',
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar-client-node] massakam commented on pull request #101: Get redelivery count
Posted by GitBox <gi...@apache.org>.
massakam commented on pull request #101:
URL: https://github.com/apache/pulsar-client-node/pull/101#issuecomment-653391952
There are some lint errors in the test code.
```
/pulsar-client-node/tests/end_to_end.test.js
135:27 error Strings must use singlequote quotes
150:14 error Missing semicolon semi
151:38 error Unary operator '++' used no-plusplus
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar-client-node] dionjansen edited a comment on pull request #101: Get redelivery count
Posted by GitBox <gi...@apache.org>.
dionjansen edited a comment on pull request #101:
URL: https://github.com/apache/pulsar-client-node/pull/101#issuecomment-653489056
@massakam sorry for the mess I hadn't actually ran the code locally, linter works fine for me now. One unit test is failing though:
```
FAIL tests/consumer.test.js
Consumer
Create
✓ No Topic (11ms)
✓ Not String Topic (1ms)
✓ No Subscription (1ms)
✓ Not String Subscription
✓ Not Exist Tenant (3ms)
✓ Not Exist Namespace (1ms)
✓ Not Positive NAckRedeliverTimeout
Close
✕ throws error on subsequent calls to close (2ms)
● Consumer › Close › throws error on subsequent calls to close
Failed to create consumer: ConnectError
```
*fyi I don't have a pulsar cluster running on localhost atm, so all the e2e tests fail but that expected.*
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar-client-node] massakam commented on pull request #101: Get redelivery count
Posted by GitBox <gi...@apache.org>.
massakam commented on pull request #101:
URL: https://github.com/apache/pulsar-client-node/pull/101#issuecomment-653389146
retest this please
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar-client-node] dionjansen commented on pull request #101: Get redelivery count
Posted by GitBox <gi...@apache.org>.
dionjansen commented on pull request #101:
URL: https://github.com/apache/pulsar-client-node/pull/101#issuecomment-653386536
@massakam done
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar-client-node] massakam removed a comment on pull request #101: Get redelivery count
Posted by GitBox <gi...@apache.org>.
massakam removed a comment on pull request #101:
URL: https://github.com/apache/pulsar-client-node/pull/101#issuecomment-653493731
retest this please
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org