protected void performRegistration ( String discoveryService , RegistrationConfiguration registration , ServiceInstance instance , Publisher < HttpStatus > registrationObservable ) { registrationObservable . subscribe ( new Subscriber < HttpStatus > ( ) { @ Override public void onSubscribe ( Subscription s ) { s . request ( 1 ) ; } @ Override public void onNext ( HttpStatus httpStatus ) { if ( LOG . isInfoEnabled ( ) ) { LOG . info ( "Registered service [{}] with {}" , instance . getId ( ) , discoveryService ) ; } } @ Override public void onError ( Throwable t ) { if ( LOG . isErrorEnabled ( ) ) { String message = getErrorMessage ( discoveryService , t ) ; LOG . error ( message , t ) ; } if ( registration . isFailFast ( ) && instance instanceof EmbeddedServerInstance ) { ( ( EmbeddedServerInstance ) instance ) . getEmbeddedServer ( ) . stop ( ) ; } } @ Override public void onComplete ( ) { } } ) ; }
Register a new service instance in the discovery service .