use of feign.Request.Options in project feign by OpenFeign.
the class SynchronousMethodHandler method invoke.
@Override
public Object invoke(Object[] argv) throws Throwable {
RequestTemplate template = buildTemplateFromArgs.create(argv);
Options options = findOptions(argv);
Retryer retryer = this.retryer.clone();
while (true) {
try {
return executeAndDecode(template, options);
} catch (RetryableException e) {
try {
retryer.continueOrPropagate(e);
} catch (RetryableException th) {
Throwable cause = th.getCause();
if (propagationPolicy == UNWRAP && cause != null) {
throw cause;
} else {
throw th;
}
}
if (logLevel != Logger.Level.NONE) {
logger.logRetry(metadata.configKey(), logLevel);
}
continue;
}
}
}
use of feign.Request.Options in project feign by OpenFeign.
the class ReactiveFeignIntegrationTest method testReactorTargetFull.
@Test
public void testReactorTargetFull() throws Exception {
this.webServer.enqueue(new MockResponse().setBody("1.0"));
this.webServer.enqueue(new MockResponse().setBody("{ \"username\": \"test\" }"));
TestReactorService service = ReactorFeign.builder().encoder(new JacksonEncoder()).decoder(new JacksonDecoder()).logger(new ConsoleLogger()).decode404().options(new Options()).logLevel(Level.FULL).target(TestReactorService.class, this.getServerUrl());
assertThat(service).isNotNull();
StepVerifier.create(service.version()).expectNext("1.0").expectComplete().verify();
assertThat(webServer.takeRequest().getPath()).isEqualToIgnoringCase("/version");
/* test encoding and decoding */
StepVerifier.create(service.user("test")).assertNext(user -> assertThat(user).hasFieldOrPropertyWithValue("username", "test")).expectComplete().verify();
assertThat(webServer.takeRequest().getPath()).isEqualToIgnoringCase("/users/test");
}
Aggregations