To connect two Spring Boot applications over the internet, you can use one of the following methods:
1. REST API
This is the simplest way to connect two applications. You can create a REST API in one application and expose it to the internet. The other application can then consume the REST API to communicate with the first application.
To do this, you will need to:
Create a Spring Boot application that exposes a REST API.
Deploy the application to a server that is accessible over the internet.
In the other Spring Boot application, create a REST client to consume the REST API of the first application.
Use the REST client to make requests to the REST API of the first application.