0.99.6 release notes
28th May 2020
🌟 New features
New
CircuitBreakerRule
andCircuitBreakerRuleWithContent
API let you define a complex circuit breaking policy conveniently. #2726CircuitBreakerRule myRule = CircuitBreakerRule.of( // A failure if an Exception is raised. CircuitBreakerRule.onException(), // Neither a success nor a failure because // the request has not been handled by the server. CircuitBreakerRule.builder() .onUnprocessed() .thenIgnore(), // A failure if the response is 5xx. CircuitBreakerRule.onServerErrorStatus(), // A success if the response is 2xx. CircuitBreakerRule.builder() .onStatusClass(HttpStatusClass.SUCCESS) .thenSuccess(), // Neither a success nor a failure. Do not take this response into account. CircuitBreakerRule.builder().thenIgnore());
You can now easily bind an MDC property to a
RequestContext
and log it using a logging framework. #2634 #2724 #2729MDC.put("transactionId", "1234"); WebClient client = ...; try (SafeCloseable ignored = Clients.withContextCustomizer(ctx -> { RequestScopedMdc.copy(ctx, "transactionId"); }) { assert MDC.get("transactionId").equals("1234"); client.execute(...); }
You can now install a custom hook to
RequestContextStorage
in runtime, usually at startup time. #2723RequestContextStorage.hook(delegate -> new RequestContextStorageWrapper(delegate) { @Nullable @Override public <T extends RequestContext> T push(RequestContext toPush) { // Usually, you can just use RequestScopedMdc for this purpose. MDC.put("foo", toPush.attr(FOO)); return super.push(toPush); } @Override public void pop(RequestContext current, @Nullable RequestContext toRestore) { MDC.remove("foo"); super.pop(current, toRestore); } ... }
You can now set method parameter descriptions for annotated services in
DocService
using Javadoc. #2697You can now easily sanitize headers and content using
RegexBasedSanitizer
. #1810 #2721
📈 Improvements
- You can now easily call
ownAttr()
fromRequestContext
. #2727- You don't have to check if the context is
ClientRequestContext
or not anymore. root()
andownAttrs()
are pulled up as well.
- You don't have to check if the context is
🛠️ Bug fixes
- You can now use Armeria 0.99.6 with Micrometer 1.3.9. (It is recommended to use Micrometer 1.5.1, though.) #2742
- You can now retry even when the current
EndpointGroup
is empty. #2736 - You can send a request by setting the authority and scheme header to
RequestHeaders
. #2730 #2734 - You no longer see
<zero-length response>
inDocService
anymore. #2732 - A
NullPointerException
is not raised anymore due to the dependency order when Armeria is shaded. #2731 #2735
☢️ Breaking changes
RetryStrategy
andRetryStrategyWithContent
are gone in favor ofRetryRule
andRetryRuleWithContent
. #2726CircuitBreakerStrategy
andCircuitBreakerStrategyWithContent
are gone in favor ofCircuitBreakerRule
andCircuitBreakerRuleWithContent
. #2726EndpointSelector.select()
(and thus EndpointGroup.select() as well) now returnsnull
instead of throwing anEmptyEndpointGroupException
. #2736- The method signature of
ClientFactory.acquireEventLoop()
andEventLoopScheduler.acquire()
have been changed. #2736
⛓ Dependencies
- Brave 5.11.2 → 5.12.3
- grpc-kotlin-stub 0.1.1 → 0.1.2
- io.dropwizard.metrics 4.1.7 → 4.1.9
- Jetty 9.4.28.v20200408 → 9.4.29.v20200521
- reactor-grpc 1.0.0 → 1.0.1
- Retrofit 2.8.1 → 2.9.0
- Rxjava3 3.0.3 → 3.0.4
- Shaded dependencies
- Caffeine 2.8.2 → 2.8.4
- Example dependencies
- Kotlin 1.3.71 → 1.3.72
- Kotlin Coroutines 1.3.6 → 1.3.7