Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [microprofile-dev] Microprofile rest client subresource provider registration

Hi Andy,

Thanks for your reply.

 

There is already an issue at https://github.com/eclipse/microprofile-rest-client/issues/290. I also created new issue for introduction of sub resources into the MP rest client spec at https://github.com/eclipse/microprofile-rest-client/issues/328.

 

My use case is a remote service with very wide API interface where every subresource use different MessageBodyReader/MessageBodyReader. When all MessageBodyReaders/MessageBodyWriters are registered on the main resource (for the whole client) I have to implement complex isReadable/isWriteable and/or the list of MessageBodyReaders/MessageBodyWriters is long.

 

Thanks!

 

Milan

From: Andy McCright <j.andrew.mccright@xxxxxxxxx>
Sent: pondělí 30. srpna 2021 21:14
To: microprofile developer discussions <microprofile-dev@xxxxxxxxxxx>
Cc: Konzal Milan (PS/EDI1-Bj) <Milan.Konzal@xxxxxxxxxxxx>
Subject: Re: [microprofile-dev] Microprofile rest client subresource provider registration

 

Hi Milan,

 

The MicroProfile Rest Client 2.0 spec currently does not mention sub-resources at all, though I believe most of the major implementations (CXF, Jersey, and RESTEasy) support them in one fashion or another.  So, the short answer is that no, there is no (portable) support for registering providers for a sub-resource client interface.

 

In order for the ABCProvider to be registered, you would either need to register it on the Foo interface - or you would need to programmatically register it using the RestClientBuilder API.  

 

This does sound like an intriguing feature though.  Please feel free to open an issue for this at: https://github.com/eclipse/microprofile-rest-client/issues or even a pull request.

 

Thanks!

 

Andy

 

 

On Wed, Aug 25, 2021 at 11:10 PM Konzal Milan (PS/EDI1-Bj) via microprofile-dev <microprofile-dev@xxxxxxxxxxx> wrote:

Hi,

is it possible to register providers on the subresouce client proxy? Does it take precedence over provider registration on the parent level?

 

I would like to register different Providers on different sub-resources. Is it expected? I can't find any information in the MP specification.

 

My resource proxy

 

@Path("/foo")

@RegisterProvider(XYZWriter.class)

@RegisterProvider(XYZReader.class)

public interface Foo {

    @POST

    @Consumes("xyz")

    @Produces("xyz")

    FooResponse get(FooContent content);

 

    @Path("/bar")

    Bar getBar();

}

 

My sub resource proxy

 

@RegisterProvider(ABCReader.class)

public interface Bar {

     @POST

     @Produces("abc")

     BarResponse get();

}

 

My call foo.getBar().get();

 

Thanks.

 

Milan

_______________________________________________
microprofile-dev mailing list
microprofile-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/microprofile-dev


Back to the top