@Provides @Singleton Feign feign(Logger logger, Logger.Level logLevel) { return Feign.builder() .logger(logger) .logLevel(logLevel) .encoder(new GsonEncoder()) .decoder(new GsonDecoder(Arrays.asList( new KeystoneAccessAdapter("rax:dns"), new JobAdapter(), new DomainListAdapter(), new RecordListAdapter())) ) .build(); } }
public <T> T target(Target<T> target) { return build().newInstance(target); }
/** Configures components needed for hystrix integration. */ Feign build(final FallbackFactory<?> nullableFallbackFactory) { super.invocationHandlerFactory(new InvocationHandlerFactory() { @Override public InvocationHandler create(Target target, Map<Method, MethodHandler> dispatch) { return new HystrixInvocationHandler(target, dispatch, setterFactory, nullableFallbackFactory); } }); super.contract(new HystrixDelegatingContract(contract)); return super.build(); }
return super.build();
@Override public Feign build() { super.invocationHandlerFactory( (target, dispatch) -> new DecoratorInvocationHandler(target, dispatch, invocationDecorator)); return super.build(); }