edit-icon download-icon

Publish services

Last Updated: Mar 12, 2018

After the producer and consumer are developed and tested, package and then publish the service. The following describes how to publish a service using the current demo.

Note: The EDAS RPC service uses Port 12200. Therefore, ensure that the port on the ECS instance where the service runs can be accessed by the service consumer.

Publish a service

Two applications (detail.war and itemcenter.war) need to be published. Therefore, prepare at least two ECS instances with EDAS Agent installed. For details, see Install EDAS Agent. Assume that the names of the two ECS instances are edas-detail and edas-itemcenter. The procedure of deploying applications is as follows:

  1. Log on to the EDAS console and choose Applications in the left-side navigation pane. Click Create Application in the upper-right corner of the page.

  2. In the Create Application dialog box, select the region and enter the application name and click Next.

  3. In the Application Type dialog box, select the corresponding ECS instance from the instance list and click Create Application.

    Here, we create two applications: app-detail and app-itemcenter, which are deployed on edas-detail and edas-itemcenter respectively.

  4. After applications are created, choose Applications and select app-detail and app-itemcenter to go to the details page. In the upper-right corner of the page, click Deploy.

  5. In the dialog box that appears, select the WAR package that is compressed in Service packaging. Then, upload and deploy the package.

  6. After deployment, click Start in the upper-right corner of the page.

    After the application is started on the ECS instance, the status of the corresponding ECS instance is displayed in the Instance Information tab of the application basic information page. If the real-time status of the ECS instance is Normal and the task status is Successful, then the application is successfully started on the ECS instance.

View published services

  1. After the two applications are started, on the Applications page, select the app-temcenter application to go to the application details page.

  2. Choose Services > Published Service in the left-side navigation pane. The published service defined in the Spring configuration file is: com.alibaba.edas.carshop.itemcenter.ItemService

    If you go to the app-detail application page and choose Services > Published Service, the consumed service defined in the Spring configuration file is: com.alibaba.edas.carshop.itemcenter.ItemService

  3. Log on to edas-detail ECS instance and go to the logs directory of AliTomcat (assume that the path is /home/admin/taobao-tomcat/logs/) as the admin user. You can view the following log information in the output of catalina.out: Item[id: 1, nam: Mercedes Benz], which is the Item object returned by the service provider (app-itemcenter).

Thank you! We've received your feedback.