Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.IllegalStateException for wss place order #5

Open
VictorFrWu opened this issue Mar 27, 2024 · 2 comments
Open

java.lang.IllegalStateException for wss place order #5

VictorFrWu opened this issue Mar 27, 2024 · 2 comments

Comments

@VictorFrWu
Copy link

there's a mismatch between the expected template ID in your decoder and the template ID in the message you received. Your decoder is expecting a template ID of 103, as indicated in the ExchangeInfoResponseDecoder class, but the received message has a template ID of 50.
echo '{"id":"93fb61ef-89f8-4d6e-b022-4f035a3fadad","method":"exchangeInfo","params":{}}' | ./tools/websocket_send.py 'wss://ws-api.binance.com:443/ws-api/v3?responseFormat=sbe&sbeSchemaId=1&sbeSchemaVersion=0' | java -jar ./target/sbe-sample-app-1.0-SNAPSHOT.jar -
Exception in thread "main" java.lang.IllegalStateException: Invalid TEMPLATE_ID: 50
at spot_sbe.ExchangeInfoResponseDecoder.wrapAndApplyHeader(ExchangeInfoResponseDecoder.java:94)

@VictorFrWu
Copy link
Author

@aisling-2 could you have a look? not sure it's because of version of message tye or schema
public ExchangeInfoResponseDecoder wrapAndApplyHeader(
final DirectBuffer buffer,
final int offset,
final MessageHeaderDecoder headerDecoder)
{
headerDecoder.wrap(buffer, offset);

    final int templateId = headerDecoder.templateId();
    if (TEMPLATE_ID != templateId)
    {
        throw new IllegalStateException("Invalid TEMPLATE_ID: " + templateId);
    }

    return wrap(
        buffer,
        offset + MessageHeaderDecoder.ENCODED_LENGTH,
        headerDecoder.blockLength(),
        headerDecoder.version());
}

@VictorFrWu
Copy link
Author

@aisling-2 @2pd @bnbot could you have a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant