OCI Streaming Service Throughput Issues When Using Java SDK with High Volume Messages
After trying multiple solutions online, I still can't figure this out. I'm working with important throughput issues when sending messages to OCI Streaming Service using the Java SDK (version 2.38.0). My application is designed to process high-volume messages, but I'm observing delays and occasional timeouts. When I attempt to send around 1000 messages in quick succession, I often get the following behavior: `java.util.concurrent.ExecutionException: java.lang.RuntimeException: HTTP 429: Too Many Requests`. I've tried implementing exponential backoff for retries, but it seems to only slightly mitigate the scenario. Here's a snippet of my message producer implementation: ```java import com.oracle.bmc.streaming.StreamingClient; import com.oracle.bmc.streaming.model.PutMessagesDetails; import com.oracle.bmc.streaming.model.PutMessagesDetailsEntry; // Assuming necessary imports and setup public void produceMessages(String streamId) { StreamingClient streamingClient = StreamingClient.builder().build(); List<PutMessagesDetailsEntry> messages = new ArrayList<>(); for (int i = 0; i < 1000; i++) { messages.add(new PutMessagesDetailsEntry("Message " + i)); } PutMessagesDetails putMessagesDetails = PutMessagesDetails.builder().messages(messages).build(); streamingClient.putMessages(streamId, putMessagesDetails); } ``` The `streamingClient.putMessages()` method is called in a tight loop, and I am not managing the batch size effectively. I've also tested different batch sizes and found that even with 100 messages, I still receive the 429 errors intermittently. Any suggestions on how to optimize throughput or properly manage backoff strategies would be greatly appreciated. Is there a recommended best practice for handling high volume message production in OCI Streaming Service? Is there a better approach?