Skip to content

chore(pubsub): migrate java-pubsub to monorepo #12963

Draft
meltsufin wants to merge 2369 commits intomainfrom
migrate-java-pubsub
Draft

chore(pubsub): migrate java-pubsub to monorepo #12963
meltsufin wants to merge 2369 commits intomainfrom
migrate-java-pubsub

Conversation

@meltsufin
Copy link
Copy Markdown
Member

Using script from here: #12962.

renovate-bot and others added 30 commits May 8, 2025 12:42
#2423)

* chore: Update generation configuration at Thu May  8 02:33:47 UTC 2025

* chore: Update generation configuration at Fri May  9 02:33:27 UTC 2025

* chore: generate libraries at Fri May  9 02:33:55 UTC 2025

* chore: Update generation configuration at Sat May 10 02:31:30 UTC 2025

* chore: Update generation configuration at Sun May 11 02:34:28 UTC 2025

* chore: generate libraries at Sun May 11 02:34:56 UTC 2025
#2426)

* chore: Update generation configuration at Tue May 13 02:33:49 UTC 2025

* chore: generate libraries at Tue May 13 02:34:16 UTC 2025

* chore: Update generation configuration at Wed May 14 02:33:21 UTC 2025

* chore: Update generation configuration at Thu May 15 02:33:12 UTC 2025

* chore: generate libraries at Thu May 15 02:33:38 UTC 2025
* docs(sample): Add samples for topic and subscription SMTs

* docs(sample): Add samples for topic and subscription SMTs

* Fix missing paren

* Formatting fixes
* chore(main): release 1.139.4

* chore: generate libraries at Thu May 15 19:36:21 UTC 2025

---------

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: cloud-java-bot <cloud-java-bot@google.com>
#2432)

* chore: Update generation configuration at Fri May 16 02:34:07 UTC 2025

* chore: generate libraries at Fri May 16 02:34:49 UTC 2025

* chore: Update generation configuration at Sat May 17 02:32:21 UTC 2025

* chore: Update generation configuration at Tue May 20 02:34:14 UTC 2025

* chore: Update generation configuration at Wed May 21 02:34:06 UTC 2025

* chore: Update generation configuration at Thu May 22 02:33:49 UTC 2025

* chore: generate libraries at Thu May 22 02:34:17 UTC 2025
…with exactly-once samples (#2437)

* docs(sample): Update SubscribeWithErrorListener sample to not rebuild the subscriber

* docs(sample): Add locational endpoint for exactly-once subscriber sample

* docs(sample): Add comment explaining reasoning for locational endpoint
#2439)

* chore: Update generation configuration at Fri May 23 02:33:50 UTC 2025

* chore: Update generation configuration at Sat May 24 02:32:02 UTC 2025

* chore: generate libraries at Sat May 24 02:32:35 UTC 2025

* chore: Update generation configuration at Tue May 27 02:33:50 UTC 2025
* chore(main): release 1.139.5-SNAPSHOT

* chore: generate libraries at Mon Jun  2 19:45:44 UTC 2025

---------

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: cloud-java-bot <cloud-java-bot@google.com>
…#2441)

* chore: Update generation configuration at Wed May 28 02:34:10 UTC 2025

* chore: generate libraries at Wed May 28 02:34:40 UTC 2025

* chore: Update generation configuration at Thu May 29 02:34:15 UTC 2025

* chore: Update generation configuration at Sat May 31 02:32:59 UTC 2025

* chore: Update generation configuration at Sun Jun  1 02:46:12 UTC 2025

* chore: Update generation configuration at Tue Jun  3 02:34:37 UTC 2025

* chore: generate libraries at Tue Jun  3 02:35:10 UTC 2025
…v3.49.0 (#2446)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:sdk-platform-java-config](https://redirect.github.com/googleapis/java-shared-config) | `3.48.0` -> `3.49.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/com.google.cloud:sdk-platform-java-config/3.49.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.google.cloud:sdk-platform-java-config/3.49.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.google.cloud:sdk-platform-java-config/3.48.0/3.49.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.google.cloud:sdk-platform-java-config/3.48.0/3.49.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/googleapis/java-pubsub).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MC4zMy42IiwidXBkYXRlZEluVmVyIjoiNDAuMzMuNiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
🤖 I have created a release *beep* *boop*
---


## [1.140.0](https://togithub.com/googleapis/java-pubsub/compare/v1.139.4...v1.140.0) (2025-06-03)


### Features

* Add SchemaViolationReason to IngestionFailureEvent ([21cc376](https://togithub.com/googleapis/java-pubsub/commit/21cc3764aaa6fc05eb4a5078a72dae30694fba91))


### Dependencies

* Update dependency com.google.cloud:google-cloud-bigquery to v2.50.1 ([#2435](https://togithub.com/googleapis/java-pubsub/issues/2435)) ([b37c557](https://togithub.com/googleapis/java-pubsub/commit/b37c5573e1d0d7eada4ce4ec6a052521ea11cff1))
* Update dependency com.google.cloud:google-cloud-storage to v2.52.3 ([#2436](https://togithub.com/googleapis/java-pubsub/issues/2436)) ([4f309d1](https://togithub.com/googleapis/java-pubsub/commit/4f309d151d4bd584a33a0bb8882d0614a1b9d533))
* Update dependency com.google.cloud:sdk-platform-java-config to v3.49.0 ([#2444](https://togithub.com/googleapis/java-pubsub/issues/2444)) ([a59135c](https://togithub.com/googleapis/java-pubsub/commit/a59135c6859d0aa5c247a6a1f60872c959123cc7))
* Update dependency com.google.cloud:sdk-platform-java-config to v3.49.0 ([#2446](https://togithub.com/googleapis/java-pubsub/issues/2446)) ([6434be1](https://togithub.com/googleapis/java-pubsub/commit/6434be16560fdc8797b7c930b06df38c0972c96c))
* Update dependency com.google.protobuf:protobuf-java-util to v4.31.0 ([#2430](https://togithub.com/googleapis/java-pubsub/issues/2430)) ([232fac1](https://togithub.com/googleapis/java-pubsub/commit/232fac1c47e0d3680dcc8d56b69d65ed0d379dde))
* Update googleapis/sdk-platform-java action to v2.59.0 ([#2445](https://togithub.com/googleapis/java-pubsub/issues/2445)) ([12d4cfb](https://togithub.com/googleapis/java-pubsub/commit/12d4cfb7d67dbb163b3a545ea2ebae450e88283d))


### Documentation

* **sample:** Update the subscribe with error listener and subscribe with exactly-once samples ([#2437](https://togithub.com/googleapis/java-pubsub/issues/2437)) ([17c142b](https://togithub.com/googleapis/java-pubsub/commit/17c142b20efb79f9c71fc6306cb3ee4e15c5e06f))

---
This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
🤖 I have created a release *beep* *boop*
---


### Updating meta-information for bleeding-edge SNAPSHOT release.

---
This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
…#2451)

* chore: Update generation configuration at Wed Jun  4 02:34:46 UTC 2025

* chore: generate libraries at Wed Jun  4 02:35:14 UTC 2025

* upgrade easymock to newest for jdk24 support.

* Revert "upgrade easymock to newest for jdk24 support."

This reverts commit 47aae6241d1de2c433b4401b145467c214d2cd04.

* chore: Update generation configuration at Thu Jun  5 02:34:31 UTC 2025

---------

Co-authored-by: Min Zhu <zhumin@google.com>
* chore(main): release 1.140.1

* chore: generate libraries at Thu Jun  5 20:17:58 UTC 2025

---------

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: cloud-java-bot <cloud-java-bot@google.com>
🤖 I have created a release *beep* *boop*
---


### Updating meta-information for bleeding-edge SNAPSHOT release.

---
This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
* deps: update dependency org.easymock:easymock to v5.6.0

* chore: run dependency tree

* chore: give easymock's transitive dependencies precedence over mockito's

---------

Co-authored-by: Diego Marquez <diegomarquezp@google.com>
release-please Bot and others added 6 commits March 23, 2026 16:10
* chore(main): release 1.150.0

* chore: generate libraries at Mon Mar 23 15:30:22 UTC 2026

---------

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: cloud-java-bot <cloud-java-bot@google.com>
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
…v3.61.0 (#2714)

* deps: update dependency com.google.cloud:sdk-platform-java-config to v3.61.0

* build: fix unmanaged dependency check

---------

Co-authored-by: Diego Marquez <diegomarquezp@google.com>
#2713)

* chore: Update generation configuration at Tue Mar 24 03:02:27 UTC 2026

* chore: Update generation configuration at Wed Mar 25 03:04:37 UTC 2026

* chore: Update generation configuration at Thu Mar 26 03:06:35 UTC 2026

* chore: generate libraries at Thu Mar 26 03:07:04 UTC 2026

* chore: Update generation configuration at Fri Mar 27 03:06:58 UTC 2026

* chore: Update generation configuration at Sat Mar 28 03:03:59 UTC 2026

* chore: generate libraries at Sat Mar 28 03:04:25 UTC 2026

* chore: Update generation configuration at Tue Mar 31 03:06:58 UTC 2026

* chore: Update generation configuration at Wed Apr  1 03:06:55 UTC 2026

* chore: Update generation configuration at Thu Apr  2 03:06:32 UTC 2026

* chore: Update generation configuration at Fri Apr  3 03:06:35 UTC 2026

* chore: Update generation configuration at Tue Apr  7 03:06:43 UTC 2026

* chore: generate libraries at Tue Apr  7 03:07:16 UTC 2026

* chore: Update generation configuration at Wed Apr  8 03:06:45 UTC 2026

* chore: Update generation configuration at Thu Apr  9 03:06:29 UTC 2026

* chore: Update generation configuration at Fri Apr 10 03:07:38 UTC 2026

* chore: Update generation configuration at Sat Apr 11 03:05:07 UTC 2026

* chore: Update generation configuration at Mon Apr 13 03:08:33 UTC 2026

* chore: Update generation configuration at Tue Apr 14 03:07:21 UTC 2026

* build: use correct action version

* chore: generate libraries at Tue Apr 14 14:49:54 UTC 2026

* deps: correct graalvm image version

* chore: generate libraries at Tue Apr 14 17:04:16 UTC 2026

* chore: update generator version to 2.71.0

* chore: generate libraries at Tue Apr 14 17:10:27 UTC 2026

---------

Co-authored-by: Diego Marquez <diegomarquezp@google.com>
* chore(main): release 1.150.1

* chore: generate libraries at Tue Apr 14 17:28:43 UTC 2026

* fix: restore Version.java

---------

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: cloud-java-bot <cloud-java-bot@google.com>
Co-authored-by: Diego Marquez <diegomarquezp@google.com>
* chore: generate libraries at Tue Apr 21 17:39:00 UTC 2026

* chore: Use gapic-libraries-bom version for tags

---------

Co-authored-by: cloud-java-bot <cloud-java-bot@google.com>
@meltsufin meltsufin changed the title chore(pubsub): migrate java-pubsub to monorepo chore(pubsub): migrate java-pubsub to monorepo Apr 29, 2026
@meltsufin meltsufin force-pushed the migrate-java-pubsub branch 2 times, most recently from 035a624 to 5ba73bf Compare April 29, 2026 20:56
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds support for the Google Cloud Pub/Sub Java client library, including configuration, documentation, and necessary infrastructure files. My review identified several issues: the Publisher class incorrectly handles thread interruptions, the Waiter class has a thread-safety issue with its pendingCount() method, the LoggingUtil class should be made fully static, and there are missing imports in the provided code snippets for TimeUnit.

Comment on lines +1034 to +1038
}
lock.unlock();
try {
messageWaiter.await();
} catch (InterruptedException e) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

This block catches InterruptedException but does not restore the interrupt status or exit the loop. While CountDownLatch.await() clears the interrupt status when throwing, ignoring the interruption prevents the thread from being shut down correctly by its owner. Since this method's signature does not allow throwing InterruptedException, it is better to use Uninterruptibles.awaitUninterruptibly to handle the wait correctly while preserving the interrupt status for the caller.

          com.google.common.util.concurrent.Uninterruptibles.awaitUninterruptibly(messageWaiter);

Comment on lines +1076 to +1080
}
lock.lock();
}

outstandingBytes += bytesRemaining;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

Similar to the message waiter above, this block swallows InterruptedException. Use Uninterruptibles.awaitUninterruptibly to ensure the interrupt status is correctly managed without breaking the method signature.

          com.google.common.util.concurrent.Uninterruptibles.awaitUninterruptibly(bytesWaiter);

Comment on lines +85 to +87
public int pendingCount() {
return pendingCount;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The pendingCount() method accesses the pendingCount field without synchronization. Since this field is modified within synchronized blocks in other methods, this read is not thread-safe and may return stale values due to lack of visibility guarantees. This method should be marked as synchronized to ensure thread-safety for shared state.

Suggested change
public int pendingCount() {
return pendingCount;
}
public synchronized int pendingCount() {
return pendingCount;
}
References
  1. Ensure that counters or state accessed concurrently by multiple threads are thread-safe, either by using Atomic types or by protecting access with synchronization/locks.

}
}

public LoggingUtil() {}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

This class is designed as a utility class with static loggers and methods that do not use instance state. It should have a private constructor to prevent instantiation, and its methods should ideally be made static to reflect its stateless nature.

Comment on lines +25 to +31
import com.google.api.core.ApiFuture;
import com.google.api.core.ApiFutureCallback;
import com.google.api.core.ApiFutures;
import com.google.cloud.pubsub.v1.Publisher;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.protobuf.ByteString;
import com.google.pubsub.v1.PubsubMessage;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The code snippet for publishing messages uses TimeUnit.MINUTES in the finally block (line 55), but the java.util.concurrent.TimeUnit import is missing from the snippet's import section.

  import com.google.api.core.ApiFuture;
  import com.google.api.core.ApiFutureCallback;
  import com.google.api.core.ApiFutures;
  import com.google.cloud.pubsub.v1.Publisher;
  import com.google.common.util.concurrent.MoreExecutors;
  import com.google.protobuf.ByteString;
  import com.google.pubsub.v1.PubsubMessage;
  import java.util.concurrent.TimeUnit;

Comment thread java-pubsub/README.md
Comment on lines +125 to +131
import com.google.api.core.ApiFuture;
import com.google.api.core.ApiFutureCallback;
import com.google.api.core.ApiFutures;
import com.google.cloud.pubsub.v1.Publisher;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.protobuf.ByteString;
import com.google.pubsub.v1.PubsubMessage;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The code snippet for publishing messages is missing the import for java.util.concurrent.TimeUnit, which is required for the awaitTermination call on line 156.

Suggested change
import com.google.api.core.ApiFuture;
import com.google.api.core.ApiFutureCallback;
import com.google.api.core.ApiFutures;
import com.google.cloud.pubsub.v1.Publisher;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.protobuf.ByteString;
import com.google.pubsub.v1.PubsubMessage;
import com.google.api.core.ApiFuture;
import com.google.api.core.ApiFutureCallback;
import com.google.api.core.ApiFutures;
import com.google.cloud.pubsub.v1.Publisher;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.protobuf.ByteString;
import com.google.pubsub.v1.PubsubMessage;
import java.util.concurrent.TimeUnit;

@meltsufin meltsufin force-pushed the migrate-java-pubsub branch 5 times, most recently from 955e798 to 2d5d575 Compare April 30, 2026 14:24
@meltsufin meltsufin force-pushed the migrate-java-pubsub branch from 92cec8c to fef626e Compare April 30, 2026 14:53
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.