From f1976e46036e75bbb2e51cea7f01e7e3ef67ba07 Mon Sep 17 00:00:00 2001 From: Francisco Javier Tirado Sarti Date: Tue, 24 Sep 2024 16:43:54 +0200 Subject: [PATCH] [Fix #281] Fixing converter priority --- .../http/runtime/converters/JacksonBasedConverter.java | 5 +++++ .../http/runtime/converters/StringConverter.java | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/runtime/src/main/java/io/quarkus/reactivemessaging/http/runtime/converters/JacksonBasedConverter.java b/runtime/src/main/java/io/quarkus/reactivemessaging/http/runtime/converters/JacksonBasedConverter.java index 5e82554..3c0b3fa 100644 --- a/runtime/src/main/java/io/quarkus/reactivemessaging/http/runtime/converters/JacksonBasedConverter.java +++ b/runtime/src/main/java/io/quarkus/reactivemessaging/http/runtime/converters/JacksonBasedConverter.java @@ -26,5 +26,10 @@ public Message convert(Message in, Type target) { } } + @Override + public int getPriority() { + return CONVERTER_DEFAULT_PRIORITY - 1; + } + protected abstract Message doConvert(Message in, Type target); } diff --git a/runtime/src/main/java/io/quarkus/reactivemessaging/http/runtime/converters/StringConverter.java b/runtime/src/main/java/io/quarkus/reactivemessaging/http/runtime/converters/StringConverter.java index ae1f726..3f139ea 100644 --- a/runtime/src/main/java/io/quarkus/reactivemessaging/http/runtime/converters/StringConverter.java +++ b/runtime/src/main/java/io/quarkus/reactivemessaging/http/runtime/converters/StringConverter.java @@ -14,7 +14,6 @@ */ @ApplicationScoped public class StringConverter implements MessageConverter { - @Override public boolean canConvert(Message in, Type target) { return in.getPayload() instanceof Buffer && target == String.class; @@ -24,4 +23,9 @@ public boolean canConvert(Message in, Type target) { public Message convert(Message in, Type target) { return in.withPayload(((Buffer) in.getPayload()).toString()); } + + @Override + public int getPriority() { + return CONVERTER_DEFAULT_PRIORITY - 1; + } }