August 2017
Intermediate to advanced
142 pages
3h
English
© Jorge Acetozi 2017
Jorge Acetozi, Pro Java Clustering and Scalability, https://doi.org/10.1007/978-1-4842-2985-9_19
Jorge Acetozi1
(1)São Paulo / SP, Brazil
When the client sends a public message in the chat room, the sendMessage JavaScript function is called. Essentially, it converts the instantMessage JavaScript object into a JSON representation and sends the message to the application destination /chatroom/send.message.
function sendMessage() {var instantMessage;if (spanSendTo.text() == "public") {instantMessage = {'text' : inputMessage.val()}} else {instantMessage = {'text' : inputMessage.val(),'toUser' : spanSendTo.text()}}stompClient.send("/chatroom/send.message", {}, JSON.stringify(instantMessage)); ...
Read now
Unlock full access