massakam opened a new pull request #12769:
URL: https://github.com/apache/pulsar/pull/12769


   ### Motivation
   
   [Pulsar Node.js client 
library](https://github.com/apache/pulsar-client-node) is a wrapping of the C++ 
client library. If we add a new feature to the Node.js client that uses a 
recently implemented C function, users will be forced to upgrade the C++ 
client, even if they don't use that feature. Otherwise, a compile error will  
occur when installing the Node.js client.
   
   ### Modifications
   
   To solve the above issue, define and expose a macro named `PULSAR_VERSION` 
in the C++ client. The value of `PULSAR_VERSION` is an integer determined by 
the following calculation:
   ```
   PULSAR_VERSION = <MAJOR_VERSION> * 10^6 + <MINOR_VERSION> * 10^3 + 
<PATCH_VERSION>
   ```
   For example, if the version of Pulsar is 2.8.1, `PULSAR_VERSION` is 
`2008001`.
   
   On the Node.js client side, we will no longer have to force users to upgrade 
the C++ client by using this macro as follows:
   ```cpp
   #include <pulsar/c/version.h>
   
   #if PULSAR_VERSION >= 2008001
   /* Some processing using a C function implemented in Pulsar 2.8.1 or later */
   #else
   /* Alternative processing */
   #endif
   ```
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   ### Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (no)
     - The public API: (no)
     - The schema: (no)
     - The default values of configurations: (no)
     - The wire protocol: (no)
     - The rest endpoints: (no)
     - The admin cli options: (no)
     - Anything that affects deployment: (no)
   
   ### Documentation
     
   - [ ] `no-need-doc`
   
   
   


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to