For a deeper look into our Elektron API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 1 1 1

Does the WebSocket spec support Packing of Posting Messages for Performance

When receiving messages form the ADS via WebSocket, the ADS packs multiple updates into an array of messages. The format appears to be and array of JSON formatted messages.

When posting publishing for performance testing, it would be beneficial to able to pack the post update messages into an array of messages and then send the array.

Is this possible? I can find no reference to message packing in the spec, the examples or on the forums.

Thanks!

#productwebsocketsjsonposting
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.

1 Answer

· Write an Answer
Upvote
Accepted
80.1k 257 52 75

@michael.sherman

Thank you for reaching out to us.

I tested with ADS 3.5.1.L1 and it can support an array of post messages.

I sent the following JSON messages to the server.

[
    {
        "Ack": true,
        "Domain": "MarketPrice",
        "ID": 3,
        "Message": {
            "Domain": "MarketPrice",
            "Fields": {
                "ASK": 453.60,
                "BID": 452.60
            },
            "ID": 0,
            "Type": "Update"
        },
        "PostID": 20,
        "PostUserInfo": {
            "Address": "127.0.0.1",
            "UserID": 10000
        },
        "Type": "Post"
    },
    {
        "Ack": true,
        "Domain": "MarketPrice",
        "ID": 3,
        "Message": {
            "Domain": "MarketPrice",
            "Fields": {
                "ASK": 600.60,
                "BID": 452.60
            },
            "ID": 0,
            "Type": "Update"
        },
        "PostID": 21,
        "PostUserInfo": {
            "Address": "127.0.0.1",
            "UserID": 10000
        },
        "Type": "Post"
    }
]

Then, I got the following responses back.

[
    {
        "ID": 3,
        "Type": "Update",
        "UpdateType": "Unspecified",
        "Key": {
            "Service": "DIST_CACHE",
            "Name": "IBM.N"
        },
        "Fields": {
            "ASK": 453.60,
            "BID": 452.60
        }
    },
    {
        "ID": 3,
        "Type": "Ack",
        "AckID": 20
    },
    {
        "ID": 3,
        "Type": "Update",
        "UpdateType": "Unspecified",
        "Key": {
            "Service": "DIST_CACHE",
            "Name": "IBM.N"
        },
        "Fields": {
            "ASK": 600.60,
            "BID": 452.60
        }
    },
    {
        "ID": 3,
        "Type": "Ack",
        "AckID": 21
    }
]
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.

Thanks so much Jirapongse, this worked perfectly! Thanks for both the speed and accuracy of the response!

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.