How to check if a Client is connected to my spring boot backed server or disconnected? - spring-boot

I am new to Spring boot. I am currently working on a Poker app (android) and decided to use Spring Boot as Backend. Using HTTP requests and responses to handle client, I am facing difficulty when it comes to client's connectivity. cause I need to know if a player is connected to game table or not. Can I use WebSockets to resolve this or I need to use TCP support?
Any advice is be appreciated and please help me here providing some useful resources.
Thanks

Related

spring boot multiple servers login issue

We have a spring boot project used to use only one server. We recently switching to use two servers for the same spring boot application. Now the users are frequently asked to login. We found out if a user logged in one server and a new request is sent to another server, this would happen.
I am sure this is very common issue with solutions. Could anyone point me to the right direction how to fix the login issue? Thanks a lot!

Spring RSocket Kubernetes server - Side car to convert http requests from client?

Small question regarding how to convert http requests into RSocket please.
The server setup is a very straightforward RSocket server.
The server is dockerized and deployed in Kubernetes.
Now there are many clients, I do not have control over them. The clients would like to talk to this RSocket server. The JSON payload the clients sends are all compatible with the RSocket server. However, all clients are just using http clients, not RSocket.
May I ask what is the easiest solution to convert the https requests send from the clients please?
What I tried: Built a layer in between, using Spring Cloud Gateway to take as input a http request, and forward it using a RSocket client.
The drawback of this solution is that there is now another app in the picture. Instead of maintaining one business RSocket application, there is a need to implement and maintain another web server entirely.
May I ask if there is some kind of sidecar pattern using maybe ngnix, istio, Kubernetes services, that can perform the same, without having to full blown develop another web app please?
May I ask what is the easiest solution to convert the https requests send from the clients please?
Thank you
May I ask if there is some kind of sidecar pattern using maybe ngnix, istio, Kubernetes services, that can perform the same, without having to full blown develop another web app please?
No, The concept maybe called broker gateway but not sidecar pattern. You should implements a broker gateway to conevert the protocol, such as HTTP(Rest), GraphQL, gRPC. You can refer a sample project alibaba-rsocket-broker.

How to configure spring boot for receive traffic only NGINX

For secure reasons I need my backend receive traffic only through Nginx. Is it possible to block outside all traffic to spring boot. And only NGINX can accept and send requests to Spring Boot application. Thanks for advice. Sorry for asking question in wrong so without code.

consume spring boot rest services from private network

I want to consume the spring boot rest services deployed behind a firewall. Need a solution for the above scenario. Thank you.
To access a Rest API behind a firewall you need to open the default HTTP ports in that firewall(80 for HTTP and 443).
That has nothing to do with the technology that you are using to implement the Rest API.
Please provide more details about your question if this is not enough answer for you...

Web API Notification using Spring Boot

I am looking at creating Notification in Google Chrome, using Spring Boot. The notification is nowadays common on all sites.
The Spring Boot Admin module does create the same notification if the client application monitored goes down or comes up.
Can some help me with the same, very less support on the internet for the same? Even if the concept is clarified I can share a sample code for Spring boot and make it public via git. Else if a working sample help will also be appreciated.
We have JS way of creating the same, using new Notification('Title',) and window.webkitNotifications.createNotification.
I have solved it using 2 parts.
Server-Sent-Events (sse) emitters with Spring boot and Notification Web APIs
Adding the sample code here
Hope it helps someone looking for a similar solution.

Resources