Different destnations in a single websocket connection
Hi,
I have two issues:
-
I am sending JSON data to the server from jmeter. But the server is producing the following log: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of
[Ljava.lang.String;
out of START_OBJECT token at [Source: (String)"{"sender":"a", "receiver":"b", "message":"hi"}"; line: 1, column: 1] I changed the type of parameter to String but the issue persists. I know the plugin only supports Text and binary data but there has to be a way to send JSON data also. -
I have various destinations in a single websocket connection. I am confused how to specify in jmeter, the destination to which I want to send the data.
Comments (10)
-
repo owner -
repo owner - marked as trivial
-
Hi, I have the same doubt. Different destinations means different paths to which a user subscribes. For example, in a chat application made using STOMP in spring boot, a user may subscribe to paths like “app/join/” to join chat and “app/chat” to send a message under a single websocket connection. So while load testing he might want to test for join feature only. How can this be done through this plugin?
-
And these destinations are made under the same websocket request url. So basically under a single websocket url there may be multiple subscription destinations(in case of spring boot).
-
repo owner Clearly, these subscription thing is on application protocol level. On websocket level, these are just messages with different content, sent to the same server. Of course that can be done with the plugin.
-
Yes i agree but actually I am not able to find any option in the plugin that can specify the destination where I am sending the data. My doubt is whether this will be done automatically by plugin or do I need to specify this manually .
Also while sending the JSON, the JSON data is not going inside any method as I cannot log the data whenever I send it through jmeter. So I don’t think there is a syntax error there. It would be great if you can give me some insights there.
-
repo owner The plugin has nothing to do with “destination”. The plugin implements the websocket protocol, in the websocket protocol, there is no such thing as “destination”. There are only text or binary messages that are sent and received, that is all. Everything else is on application protocol level, so you have to “code” such things yourself in the data you are sending. Probably, this destination thing is a property in the JSON that is sent.
If you don’t know how the application protocol is defined, you will have a really hard time to create a test plan that works. I can recommend using a tool as WireShark to capture a session between a normal client and your server, so you can understand what messages client and server are exchanging exactly. Than it will be a lot easier to write a JMeter test plan that mimics that behaviour.
“Also while sending the JSON, the JSON data is not going inside any method as I cannot log the data whenever I send it through jmeter.”
I don’t understand this sentence.
-
I mean whenever I send JSON data using jmeter, my server logs a message “Cannot deserialize instance of
[Ljava.lang.String;
out of START_OBJECT token”, something like this. Then I tried to print the data using System.out.println() inside a method where I am using the Json data. But it only producing the error. So I assume that the error is occuring before any method is executing. I can not understand why this is happening. -
repo owner Ok. Well, as explained, i cannot help you with this, as it is happening on a higher protocol level that the plugin has no knowledge about. Also for this issue, having a WireShark capture would make things a lot more easy. Not only gives it insight what the messages should be, but you can also capture the messages your test is producing and compare them to understand what you’re doing wrong.
-
Okay. Thank You.
- Log in to comment
Cheers
Peter