我们在Spring Boot的Actuator中讲到的最重要的一个概念就是Endpoint了。在其他API或 Web Services服务中也经常会遇到Endpoint这个概念。

那么,Endpoint的到底代表着什么意思呢?

先看看英文对Endpoint的解释:

What is a Server-Side Endpoint?

Web services expose one or more endpoints to which messages can be sent. A web service endpoint is an entity, processor, or resource that can be referenced and to which web services messages can be addressed. Endpoint references convey the information needed to address a web service endpoint. Clients need to know this information before they can access a service.

Typically, web services package endpoint descriptions and use a WSDL file to share these descriptions with clients. Clients use the web service endpoint description to generate code that can send SOAP messages to and receive SOAP messages from the web service endpoint.

翻译成中文大概意思是:

Web 服务公开一个或多个可以向其发送消息的端点(Endpoint)。 Web服务端点是可以引用的实体、处理器或资源,Web服务消息可以寻址到该实体、处理器或资源。端点引用传达寻址Web服务端点所需的信息。客户在访问服务之前需要知道这些信息。

通常,Web服务打包端点描述并使用WSDL文件与客户端共享这些描述。客户端使用Web服务端点描述生成可以向Web服务端点发送SOAP消息和从Web服务端点接收SOAP消息的代码。

Endpoint这个词以前经常被用来描述进程间通信。例如,

  • 在客户端与服务器之间的通讯,客户端是一个Endpoint和服务器是另外一个Endpoint。
  • 根据不同的情况下,一个Endpoint可能指的地址,如一个TCP通信的(主机:端口)对,也可能是指与这个地址相对应的一个软件实体。例如,如果大家使用“ www.example.com:80 ”来描述一个Endpoint。这些Endpoint可能是指实际的端口上的主机名称(即地址)
  • 也可能是指与地址相关的的网页服务器(即在这个地址之上运行的软件地址) 。
  • 邮寄信件时,将信件投递到邮箱,那么邮箱就是一个Enpoint。
  • 寄送快递时,快递员上门取件,快递员就是一个Enpoint。
  • web service服务,一个服务地址:http://www.url.com/service1是一个Enpoint。

service和endpoint:

service是用户可以从服务器获取什么样的服务,endpoint则是服务位于哪个访问点。一个service可以有多个endpoint。



Spring Boot Actuator中Endpoint什么意思插图

关注公众号:程序新视界,一个让你软实力、硬技术同步提升的平台

除非注明,否则均为程序新视界原创文章,转载必须以链接形式标明本文链接

本文链接:https://www.choupangxia.com/2021/07/08/spring-boot-actuator-endpoint-2/