rsocket-rpc-java icon indicating copy to clipboard operation
rsocket-rpc-java copied to clipboard

Single-argument constructor overload

Open bsideup opened this issue 5 years ago • 0 comments

Hi!

If I have a service named MyService , the current implementation generates a constructor (MyServiceServer) with 3 parameters:

  1. MyService
  2. Optional<MeterRegistry>
  3. Optional<Tracer>

The problem is that if you exclude opentracing & micrometer from the classpath, new MyServiceServer(myService, Optional.empty(), Optional.empty()) fails at runtime because it refers to the missing classes. There is a workaround for it:

new MyServiceServer(myService, (Optional) Optional.empty(), (Optional) Optional.empty());

But it would be nice if the generator will create an additional constructor, without optionals and @Inject at all:

new MyServiceServer(myService);

and delegate to this(service, Optional.empty(), Optional.empty());

Not everyone is using opentracing and/or micrometer and it will help to not have them on classpath

bsideup avatar Jan 05 '19 10:01 bsideup