Skip to content

Error in case service interface has generic paramater #641

@eutkin

Description

@eutkin

project for reproducing: sample.

I have two node. First node (Consumer) provide service InvalidConsumer.
Second node (Provider) provide service Producer.

@Service
public interface InvalidConsumer {

    @ServiceMethod
    Mono<String> consume(List<String> input);
}

@Service
public interface Producer {

  @ServiceMethod
  Flux<String> invalidProduce();
}

When Producer call Consumer, i get this exception.

Next. Let see constructor of MethodInfo:

MethodInfo methodInfo =
                              new MethodInfo(
                                  Reflect.serviceName(serviceInterface),
                                  Reflect.methodName(method),
                                  Reflect.parameterizedReturnType(method),
                                  Reflect.isReturnTypeServiceMessage(method),
                                  Reflect.communicationMode(method),
                                  method.getParameterCount(),
                                  Reflect.requestType(method),
                                  Reflect.isRequestTypeServiceMessage(method),
                                  Reflect.isAuth(method));

We get requestType as Reflect.requestType(method).

If we have in method argument of type List<String> (not FLux<String>) we get request type is String. But the service will be transferred to List<String> instead of String and we will receive a serialization exception

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions