bloomberg / bloomberg/blazingmq-sdk-java

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

Open
#43 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
34
Forks
19
Avg merge
7h
Merged PRs (30d)
27

Description

### 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_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.