@ Override public Publisher < List < ServiceInstance > > getInstances ( String serviceId ) { if ( serviceId == null ) { serviceId = getRoute53ClientDiscoveryConfiguration ( ) . getAwsServiceId ( ) ; // we can default to the config file } ListInstancesRequest instancesRequest = new ListInstancesRequest ( ) . withServiceId ( serviceId ) ; Future < ListInstancesResult > instanceResult = getDiscoveryClient ( ) . listInstancesAsync ( instancesRequest ) ; Flowable < ListInstancesResult > observableInstanceResult = Flowable . fromFuture ( instanceResult ) ; return observableInstanceResult . flatMap ( this :: convertInstancesResulttoServiceInstances ) ; }
Gets a list of instances registered with Route53 given a service ID .