shibd opened a new pull request, #454:
URL: https://github.com/apache/pulsar-client-node/pull/454

   ## Summary
   This PR fixes issue #3505 by automatically setting the client description to 
`"node-client-vX.Y.Z"` where `X.Y.Z` is the Node.js client version from 
package.json. After this fix, the `clientVersion` in topic statistics will 
display as `"Pulsar-CPP-vA.B.C-node-client-vX.Y.Z"` instead of just 
`"Pulsar-CPP-vA.B.C"`.
   
   ## Problem
   The Node.js client wraps the C++ client library. When connecting to the 
broker, it uses the C++ client's version string, making it impossible to 
distinguish Node.js clients from C++ clients in topic statistics. This creates 
confusion for operators monitoring their Pulsar clusters.
   
   ## Solution
   Automatically set client description using the Node.js client version from 
package.json. The description is set to `"node-client-vX.Y.Z"` format during 
client initialization. This is done transparently without requiring any user 
configuration.
   
   ## Changes
   - **binding.gyp**: Add `PULSAR_CLIENT_NODE_VERSION` define to read version 
from package.json at build time
   - **src/Client.cc**: Set client description to `"node-client-v<version>"` 
format in client constructor
   - **index.d.ts**: Remove `description` parameter from `ClientConfig` (not 
needed, automatic)
   
   ## Result
   After this fix, `clientVersion` in topic stats will display as:
   - Format: `"Pulsar-CPP-v4.0.0-node-client-v1.17.0-rc.0"`
   - First part (`Pulsar-CPP-v4.0.0`): C++ client version
   - Second part (`-node-client-v1.17.0-rc.0`): Node.js client identifier and 
version
   
   ## Backward Compatibility
   This change is fully backward compatible. Existing code will continue to 
work without any changes. The only visible change is that `clientVersion` in 
topic statistics will now include the Node.js client identifier.
   
   ## Related Issues
   Fixes #3505


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