0

Trying to send a post request in quarkus simple without any configs, as referred in the official docs here

And referred in this StackOverflow answer here as well.

I just did added the extension quarkus-rest-client-reactive-jsonb and this straight forward snippet:

package org.offerService.infrastructure;

import java.util.concurrent.CompletionStage;

import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Response;

import org.LeadsService.contract.offerDto.OfferDto;
import org.LeadsService.contract.reponseType.responseTypeOffer.ResponseCreateOffer;
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;

@Path("/offer")
@RegisterRestClient(configKey = "offer-api")
public class OffersRestClientService {

    @POST
    @Path("/createOffer")
    CompletionStage<ResponseCreateOffer> createOffer(OfferDto offer);
}

and in the application properties I'm refering to that endpoint:

quarkus.rest-client.offer-api.url=localhost:8082

Now the error message I get a warning when I try to Inject this service anywhere:

The corresponding org.OfferService.infrastructure.OfferRestClientService interface does not have the @RegisterRestClient annotation. The field offerRestClient will not be injected as a CDI bean.microprofile-restclient

And in the service itself the same file I shared I get an error in here exactly createOffer(OfferDto offer); ( pre-last line ) says

The method createOffer(OfferDto) from the type OfferRestClientService is not visible Java(67108965)

so the problem here is that it doesn't recognize @RegisterRestClient though it's imported properly

MansouriAla
  • 177
  • 1
  • 1
  • 11

0 Answers0