Search code examples
javaconcurrencybufferaeron

Aeron publication side concurrency issue on singleton request buffer


is there any best practice to handle concurrency on publish side?? assume that we have a client that wants to handle 1 Million concurrent requests, these requests must send to the Aeron server-side via publication offer. now we have a singleton expandable array buffer that overwrites and is corrupted by concurrency.


Solution

  • I'm assuming you are using a concurrent Publication and that is not the issue you have with concurrent access. The issue seems to be a shared buffer for the offer. To publish concurrently you can have thread local buffers to construct your messages within, or you can use Publication.tryClaim if the message length is less than MTU and construct the message using a thread local BufferClaim instance.