blazingmq-sdk-java icon indicating copy to clipboard operation
blazingmq-sdk-java copied to clipboard

Schema event builder allocate 4kb buffer to write 8 byte `EventHeader`

Open 678098 opened this issue 2 years ago • 0 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

If you log ByteBuffer[] generated by SchemaEventBuilder just before sending, you can see 2 buffers, one of these has limit==8 and capacity==4096. The event header is written to a separate buffer which is not used after this.

16:34:21,151 (pool-4-thread-1) ERROR RequestManager:319 java.nio.HeapByteBuffer[pos=0 lim=8 cap=4096]
16:34:21,151 (pool-4-thread-1) ERROR RequestManager:319 java.nio.HeapByteBuffer[pos=0 lim=228 cap=4096]
16:34:21,153 (pool-4-thread-1) INFO RequestManager:324 Message sent: Request message: {"rId":3,"openQueue":{"handleParameters":{"uri":"bmq://bmq.test.mem.fanout/java-it-5dfa06ed-f58c-40c0-ba70-9de9be753d77","qId":0,"subIdInfo":{"subId":2,"appId":"bar"},"flags":2,"readCount":1,"writeCount":0,"adminCount":0}}}; Timeout duration: PT20S

Expected Behavior

Will be good to use the same buffer for both event header and the event payload.

Steps To Reproduce

Log

BlazingMQ Java SDK Version

0.0.10

Anything else?

No response

678098 avatar Oct 24 '23 17:10 678098