> builder = invoke();
- this.publisher = decorate(Multi.createFrom().publisher(builder.buildRs()));
+ this.publisher = decorate(MultiUtils.publisher(builder.buildRs()));
}
private void produceAPublisherBuilderOfPayloads() {
PublisherBuilder
builder = invoke();
- this.publisher = decorate(Multi.createFrom().publisher(builder.map(Message::of).buildRs()));
+ this.publisher = decorate(MultiUtils.publisher(builder.map(Message::of).buildRs()));
}
private void produceAPublisherOfMessages() {
- this.publisher = Multi.createFrom().publisher(invoke());
+ this.publisher = MultiUtils.publisher(invoke());
}
private
void produceAPublisherOfPayloads() {
Publisher
pub = invoke();
- this.publisher = decorate(Multi.createFrom().publisher(pub).map(Message::of));
+ this.publisher = decorate(MultiUtils.publisher(pub).map(Message::of));
}
private void produceIndividualMessages() {
diff --git a/smallrye-reactive-messaging-provider/src/main/java/io/smallrye/reactive/messaging/providers/StreamTransformerMediator.java b/smallrye-reactive-messaging-provider/src/main/java/io/smallrye/reactive/messaging/providers/StreamTransformerMediator.java
index 711af2238e..ae68cace95 100644
--- a/smallrye-reactive-messaging-provider/src/main/java/io/smallrye/reactive/messaging/providers/StreamTransformerMediator.java
+++ b/smallrye-reactive-messaging-provider/src/main/java/io/smallrye/reactive/messaging/providers/StreamTransformerMediator.java
@@ -97,7 +97,7 @@ private void processMethodConsumingAPublisherBuilderOfMessages() {
PublisherBuilder extends Message>> argument = ReactiveStreams.fromPublisher(multi);
PublisherBuilder> result = invoke(argument);
Objects.requireNonNull(result, msg.methodReturnedNull(configuration.methodAsString()));
- return Multi.createFrom().publisher(result.buildRs());
+ return MultiUtils.publisher(result.buildRs());
};
}
@@ -107,13 +107,16 @@ private void processMethodConsumingAPublisherOfMessages() {
Publisher extends Message>> argument = convertToDesiredPublisherType(multi);
Publisher> result = invoke(argument);
Objects.requireNonNull(result, msg.methodReturnedNull(configuration.methodAsString()));
- return Multi.createFrom().publisher(result);
+ return MultiUtils.publisher(result);
};
}
@SuppressWarnings("unchecked")
private Publisher convertToDesiredPublisherType(Multi multi) {
Class> parameterType = configuration.getParameterTypes()[0];
+ if (parameterType.equals(Multi.class)) {
+ return multi;
+ }
Optional extends ReactiveTypeConverter>> converter = Registry.lookup(parameterType);
Publisher argument = multi;
if (converter.isPresent()) {
@@ -129,7 +132,7 @@ private void processMethodConsumingAPublisherBuilderOfPayload() {
PublisherBuilder> argument = ReactiveStreams.fromPublisher(multi);
PublisherBuilder