GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — PubSub: Message ordering no longer being honored · Issue #1889 · googleapis/java-pubsub
This repository was archived by the owner on Aug 13, 2026. It is now read-only.
This repository was archived by the owner on Aug 13, 2026. It is now read-only.
PubSub: Message ordering no longer being honored #1889Copy link Copy link Closed Labels api: pubsubIssues related to the googleapis/java-pubsub API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release. DescriptionEnvironment details
Steps to reproduce
Code examplevar project = var topicName = TopicName.of(project, "andrew_test"); var publisher = Publisher.newBuilder(topicName).setEnableMessageOrdering(true).build(); try { for (int i = 0; i < 100; i++) { var data = ByteString.copyFromUtf8("hello #" + i); var message = PubsubMessage.newBuilder().setData(data).setOrderingKey("defabc").build(); publisher.publish(message); } } finally { publisher.shutdown(); publisher.awaitTermination(1, TimeUnit.MINUTES); } var subscriptionName = ProjectSubscriptionName.of(project, "andrew-test-sub"); var subscriber = Subscriber.newBuilder(subscriptionName, (PubsubMessage message, AckReplyConsumer consumer) -> { System.out.println("Id: " + message.getMessageId() + " Data: " + message.getData().toStringUtf8()); consumer.ack(); }).build(); try { subscriber.startAsync().awaitRunning(); subscriber.awaitTerminated(30, TimeUnit.SECONDS); } catch (TimeoutException e) { subscriber.stopAsync(); } Stack traceThis also seems to lead to more frequent occurrences of this stack trace External references such as API reference guidesn/a Any additional information belowThe above code snippet works fine in 1.125.11, but in 1.125.12 and 1.126.2 (the latest as of raise date) we are getting messages delivered out of order. I believe the root cause is the change from #1778 where under #1807 the LinkedHashSet was changed to a ConcurrentHashMap. When the notifyAckSuccess method is called, we are iterating over the outstandingReceipts to put into the outstandingBatch. Unfortunately this change switched it from insertion order to hash based ordering. I can mitigate all of these issues by setting the max-outstanding-element-count down to 1, but then we lose the ability to parallel process, or the benefits of batching. Activity
MetadataMetadataAssigneesLabelsapi: pubsubIssues related to the googleapis/java-pubsub API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release. TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |