atezs82 opened a new pull request #14: URL: https://github.com/apache/pulsar-adapters/pull/14
<!-- ### Contribution Checklist - Name the pull request in the form "[Issue XYZ][component] Title of the pull request", where *XYZ* should be replaced by the actual issue number. Skip *Issue XYZ* if there is no associated github issue for this pull request. Skip *component* if you are unsure about which is the best component. E.g. `[docs] Fix typo in produce method`. - Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review. - Each pull request should address only one issue, not mix up code from multiple issues. - Each commit in the pull request has a meaningful commit message - Once all items of the checklist are addressed, remove the above text and this checklist, leaving only the filled out template below. **(The sections below can be removed for hotfixes of typos)** --> ### Motivation It is currently not possible to configure the Pulsar Client when creating a `SparkStreamingPulsarReceiver` (currently only the service URL, the authentication plugin and the consumer configuration can be set). This renders the receiver unusable when eg. the Pulsar cluster is configured to use TLS, and custom TLS certificates need to be set. ### Modifications - Added an optional Map to configure the client to the constructor of the receiver. Existing constructors still remain usable, but they do not set this parameter. When the parameter is an empty map, `loadConf` on the client builder does not get called. Existing constructors set this parameter to an empty map to maintain backward compatibility. - If specified, (since `ClientBuilder` works like this) the configuration overrides other client configuration. - Added a simple integration test around the functionality (it barely checks whether `serviceUrl` can be overriden by this feature). - Fixed some unit tests around `SparkStreamingPulsarReceiver` (since they seemed to use an older interface). This issue was similar to https://github.com/apache/pulsar-adapters/issues/12 (but not exactly the same). - If the modifications look good, I also plan to modify the documentation accordingly. ### Verifying this change - [ ] Make sure that the change passes the CI checks. This change added tests and can be verified as follows: - Added a simple integration test around the functionality (it barely checks whether `serviceUrl` can be overriden by this feature). - Existing integration tests for the receiver were also fixed and observed to be working during local run. ### Does this pull request potentially affect one of the following parts: *If `yes` was chosen, please highlight the changes* - Dependencies (does it add or upgrade a dependency): no - The public API: yes (ability to set client configuration when creating receiver) - The schema: don't know - The default values of configurations: no - The wire protocol: no - The rest endpoints: no - The admin cli options: no - Anything that affects deployment: don't know ### Documentation - Does this pull request introduce a new feature? yes - If yes, how is the feature documented? will do docs and Javadocs once the feature looks good in this PR -- 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: us...@infra.apache.org