question

Upvotes
Accepted
1 0 0 0

WebSocket Responce Error

Hi Team,


Using Java websocket to connect to WebSocket API, the request is {"ID":2,"Key":{"Name":"SHICNY3MD="}},the error is "Request Rejected:Request Key did not contain service Id".

How to fix this?


Thanks

#technologywebsocketsjava
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
Accepted
28k 68 18 14

Hello @dreamjie2020

I am assuming that you are connecting to your local RTDS server.

This "Request Rejected:Request Key did not contain service Id" error message means your local RTDS server does not configure a default service id in the RTDS configuration. The WebSocket applications must specify a service in the item requests like the following:

{
  "ID":2,
  "Key":{
    "Name":"<RIC Name>",
    "Service":"<Service Name>"
  }
}

Example:

{
  "ID":2,
  "Key":{
    "Name":"JPY=",
    "Service":"ELEKTRON_DD"
  }
}

Please contact your local Market Data team about your RTDS service name.

### RTDS Default Service ID ###

The default WebSocket request service id can be set via the following RTDS configuration

*ads*defaultJsonServiceId: <Service ID>

This RTDS configuration defines the default service for the WebSocket client applications. The service can be overridden in the JSON request message.

If defaultJsonServiceId is empty, there is no default service id. The WebSocket applications must always specify a service in the item requests.

Please contact your local Market Data team if you need this RTDS parameter to be configured.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvote
25.1k 68 15 21

Hi @dreamjie2020,

For an application built using Java, another option is to use the EMA SDK. The SDK is easy to use and automates all the tasks of connecting, maintaining a session, automatic recovery and re-subscription in case of disconnect etc. This free's up a lot of application's tasks like maintaining periodic handshake messages with the server.

EMA can use both Websockets as a transport and also binary RSSL protocol and can seamlessly get data from hosted RTMDS, as well as RTO cloud.

See this Quickstart guide for EMA, if you are interested.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.