الجمعة، 17 أبريل 2020

Create a simple Chat application with Spring Boot and Websocket

1- What is WebSocket?

WebSocket is a communication protocol, which helps establish a two-way communication channel between  client and  server. A communication protocol that you are familiar with is HTTP, and now, we will compare the characteristics of these two protocols:
HTTP (Hypertext Transfer Protocol): a  request-response protocol. When  Client (Browser) wants something, it will send a request to the  Server, and the  Server responds such request. HTTP is a one-way communication protocol. The purpose herein is to solve  "How do you do to create a request at the client, and how do you to respond the request of the client", and this is reason so that the  HTTP shines.
WebSocket is not a   request-response protocol, where only  Client can send a request to the  Server. When a connection with WebSocket protocol is established, client & server can give data to each other, until  the lower layer connection such as TCP is closed. The  WebSocket is basically similar to the  TCP Socket concept. The difference is that the  WebSocket is created to use for  Web applications.

STOMP

STOMP (Streaming Text Oriented Messaging Protocol): a communication protocol, a branch of the  WebSocket. When the  client and the  server contact each other by this protocol, they will send each other text message data. The relationship between  STOMP and  WebSocket is also similar to the one between HTTP and  TCP.
In addition, the  STOMP also provides a specific way to solve the following functions:  


FunctionDescription
ConnectProvide ways so that the client and the server can connect to each other.
SubscribeProvide ways so that the  client  subscribes receipt of messages of a topic.
UnsubscribeProvide ways so that the  client unsubscribes the receipt of messages of a topic.
SendHow the client sends messages to the server.
MessageHow to send a message sent from the server to the client.
Transaction managementTransaction management during data transfer (BEGIN, COMMIT, ROLLBACK,...)


ليست هناك تعليقات:

إرسال تعليق

ADF: Programmatic View Object Using Ref Cursor.

ADF: Programmatic View Object Using Ref Cursor. Posted by:  Manish Pandey   April 25, 2013   in  ADF   Leave a comment   3758 Views Sometime...