eureka analogue:
int index = 0;
Application application = this.eurekaClient.getApplication(this.environment.getProperty("spring.application.name"));
List<InstanceInfo> instanceInfoList = application.getInstances();
for (InstanceInfo instanceInfo : instanceInfoList) {
if(instanceInfo.getInstanceId().equals(this.eurekaClient.getApplicationInfoManager().getInfo().getInstanceId())) {
return index;
}
}
as you can see we get a list of service instances and then compare them to one registered in eureka (this.eurekaClient.getApplicationInfoManager().getInfo().getInstanceId())