Improve the Transactional Interceptor to handle other Publisher types

Converters should also be searched for Publisher instances, or you won't be able to re-create the Publisher instance (Flux, Mono, Multi) after the async handling.
This commit is contained in:
Clement Escoffier
2020-02-20 09:02:41 +01:00
parent 2bd5d8e092
commit acca039c8a

View File

@@ -125,7 +125,7 @@ public abstract class TransactionalInterceptorBase implements Serializable {
if (!throwing && ret != null) {
ReactiveTypeConverter<Object> converter = null;
if (ret instanceof CompletionStage == false
&& ret instanceof Publisher == false) {
&& (ret instanceof Publisher == false || ic.getMethod().getReturnType() != Publisher.class)) {
@SuppressWarnings({ "rawtypes", "unchecked" })
Optional<ReactiveTypeConverter<Object>> lookup = Registry.lookup((Class) ret.getClass());
if (lookup.isPresent()) {