Springcloud (5): Eureka metadata with Eureka Server's Rest Endpoint

Source: Internet
Author: User

First, Eureka Meta-data

1.1. Introduction

There are two types of metadata for Eureka: standard metadata and custom metadata.

Standard metadata refers to information such as host name, IP address, port number, status page, and health check, which are published in the service registry for calls between services.

Custom metadata can use the Eureka.instance.metadata-map configuration, which can be accessed in remote clients, but generally does not alter the behavior of the client unless the client knows what the metadata means.

1.2. Operation

Such as:

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/99/E5/wKioL1lOIHCwzg_4AAB7YADs0-c936.png "title=" 1498292269 (1). png "alt=" Wkiol1loihcwzg_4aab7yads0-c936.png "/>

1.2.1, modifying the application.properties configuration of the Demo2

server.port=9093spring.application.name=demo2eureka.client.service-url.defaultzone=http://liuy1:9090/eureka/ eureka.instance.prefer-ip-address=true# display specified Ipeureka.instance.instance-id: ${spring.cloud.client.ipaddress}:${ Server.port} #元数据eureka. Instance.metadata-map.my-metada=zhangsan

1.2.2, Access in Demo1

/** * Query DEMO2 Service INFORMATION * @description query information of the DEMO2 service * @return * @throws Exception * @author I love big gold * @version 1.0 * @date: 2017 6  24th PM 4:25:15 */@GetMapping ("/demo-instance") public list<serviceinstance> Showinfo () throws Exception {return Discoveryclient.getinstances ("Demo2"); }

1.2.3, testing

Visit: http://localhost:9092/demo-instance

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/99/E7/wKiom1lOO8bQ7_EGAACozQeknpc216.png "title=" [3%} qx70elx@7}{' Uim67zu.png "alt=" Wkiom1loo8bq7_egaacozqeknpc216.png "/>

Second, Eureka server's Rest endpoint

Non-JVM microservices can use the rest endpoint to manipulate Eu-reka for registration and discovery. For details, please refer to http://projects.spring.io/spring-cloud/

This article is from "I Love Big gold" blog, please be sure to keep this source http://1754966750.blog.51cto.com/7455444/1941647

Springcloud (5): Eureka metadata with Eureka Server's Rest Endpoint

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.