Skip to content

Commit

Permalink
Merge branch 'main' into owl-bot-update-lock-1fb09a3eb66af09221da6908…
Browse files Browse the repository at this point in the history
…7fd1b4d075bc7c79e508d0708f5dc0f842069da2
  • Loading branch information
michaelpri10 authored Feb 9, 2024
2 parents 4bff7e8 + 231ba51 commit 23f6a87
Show file tree
Hide file tree
Showing 20 changed files with 112 additions and 69 deletions.
2 changes: 1 addition & 1 deletion .github/.OwlBot.lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
docker:
image: gcr.io/cloud-devrel-public-resources/owlbot-java:latest
digest: sha256:1fb09a3eb66af09221da69087fd1b4d075bc7c79e508d0708f5dc0f842069da2
# created: 2024-02-05T19:43:08.106031548Z
# created: 2024-02-05T19:43:08.106031548Z
4 changes: 2 additions & 2 deletions .github/blunderbuss.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Configuration for the Blunderbuss GitHub app. For more info see
# https://github.com/googleapis/repo-automation-bots/tree/main/packages/blunderbuss
assign_issues:
- maitrimangal
- michaelpri10
assign_prs:
- maitrimangal
- michaelpri10
assign_prs_by:
- labels:
- samples
Expand Down
1 change: 0 additions & 1 deletion .github/sync-repo-settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ branchProtectionRules:
- units (8)
- units (11)
- 'Kokoro - Test: Integration'
- Kokoro - Against Pub/Sub Lite samples
- cla/google
- OwlBot Post Processor
- 'Kokoro - Test: Java GraalVM Native Image'
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/unmanaged_dependency_check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
on:
pull_request:
name: Unmanaged dependency check
jobs:
unmanaged_dependency_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
- name: Install modules
shell: bash
run: |
# No argument to build.sh installs the modules in local Maven
# repository
.kokoro/build.sh
- name: Unmanaged dependency check
uses: googleapis/sdk-platform-java/java-shared-dependencies/unmanaged-dependency-check@unmanaged-dependencies-check-latest
with:
bom-path: google-cloud-pubsub-bom/pom.xml
2 changes: 1 addition & 1 deletion .kokoro/presubmit/graalvm-native-17.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-kokoro-resources/graalvm17:22.3.3"
value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_b:3.24.0"
}

env_vars: {
Expand Down
2 changes: 1 addition & 1 deletion .kokoro/presubmit/graalvm-native.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-kokoro-resources/graalvm:22.3.3"
value: "gcr.io/cloud-devrel-public-resources/graalvm_sdk_platform_a:3.24.0"
}

env_vars: {
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## [1.126.4](https://github.com/googleapis/java-pubsub/compare/v1.126.3...v1.126.4) (2024-02-09)


### Bug Fixes

* Message ordering fix for [#1889](https://github.com/googleapis/java-pubsub/issues/1889) ([#1903](https://github.com/googleapis/java-pubsub/issues/1903)) ([22a87c6](https://github.com/googleapis/java-pubsub/commit/22a87c67f07b55266e277f83f5ceb17d9f32f67e))

## [1.126.3](https://github.com/googleapis/java-pubsub/compare/v1.126.2...v1.126.3) (2024-02-08)


### Dependencies

* Update dependency com.google.cloud:google-cloud-core to v2.32.0 ([#1885](https://github.com/googleapis/java-pubsub/issues/1885)) ([a2063cf](https://github.com/googleapis/java-pubsub/commit/a2063cf8f1f792f5ad1994bff00f367b399c0ff2))

## [1.126.2](https://github.com/googleapis/java-pubsub/compare/v1.126.1...v1.126.2) (2024-01-26)


Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>26.30.0</version>
<version>26.31.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -44,7 +44,7 @@ If you are using Maven without the BOM, add this to your dependencies:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-pubsub</artifactId>
<version>1.126.1</version>
<version>1.126.3</version>
</dependency>

```
Expand All @@ -59,13 +59,13 @@ implementation 'com.google.cloud:google-cloud-pubsub'
If you are using Gradle without BOM, add this to your dependencies:

```Groovy
implementation 'com.google.cloud:google-cloud-pubsub:1.126.2'
implementation 'com.google.cloud:google-cloud-pubsub:1.126.3'
```

If you are using SBT, add this to your dependencies:

```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-pubsub" % "1.126.2"
libraryDependencies += "com.google.cloud" % "google-cloud-pubsub" % "1.126.3"
```
<!-- {x-version-update-end} -->

Expand Down Expand Up @@ -409,7 +409,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-pubsub/java11.html
[stability-image]: https://img.shields.io/badge/stability-stable-green
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-pubsub.svg
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-pubsub/1.126.2
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-pubsub/1.126.3
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles
Expand Down
8 changes: 4 additions & 4 deletions google-cloud-pubsub-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-pubsub-bom</artifactId>
<version>1.126.3-SNAPSHOT</version><!-- {x-version-update:google-cloud-pubsub:current} -->
<version>1.126.4</version><!-- {x-version-update:google-cloud-pubsub:current} -->
<packaging>pom</packaging>
<parent>
<groupId>com.google.cloud</groupId>
Expand Down Expand Up @@ -52,17 +52,17 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-pubsub</artifactId>
<version>1.126.3-SNAPSHOT</version><!-- {x-version-update:google-cloud-pubsub:current} -->
<version>1.126.4</version><!-- {x-version-update:google-cloud-pubsub:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-cloud-pubsub-v1</artifactId>
<version>1.108.3-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-pubsub-v1:current} -->
<version>1.108.4</version><!-- {x-version-update:grpc-google-cloud-pubsub-v1:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-pubsub-v1</artifactId>
<version>1.108.3-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-pubsub-v1:current} -->
<version>1.108.4</version><!-- {x-version-update:proto-google-cloud-pubsub-v1:current} -->
</dependency>
</dependencies>
</dependencyManagement>
Expand Down
4 changes: 2 additions & 2 deletions google-cloud-pubsub/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-pubsub</artifactId>
<version>1.126.3-SNAPSHOT</version><!-- {x-version-update:google-cloud-pubsub:current} -->
<version>1.126.4</version><!-- {x-version-update:google-cloud-pubsub:current} -->
<packaging>jar</packaging>
<name>Google Cloud Pub/Sub</name>
<url>https://github.com/googleapis/java-pubsub</url>
<description>Java idiomatic client for Google Cloud Pub/Sub</description>
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-pubsub-parent</artifactId>
<version>1.126.3-SNAPSHOT</version><!-- {x-version-update:google-cloud-pubsub:current} -->
<version>1.126.4</version><!-- {x-version-update:google-cloud-pubsub:current} -->
</parent>
<properties>
<site.installationModule>google-cloud-pubsub</site.installationModule>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
Expand Down Expand Up @@ -92,8 +93,8 @@ class MessageDispatcher {
private final LinkedBlockingQueue<AckRequestData> pendingAcks = new LinkedBlockingQueue<>();
private final LinkedBlockingQueue<AckRequestData> pendingNacks = new LinkedBlockingQueue<>();
private final LinkedBlockingQueue<AckRequestData> pendingReceipts = new LinkedBlockingQueue<>();
private final ConcurrentMap<String, ReceiptCompleteData> outstandingReceipts =
new ConcurrentHashMap<String, ReceiptCompleteData>();
private final LinkedHashMap<String, ReceiptCompleteData> outstandingReceipts =
new LinkedHashMap<String, ReceiptCompleteData>();
private final AtomicInteger messageDeadlineSeconds = new AtomicInteger();
private final AtomicBoolean extendDeadline = new AtomicBoolean(true);
private final Lock jobLock;
Expand Down Expand Up @@ -397,7 +398,9 @@ void processReceivedMessages(List<ReceivedMessage> messages) {
if (this.exactlyOnceDeliveryEnabled.get()) {
// For exactly once deliveries we don't add to outstanding batch because we first
// process the receipt modack. If that is successful then we process the message.
outstandingReceipts.put(message.getAckId(), new ReceiptCompleteData(outstandingMessage));
synchronized (outstandingReceipts) {
outstandingReceipts.put(message.getAckId(), new ReceiptCompleteData(outstandingMessage));
}
} else if (pendingMessages.putIfAbsent(message.getAckId(), ackHandler) != null) {
// putIfAbsent puts ackHandler if ackID isn't previously mapped, then return the
// previously-mapped element.
Expand All @@ -417,33 +420,36 @@ void processReceivedMessages(List<ReceivedMessage> messages) {
}

void notifyAckSuccess(AckRequestData ackRequestData) {

if (outstandingReceipts.containsKey(ackRequestData.getAckId())) {
outstandingReceipts.get(ackRequestData.getAckId()).notifyReceiptComplete();
List<OutstandingMessage> outstandingBatch = new ArrayList<>();

for (Iterator<Entry<String, ReceiptCompleteData>> it =
outstandingReceipts.entrySet().iterator();
it.hasNext(); ) {
Map.Entry<String, ReceiptCompleteData> receipt = it.next();
// If receipt is complete then add to outstandingBatch to process the batch
if (receipt.getValue().isReceiptComplete()) {
it.remove();
if (pendingMessages.putIfAbsent(
receipt.getKey(), receipt.getValue().getOutstandingMessage().ackHandler)
== null) {
outstandingBatch.add(receipt.getValue().getOutstandingMessage());
synchronized (outstandingReceipts) {
if (outstandingReceipts.containsKey(ackRequestData.getAckId())) {
outstandingReceipts.get(ackRequestData.getAckId()).notifyReceiptComplete();
List<OutstandingMessage> outstandingBatch = new ArrayList<>();

for (Iterator<Entry<String, ReceiptCompleteData>> it =
outstandingReceipts.entrySet().iterator();
it.hasNext(); ) {
Map.Entry<String, ReceiptCompleteData> receipt = it.next();
// If receipt is complete then add to outstandingBatch to process the batch
if (receipt.getValue().isReceiptComplete()) {
it.remove();
if (pendingMessages.putIfAbsent(
receipt.getKey(), receipt.getValue().getOutstandingMessage().ackHandler)
== null) {
outstandingBatch.add(receipt.getValue().getOutstandingMessage());
}
} else {
break;
}
} else {
break;
}
processBatch(outstandingBatch);
}
processBatch(outstandingBatch);
}
}

void notifyAckFailed(AckRequestData ackRequestData) {
outstandingReceipts.remove(ackRequestData.getAckId());
synchronized (outstandingReceipts) {
outstandingReceipts.remove(ackRequestData.getAckId());
}
}

private void processBatch(List<OutstandingMessage> batch) {
Expand Down
4 changes: 2 additions & 2 deletions grpc-google-cloud-pubsub-v1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-cloud-pubsub-v1</artifactId>
<version>1.108.3-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-pubsub-v1:current} -->
<version>1.108.4</version><!-- {x-version-update:grpc-google-cloud-pubsub-v1:current} -->
<name>grpc-google-cloud-pubsub-v1</name>
<description>GRPC library for grpc-google-cloud-pubsub-v1</description>
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-pubsub-parent</artifactId>
<version>1.126.3-SNAPSHOT</version><!-- {x-version-update:google-cloud-pubsub:current} -->
<version>1.126.4</version><!-- {x-version-update:google-cloud-pubsub:current} -->
</parent>
<dependencies>
<dependency>
Expand Down
4 changes: 3 additions & 1 deletion owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1211,6 +1211,8 @@
".github/sync-repo-settings.yaml",
".github/blunderbuss.yml",
'.kokoro/requirements.in',
'.kokoro/requirements.txt'
'.kokoro/requirements.txt',
'.kokoro/presubmit/graalvm-native.cfg',
'.kokoro/presubmit/graalvm-native-17.cfg'
]
)
16 changes: 8 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-pubsub-parent</artifactId>
<packaging>pom</packaging>
<version>1.126.3-SNAPSHOT</version><!-- {x-version-update:google-cloud-pubsub:current} -->
<version>1.126.4</version><!-- {x-version-update:google-cloud-pubsub:current} -->
<name>Google Cloud Pub/Sub Parent</name>
<url>https://github.com/googleapis/java-pubsub</url>
<description>
Expand All @@ -13,8 +13,8 @@

<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-shared-config</artifactId>
<version>1.7.1</version>
<artifactId>sdk-platform-java-config</artifactId>
<version>3.24.0</version>
</parent>

<developers>
Expand Down Expand Up @@ -61,25 +61,25 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-shared-dependencies</artifactId>
<version>3.23.0</version>
<version>${google-cloud-shared-dependencies.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>

<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-pubsub-v1</artifactId>
<version>1.108.3-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-pubsub-v1:current} -->
<version>1.108.4</version><!-- {x-version-update:proto-google-cloud-pubsub-v1:current} -->
</dependency>
<dependency>
<groupId>com.google.api.grpc</groupId>
<artifactId>grpc-google-cloud-pubsub-v1</artifactId>
<version>1.108.3-SNAPSHOT</version><!-- {x-version-update:grpc-google-cloud-pubsub-v1:current} -->
<version>1.108.4</version><!-- {x-version-update:grpc-google-cloud-pubsub-v1:current} -->
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-pubsub</artifactId>
<version>1.126.3-SNAPSHOT</version><!-- {x-version-update:google-cloud-pubsub:current} -->
<version>1.126.4</version><!-- {x-version-update:google-cloud-pubsub:current} -->
</dependency>

<!-- Test dependencies -->
Expand All @@ -104,7 +104,7 @@
<dependency>
<groupId>com.google.truth</groupId>
<artifactId>truth</artifactId>
<version>1.3.0</version>
<version>1.4.0</version>
<scope>test</scope>
<exclusions>
<exclusion>
Expand Down
4 changes: 2 additions & 2 deletions proto-google-cloud-pubsub-v1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.api.grpc</groupId>
<artifactId>proto-google-cloud-pubsub-v1</artifactId>
<version>1.108.3-SNAPSHOT</version><!-- {x-version-update:proto-google-cloud-pubsub-v1:current} -->
<version>1.108.4</version><!-- {x-version-update:proto-google-cloud-pubsub-v1:current} -->
<name>proto-google-cloud-pubsub-v1</name>
<description>PROTO library for proto-google-cloud-pubsub-v1</description>
<parent>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-pubsub-parent</artifactId>
<version>1.126.3-SNAPSHOT</version><!-- {x-version-update:google-cloud-pubsub:current} -->
<version>1.126.4</version><!-- {x-version-update:google-cloud-pubsub:current} -->
</parent>
<dependencies>
<dependency>
Expand Down
6 changes: 3 additions & 3 deletions samples/install-without-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-pubsub</artifactId>
<version>1.126.1</version>
<version>1.126.3</version>
</dependency>
<!-- [END pubsub_install_without_bom] -->

Expand All @@ -69,7 +69,7 @@
<dependency>
<groupId>com.google.truth</groupId>
<artifactId>truth</artifactId>
<version>1.3.0</version>
<version>1.4.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -80,7 +80,7 @@
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-core</artifactId>
<version>2.31.0</version>
<version>2.32.0</version>
<classifier>tests</classifier>
</dependency>
<dependency>
Expand Down
Loading

0 comments on commit 23f6a87

Please sign in to comment.