GCP Pub/Sub Message Ordering Issues When Using Node.js Client Library 3.0.0
Quick question that's been bugging me - I'm learning this framework and I'm prototyping a solution and I'm experiencing message ordering issues with Google Cloud Pub/Sub while using the Node.js client library version 3.0.0... Despite enabling message ordering on my subscription, I notice that messages are being processed out of order. My subscription is configured correctly, and Iām using the `publishMessage` method with the same ordering key for all messages. Here's a simplified version of my implementation: ```javascript const { PubSub } = require('@google-cloud/pubsub'); const pubSubClient = new PubSub(); const topicName = 'my-topic'; const orderingKey = 'my-ordering-key'; async function publishMessage(data) { const dataBuffer = Buffer.from(data); const messageId = await pubSubClient.topic(topicName).publishMessage({ data: dataBuffer, orderingKey: orderingKey }); console.log(`Message ${messageId} published.`); } (async () => { await publishMessage('First Message'); await publishMessage('Second Message'); await publishMessage('Third Message'); })(); ``` I ensured that the subscription is set to "Enable message ordering" in the console. However, when I consume the messages using a subscriber, they arrive out of order: ``` Received message: 'Third Message' Received message: 'First Message' Received message: 'Second Message' ``` I've tried increasing the acknowledgment deadline and verified that my subscriber is processing messages sequentially. I also checked the Pub/Sub quotas, and Iām well within limits. Is there something I'm missing regarding the configuration, or is this a known issue with the Node.js library? Any insights or suggestions would be greatly appreciated! This is for a microservice running on Ubuntu 20.04. Any ideas how to fix this? This is happening in both development and production on Ubuntu 22.04. Thanks for taking the time to read this! This issue appeared after updating to Javascript 3.10. Am I missing something obvious?