diff --git a/http-client/src/main/java/io/micronaut/http/client/netty/DefaultHttpClient.java b/http-client/src/main/java/io/micronaut/http/client/netty/DefaultHttpClient.java index 502ce523839..f09f399e286 100644 --- a/http-client/src/main/java/io/micronaut/http/client/netty/DefaultHttpClient.java +++ b/http-client/src/main/java/io/micronaut/http/client/netty/DefaultHttpClient.java @@ -2399,7 +2399,7 @@ protected void removeHandler(ChannelHandlerContext ctx) { } @Override - protected void buildResponse(Promise> promise, StreamedHttpResponse msg) { + protected void buildResponse(Promise> promise, StreamedHttpResponse msg) { promise.trySuccess(new NettyStreamedHttpResponse<>(msg, conversionService)); } diff --git a/http-client/src/main/java/io/micronaut/http/client/netty/DefaultNettyHttpClientRegistry.java b/http-client/src/main/java/io/micronaut/http/client/netty/DefaultNettyHttpClientRegistry.java index a047a679962..07acfebeee2 100644 --- a/http-client/src/main/java/io/micronaut/http/client/netty/DefaultNettyHttpClientRegistry.java +++ b/http-client/src/main/java/io/micronaut/http/client/netty/DefaultNettyHttpClientRegistry.java @@ -421,7 +421,6 @@ private DefaultHttpClient buildClient( resolveSocketChannelFactory(configuration, beanContext), clientCustomizer, invocationInstrumenterFactories, - clientId clientId, conversionService ); diff --git a/http-client/src/main/java/io/micronaut/http/client/netty/MutableHttpRequestWrapper.java b/http-client/src/main/java/io/micronaut/http/client/netty/MutableHttpRequestWrapper.java index 8e1343be39f..a02019d0212 100644 --- a/http-client/src/main/java/io/micronaut/http/client/netty/MutableHttpRequestWrapper.java +++ b/http-client/src/main/java/io/micronaut/http/client/netty/MutableHttpRequestWrapper.java @@ -39,19 +39,19 @@ */ @Internal final class MutableHttpRequestWrapper extends HttpRequestWrapper implements MutableHttpRequest { - private final ConversionService conversionService; + private ConversionService conversionService; @Nullable private B body; @Nullable private URI uri; - MutableHttpRequestWrapper(ConversionService conversionService, HttpRequest delegate) { + MutableHttpRequestWrapper(ConversionService conversionService, HttpRequest delegate) { super(delegate); this.conversionService = conversionService; } - static MutableHttpRequest wrapIfNecessary(ConversionService conversionService, HttpRequest request) { + static MutableHttpRequest wrapIfNecessary(ConversionService conversionService, HttpRequest request) { if (request instanceof MutableHttpRequest) { return (MutableHttpRequest) request; } else { @@ -128,4 +128,9 @@ public MutableHttpRequest body(T body) { this.body = (B) body; return (MutableHttpRequest) this; } + + @Override + public void setConversionService(ConversionService conversionService) { + this.conversionService = conversionService; + } }