public class ClientServiceDiscovery extends Object implements ServiceDiscovery, org.springframework.context.ApplicationListener<ServiceEvent>
Provide client service list query, update and other processing
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
BEAN_NAME
The bean name of
ClientServiceDiscovery |
| 构造器和说明 |
|---|
ClientServiceDiscovery(MessagePipeConfiguration configuration,
ServerConfiguration serverConfiguration) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
handingExpired()
Dealing with client expiration
|
protected void |
handingHeartBeat(List<ClientInformation> clients)
Update the last heartbeat time of the client
When receiving the heartbeat, if the client is not registered, perform registration
|
protected void |
handingRegister(List<ClientInformation> clients)
List of registered clients
|
protected void |
handingResetInstances(List<ClientInformation> clients)
Handling reset client instance collection
|
ClientInformation |
lookup(String pipeNamePattern)
Obtain a healthy load-balanced client instance
|
void |
onApplicationEvent(ServiceEvent event)
Listen for
ServiceEvent
Process client services according to different event types |
protected Set<String> |
regexGetClientIds(String pipeName)
Use regular expressions to obtain ClientIds
|
protected void |
registerService(ClientInformation information)
Register a service
Cache client information in a local collection
The relationship between the binding pipeline and the client
|
public static final String BEAN_NAME
ClientServiceDiscoverypublic ClientServiceDiscovery(MessagePipeConfiguration configuration, ServerConfiguration serverConfiguration)
public ClientInformation lookup(String pipeNamePattern) throws MessagePipeException
lookup 在接口中 ServiceDiscoverypipeNamePattern - The MessagePipe pattern nameMessagePipeException - The exception instanceprotected Set<String> regexGetClientIds(String pipeName)
pipeName - The MessagePipe specific nameMessagePipe binding clientIdspublic void onApplicationEvent(ServiceEvent event)
ServiceEvent
Process client services according to different event types
onApplicationEvent 在接口中 org.springframework.context.ApplicationListener<ServiceEvent>event - The ServiceEvent instanceprotected void registerService(ClientInformation information)
Cache client information in a local collection The relationship between the binding pipeline and the client
information - The client informationprotected void handingResetInstances(List<ClientInformation> clients)
clients - Client list after resetServiceEventType.RESET_INSTANCEprotected void handingExpired()
protected void handingRegister(List<ClientInformation> clients)
clients - List of clients waiting to be registeredprotected void handingHeartBeat(List<ClientInformation> clients)
When receiving the heartbeat, if the client is not registered, perform registration
clients - List of clients waiting to update their heartbeat timeCopyright © 2020. All rights reserved.