Skip to content

Commit 8b2d0b7

Browse files
fix: Only check keyHasError if ordering key is non-empty (#367)
* feat: Add flow control support to publisher * make suggested fixes * chore: Remove note that ordering keys requires enablements. * feat: Add support for server-side flow control * Revert "chore: Remove note that ordering keys requires enablements." This reverts commit 9c113c3. * fix: Fix import order * fix: Make error message more clear about where ordering must be enabled when publishing. * fix: Ensure that messages that are in pending batches for an ordering key are canceled when a previous publish for the ordering keys fails. * fix: Only check keyHasError if ordering keys is non-empty
1 parent 7cdf8bc commit 8b2d0b7

File tree

1 file changed

+1
-1
lines changed
  • google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1

1 file changed

+1
-1
lines changed

google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/Publisher.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ public ApiFuture<String> publish(PubsubMessage message) {
256256
List<OutstandingBatch> batchesToSend;
257257
messagesBatchLock.lock();
258258
try {
259-
if (sequentialExecutor.keyHasError(orderingKey)) {
259+
if (!orderingKey.isEmpty() && sequentialExecutor.keyHasError(orderingKey)) {
260260
outstandingPublish.publishResult.setException(
261261
SequentialExecutorService.CallbackExecutor.CANCELLATION_EXCEPTION);
262262
return outstandingPublish.publishResult;

0 commit comments

Comments
 (0)