Open sanjiely opened 9 years ago
We encountered the same issue when testing a webchat application that was exchanging a large amount of messages. The issue was resolved by changing the responseBacklog declaration from a LinkedList which doesn't support concurrent access to a ConcurrentLinkedQueue:
protected Deque<String> responeBacklog = new ConcurrentLinkedQueue<String>();
See https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ConcurrentLinkedQueue.html
Great idea! Let me try. Thanks.
Quick update that should be a ConcurrentLinkedDequeue:
new ConcurrentLinkedDeque<>();
Got it. Thanks.
2015-11-05 19:19 GMT+08:00 Joshua Michael Daly notifications@github.com:
Quick update that should be a ConcurrentLinkedDequeue:
new ConcurrentLinkedDeque<>();
— Reply to this email directly or view it on GitHub https://github.com/maciejzaleski/JMeter-WebSocketSampler/issues/43#issuecomment-154034401 .
I got an exception when running performance test, like: null pointer on the line 149 in ServiceSocket.java. The line is: responseMessage += iterator.next();
I guess the element had been removed by the poll method in "addResponseMessage" when to fetch it from this iterator. I try to add a "synchronized object" for both this code block and in the method "addResponseMessage", and this issue is resolved. My modifications in "getResponseMessage" :
and in "addResponseMessage":
I'm not familiar with Java. Above is just my point. Thanks.
Yong