Class AnnotatedServiceRegistrationBean


public class AnnotatedServiceRegistrationBean
extends AbstractServiceRegistrationBean<Object,​AnnotatedServiceRegistrationBean,​AnnotatedExampleRequest,​ExampleHeaders>
A bean with information for registering an annotated service object. It enables Micrometer metric collection of the service automatically.

 > @Bean
 > public AnnotatedServiceRegistrationBean okService() {
 >     return new AnnotatedServiceRegistrationBean()
 >             .setServiceName("myAnnotatedService")
 >             .setPathPrefix("/my_service")
 >             .setService(new MyAnnotatedService())
 >             .setDecorators(LoggingService.newDecorator())
 >             .setExceptionHandlers(new MyExceptionHandler())
 >             .setRequestConverters(new MyRequestConverter())
 >             .setResponseConverters(new MyResponseConverter())
 >             .addExampleRequests(AnnotatedExampleRequest.of("myMethod", "{\"foo\":\"bar\"}"))
 >             .addExampleHeaders(ExampleHeaders.of("my-header", "headerVal"));
 > }