Skip to content

Commit

Permalink
[Fix quarkiverse#281] Fixing converter priority
Browse files Browse the repository at this point in the history
  • Loading branch information
fjtirado committed Sep 24, 2024
1 parent 57e2c2b commit f1976e4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -24,4 +23,9 @@ public boolean canConvert(Message<?> in, Type target) {
public Message<String> convert(Message<?> in, Type target) {
return in.withPayload(((Buffer) in.getPayload()).toString());
}

@Override
public int getPriority() {
return CONVERTER_DEFAULT_PRIORITY - 1;
}
}

0 comments on commit f1976e4

Please sign in to comment.