support for websocket with protobuf

Issue #193 resolved
Anif Anif created an issue

Hi

Can i use this plugin for websocket with protobuf?

Comments (4)

  1. Peter Doornbosch repo owner

    Yes, you can, but you have to assemble the Protobuf messages yourself in your JMeter test plan. The websocket plugin implements the WebSocket protocol and (obviously) facilitates sending and receiving WebSocket messages. Lots of applications use another protocol on top of the WebSocket protocol, e.g. SignalR, and in order to test such a protocol with the plugin, you will need to adapt your test plan to send these higher level protocol messages. In case the higher level protocol is text or JSON based (e.g. SignalR) or text oriented (STOMP), you can simply enter the text or JSON string in the request data field. For binary protocols (e.g. Protocol Buffers), assembling the message payload can be more challenging, but it is feasible (the websocket plugin can send binary data frames, select "Binary" in the data type dropdown).

    Hth
    Peter

  2. Anif Anif reporter

    Hi @Peter Doornbosch

    Thanks for the insight. The binary payload from plugin support any format e.g Uint8Array or should be uploaded as binary file in the request payload?

  3. Peter Doornbosch repo owner

    hex formatted string in the input field or raw binary read from file, as documented in the readme:

    https://bitbucket.org/pjtr/jmeter-websocket-samplers/src/master/

    The request-response sampler, as well as the single-read and single-write samplers, support both text and binary frames. For binary frames, enter the payload in hexadecimal format, e.g. 0xca 0xfe or ba be; JMeter variables can be used, but should resolve to hex format at runtime. On linux system, you can use the following command to generate hex format from a binary file: hexdump -e '16/1 "0x%02x " " "' myFile.wav.

    The payload (request data) can also be loaded from file, in which case it is not interpreted at all, but sent as is. Hence, JMeter variables cannot be used (or at least: will not be resolved) and binary content should be stored in binary files; e.g. not encoded in hex.

    Also useful for binary stuff:

    Standard JMeter cannot display binary responses in the results viewers, but this plugin adds a binary view to the "View Results Tree" listener element (if the "Response data" tab stays empty, select "Binary" in the types dropdown).

  4. Log in to comment