Skip to content

feat: add support for Pub/Sub emulator configuration#399

Merged
matt-kwong merged 7 commits intogoogleapis:mainfrom
jusemon:main
Feb 9, 2026
Merged

feat: add support for Pub/Sub emulator configuration#399
matt-kwong merged 7 commits intogoogleapis:mainfrom
jusemon:main

Conversation

@jusemon
Copy link
Copy Markdown
Contributor

@jusemon jusemon commented Oct 16, 2025

Add Pub/Sub Emulator Support

Implements support for the Google Cloud Pub/Sub emulator based on feedback from #381. This PR addresses the feature request in #290 with a cleaner boolean configuration approach.

Changes

  • Added cps.useEmulator config (defaults to false)
  • Respects PUBSUB_EMULATOR_HOST environment variable
  • Falls back to cps.endpoint if env var not set
  • Uses proper emulator connection setup (no credentials, plaintext)
  • Updated README documentation
  • Added unit tests

Usage

cps.useEmulator=true
cps.endpoint=localhost:8085  # optional

All tests pass (81 tests, 0 failures). Fixes #290 ☕️

@jusemon jusemon requested review from a team October 16, 2025 04:46
@google-cla
Copy link
Copy Markdown

google-cla Bot commented Oct 16, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@product-auto-label product-auto-label Bot added the size: m Pull request size is medium. label Oct 16, 2025
Introduced a new configuration option cps.useEmulator to allow users to switch between the production service and the Pub/Sub emulator. Updated the README to document this feature and modified the relevant classes to handle the emulator endpoint based on the configuration. Added a test to verify the emulator configuration is correctly defined and parsed.
@jusemon
Copy link
Copy Markdown
Contributor Author

jusemon commented Jan 21, 2026

Hi @matt-kwong, could you help me review this one? I have been using in for our local development successfully, the connector is also used in prod, no issues neither.

Thank you!

Copy link
Copy Markdown
Collaborator

@matt-kwong matt-kwong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing the feedback from the other PR!

Aside from my formatting comments, could you also address the build and formatting errors in the PR checks?

Comment thread src/main/java/com/google/pubsub/kafka/sink/CloudPubSubSinkTask.java
Comment thread src/main/java/com/google/pubsub/kafka/sink/CloudPubSubSinkTask.java Outdated
@jusemon
Copy link
Copy Markdown
Contributor Author

jusemon commented Feb 5, 2026

Thanks for addressing the feedback from the other PR!

Aside from my formatting comments, could you also address the build and formatting errors in the PR checks?

Hi @matt-kwong, all comments has been addressed

@jusemon jusemon requested a review from matt-kwong February 5, 2026 05:06
@dsaheb dsaheb requested review from dsaheb and removed request for a team February 5, 2026 20:40
@matt-kwong matt-kwong added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 5, 2026
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Feb 5, 2026
@matt-kwong matt-kwong closed this Feb 9, 2026
@matt-kwong matt-kwong reopened this Feb 9, 2026
@matt-kwong matt-kwong merged commit 3d601ef into googleapis:main Feb 9, 2026
22 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Connector cps.endpoint config does not target emulator

4 participants