Unable to start gRPC server on Quarkus - Unable to find beans exposing the `BindableService`

Viewed 754

I had a working gRPC service in quarkus 1.5.1.Final with the consolidated *.proto and built classes with an implement service working.

Then I broke out the service component to it's own project putting a dependency on the generated classes component (above module) but when I try and start the service application with ./mvnw quarkus:dev I cannot get the gRPC server to start:

WARN  [io.qua.grp.dep.GrpcServerProcessor] (build-7) Unable to find beans exposing the `BindableService` interface - not starting the gRPC server

Here is the service:

package org.ikeda.address.grpc;

import io.smallrye.mutiny.Uni;
import org.ikeda.address.grpc.service.AddressManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.inject.Inject;
import javax.inject.Singleton;

@Singleton
public class AddressGrpcService extends MutinyAddressServiceGrpc.AddressServiceImplBase {
    private Logger log = LoggerFactory.getLogger(AddressGrpcService.class);

    @Inject
    private AddressManager addressManager;

    @Override
    public Uni<AddressResponse> getAddress(PageRequest request) {
        log.debug("Page size: {}, Page number: {}", request.getPageSize(), request.getPageNumber());

        return this.addressManager
                .getPaginatedAddresses(request.getPageNumber(), request.getPageSize())
                .map(addresses -> AddressResponse.newBuilder().addAllAddresses(addresses).build());
    }
}

When I colocated the generated classes with the implementations the server starts no problem.

What doesn't make sense is that io.qua.grp.dep.GrpcServerProcessor doesn't exist in the repo though I was able to locate the source code for io.quarkus.grpc.deployment.GrpcServerProcessor

1 Answers

You need to include your additional module in the Jandex index so that the services can be found.

Just add an empty META-INF/beans.xml in the additional module's src/main/resources and it should be OK.

Related