Spring app service registration across different container

Jacky Lam 200 Reputation points


I have 15 spring applications. As each spring app container can only have 10 instance, I need to create 2 spring app container in Azure. However, I find the application in 2nd container cannot find those in first container.

May I know if the Euraka service shared between containers or each container will have its own Euraka service? For later one, how can I config to make all of my application register to the same Euraka server?



Azure Spring Apps
Azure Spring Apps
An Azure platform as a service for running Spring Boot applications at cloud scale. Previously known as Azure Spring Cloud.
104 questions
0 comments No comments
{count} votes

Accepted answer
  1. brtrach-MSFT 14,226 Reputation points Microsoft Employee

    @Jacky Lam In Azure Spring Apps, each container has its own instance of the Service Registry (Eureka Server). Therefore, the applications running in different containers cannot discover each other by default.

    To make all of your applications register to the same Service Registry, you can configure them to use a shared Eureka Server instance. Here are the steps to do so:

    1. Create a new Azure Spring Apps instance with the Enterprise tier.
    2. Deploy a new instance of the Service Registry (Eureka Server) to the new Azure Spring Apps instance.
    3. Configure your applications to use the new Eureka Server instance by setting the eureka.client.service-url.defaultZone property to the URL of the Eureka Server instance. For example:
    <span class=" active-doc-0" data-doc-items="0">eureka.client.service-url.defaultZone=https[1](#doc-pos=0)</span>://<eureka-server-name>.<azure-region>.azuremicroservices.io/eureka/

    Replace <eureka-server-name> with the name of the Eureka Server instance and <azure-region> with the Azure region where the instance is deployed.

    You can set this property in the application.properties or application.yml file of your Spring Boot application.

    After you complete these steps, all of your applications will register to the same Eureka Server instance and be able to discover each other across different containers.

0 additional answers

Sort by: Most helpful