In micronaut there are declarative clients:
@Client("http://localhost:5000")
public interface ServiceB {
@Get("/ping")
HttpResponse ping(HttpRequest httpRequest);
}
In my controller
class I want to redirect the incoming request to ServiceB
@Controller("/api")
public class ServiceA {
@Inject
private ServiceB serviceB;
@Get("/ping)
HttpResponse pingOtherService(HttpRequest httpRequest){
return serviceB.ping(httpRequest)
}
}
However it seems that ServiceB
will never get the request because of the information encoded in the request. How can I forward the request from ServiceA
to ServiceB
?