Class RestTemplateTransportClientFactory

  • All Implemented Interfaces:
    com.netflix.discovery.shared.transport.TransportClientFactory

    public class RestTemplateTransportClientFactory
    extends Object
    implements com.netflix.discovery.shared.transport.TransportClientFactory
    Provides the custom RestTemplate required by the RestTemplateEurekaHttpClient. Relies on Jackson for serialization and deserialization.
    Author:
    Daniel Lavoie
    • Method Detail

      • newClient

        public com.netflix.discovery.shared.transport.EurekaHttpClient newClient​(com.netflix.discovery.shared.resolver.EurekaEndpoint serviceUrl)
        Specified by:
        newClient in interface com.netflix.discovery.shared.transport.TransportClientFactory
      • mappingJacksonHttpMessageConverter

        public org.springframework.http.converter.json.MappingJackson2HttpMessageConverter mappingJacksonHttpMessageConverter()
        Provides the serialization configurations required by the Eureka Server. JSON content exchanged with eureka requires a root node matching the entity being serialized or deserialized. Achived with SerializationFeature.WRAP_ROOT_VALUE and DeserializationFeature.UNWRAP_ROOT_VALUE. PropertyNamingStrategy.SnakeCaseStrategy is applied to the underlying ObjectMapper.
        Returns:
        a MappingJackson2HttpMessageConverter object
      • createJsonSerializerModifier

        public static com.fasterxml.jackson.databind.ser.BeanSerializerModifier createJsonSerializerModifier()
      • shutdown

        public void shutdown()
        Specified by:
        shutdown in interface com.netflix.discovery.shared.transport.TransportClientFactory