OCI Streaming Service: Inconsistent Message Ordering Across Partitions in Python Consumer
I'm upgrading from an older version and I'm building a feature where I tried several approaches but none seem to work. I'm experiencing issues with message ordering in the Oracle Cloud Infrastructure (OCI) Streaming service when using a Python consumer. I have set up my topic with three partitions, which is intended to provide scalability. However, when I consume messages using the `oci.streaming` library, the order of the messages seems to be inconsistent across different partitions. Here’s a simplified version of my consumer code: ```python import oci import json stream_client = oci.streaming.StreamClient(config) stream_id = "your_stream_id" partition_id = "0" # Consuming from partition 0 while True: response = stream_client.get_messages(stream_id, partition_id, 10) for message in response.data: print(f'Received message: {json.loads(message.value)}') ``` I’ve verified that the producer sends messages in a specific order, but when they are consumed, the messages from partition 0 are frequently out of order with respect to the sequence they were sent. I’ve tried adding a delay between message sends, but this didn’t seem to affect the ordering scenario. I also confirmed that I’m only consuming from one partition at a time. Is this expected behavior with multiple partitions, or is there a configuration I might be missing? Additionally, I’m using version 2.23.0 of the OCI SDK for Python. Any insights on how to maintain message ordering or if there are best practices for handling this scenario would be greatly appreciated. For context: I'm using Python on Linux. Any ideas what could be causing this? I'm coming from a different tech stack and learning Python. Any feedback is welcome! This issue appeared after updating to Python stable. Hoping someone can shed some light on this. I'm using Python latest in this project. Thanks for taking the time to read this!