Skip to content

[improve][client] Use async C function in the Consumer#receive method - #252

Merged
merlimat merged 1 commit into
apache:masterfrom
equanz:use_c_receive_async
Dec 12, 2022
Merged

merlimat merged 1 commit into
apache:masterfrom
equanz:use_c_receive_async

Conversation

@equanz

@equanz equanz commented Dec 1, 2022 •

Copy link
Copy Markdown
Contributor

Motivation

Related to: #200

We can't implement the receive method by async function in #200 because the cpp library didn't expose the async receive C function.
The async receive C function was implemented in apache/pulsar#17452 . It was released in v3.0.0. So, we want to use it.

Modifications

  • Use pulsar_consumer_receive_async on Consumer#receive method
    • Use PULSAR_VERSION to provide backward compatibility between other cpp clients

Verifying this change

  • Make sure that the change passes the CI checks.

This change is already covered by existing tests, such as (please describe tests).

Documentation

  • doc-required
    (Your PR needs to update docs and you will update later)

  • doc-not-needed
    Because this PR doesn't introduce new features.

  • doc
    (Your PR contains doc changes)

  • doc-complete
    (Docs have been already added)

@equanz

equanz commented Dec 6, 2022 •

Copy link
Copy Markdown
Contributor Author

Some validation jobs are failing as follows. Version.h is not composed in some packages. It is not for pulsar-client-node issue. However, we should fix it before merging this PR and releasing pre-built binaries.

+ curl -L -O https://dist.apache.org/repos/dist/dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/apk-x86_64/x86_64/apache-pulsar-client-3.1.0-r0.apk
...
+ curl -L -O https://dist.apache.org/repos/dist/dev/pulsar/pulsar-client-cpp/pulsar-client-cpp-3.1.0-candidate-1/apk-x86_64/x86_64/apache-pulsar-client-dev-3.1.0-r0.apk
...
100 12.2M  100 12.2M    0     0  24.7M      0 --:--:-- --:--:-- --:--:-- 24.7M
+ apk add --allow-untrusted /tmp/apache-pulsar-client-3.1.0-r0.apk /tmp/apache-pulsar-client-dev-3.1.0-r0.apk
...
 /usr/include/pulsar/c/version.h:22:10: fatal error: pulsar/Version.h: No such file or directory
   22 | #include <pulsar/Version.h>
      |          ^~~~~~~~~~~~~~~~~~

Comment thread src/Consumer.cc Resolved
@equanz
equanz force-pushed the use_c_receive_async branch from 813481e to 2d689f1 Compare December 7, 2022 09:41
Comment thread package-lock.json Resolved
@equanz
equanz force-pushed the use_c_receive_async branch from 2d689f1 to db4e870 Compare December 7, 2022 11:57
@equanz
equanz requested a review from RobertIndie December 9, 2022 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants