real-logic / simple-binary-encoding

Simple Binary Encoding (SBE) - High Performance Message Codec
Apache License 2.0
3.12k stars 524 forks source link

MessageHeader Decoder issues when Encoding is done with different language. #1015

Closed cyberpower715 closed 2 months ago

cyberpower715 commented 2 months ago

Hi, We are trying to create a C++ SBE Decoder application for a message that is being sent on TCP Socket. The Encoder side application is using Java SBE Encoder and pumping the message onto a TCP socket. (Encoder side uses "wrapAnddApplyHeader" method + other data encoding)

On C++ Decoder application side, we see that MessageHeader is unable to decode the received message. (The message is received correctly over the TCP Socket. Its just that the MessageHeader is not correctly decoded.)

Can anyone please let me know if we can use the C++ codecs for decoding a message that is sent using Java codecs ? Thank you.

pluto699 commented 2 months ago

Hi @cyberpower715

Can anyone please let me know if we can use the C++ codecs for decoding a message that is sent using Java codecs ?

yes, you can

vyazelenko commented 2 months ago

@cyberpower715 Yes, it is possible to decode messages in C++ that were encoded in Java and vice versa. Aeron uses C++ SBE codecs for the Aeron Archive client while connecting to the Archive that is written in Java.

For the C++/Java interop you need to ensure that the same schema is used for both languages.