You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by "John D. Ament" <jo...@apache.org> on 2017/12/03 17:46:29 UTC

Implementing MicroProfile's Rest Client here at CXF?

Hey all

Andy (McCright) and I (as well as some others who don't contribute to CXF)
have been working on another project, specifically around standardizing how
Type Safe rest clients can be built within MIcroProfile.  There's two main
aspects to this, as well as some changes potentially required for a
presently CXF specific provider.

- Programmatic builder API for creating the clients from a JAX-RS annotated
interface
- CDI injection support for interfaces

I have most of an implementation for this working, and would like to start
to bring it into the CXF codebase.  My thought is to bring most of it
directly into the client module, and update some of the core logic there to
work with MicroProfile's APIs.  There are some functional differences
though.  One of the things we felt was important was mapping Response codes
into Exceptions, something that CXF already had support for.  The behavior
is a little different in that we will evaluate multiple mappers as well as
handle any response code.

You can read more about the API and specification at
https://github.com/eclipse/microprofile-rest-client
You can also see the base impl I've started on at
https://github.com/johnament/cxfmprestclient


John

Re: Implementing MicroProfile's Rest Client here at CXF?

Posted by Sergey Beryozkin <sb...@gmail.com>.
Sounds like that should be a separate module which links the current 
impl with the profile, profile and JAX-RS may evolve independently.

Wiring the API lib into 3.2.x can be sensitive, not sure having a mix of 
various API flavors will work well...

Sergey
On 04/12/17 01:16, John D. Ament wrote:
> The problem I see has to do with how the ResponseExceptionMapper works.
> JAX-RS doesn't define this provider, however the MP Rest Client does, and
> CXF also has this type of provider.  The handling of this provider is in
> two places, ClientProxyImpl and ClientProviderFactory.  We'd have to create
> sublcasses of these to handle the MicroProfile specific cases.
> 
> FWIW, the API JAR is only 12kb.  I'm not sure it could be optional, since I
> was planning to make the CXF interface extend the MP interface
> (ResponseExceptionMapper).
> 
> John
> 
> On Sun, Dec 3, 2017 at 5:40 PM Andriy Redko <dr...@gmail.com> wrote:
> 
>> Hey John,
>>
>> That would be an interesting feature, useful even beyond just Microprofile
>> actually (imho) :)
>> Should we have a dedicated module for it instead of using the client one?
>> We would
>> have the dependency to Microprofile REST Client SPI/API there, may be it
>> is better
>> not to introduce it into the existing client module (even as an optional)?
>>
>> Best Regards,
>>      Andriy Redko
>>
>> JDA> Hey all
>>
>> JDA> Andy (McCright) and I (as well as some others who don't contribute to
>> CXF)
>> JDA> have been working on another project, specifically around
>> standardizing how
>> JDA> Type Safe rest clients can be built within MIcroProfile.  There's two
>> main
>> JDA> aspects to this, as well as some changes potentially required for a
>> JDA> presently CXF specific provider.
>>
>> JDA> - Programmatic builder API for creating the clients from a JAX-RS
>> annotated
>> JDA> interface
>> JDA> - CDI injection support for interfaces
>>
>> JDA> I have most of an implementation for this working, and would like to
>> start
>> JDA> to bring it into the CXF codebase.  My thought is to bring most of it
>> JDA> directly into the client module, and update some of the core logic
>> there to
>> JDA> work with MicroProfile's APIs.  There are some functional differences
>> JDA> though.  One of the things we felt was important was mapping Response
>> codes
>> JDA> into Exceptions, something that CXF already had support for.  The
>> behavior
>> JDA> is a little different in that we will evaluate multiple mappers as
>> well as
>> JDA> handle any response code.
>>
>> JDA> You can read more about the API and specification at
>> JDA> https://github.com/eclipse/microprofile-rest-client
>> JDA> You can also see the base impl I've started on at
>> JDA> https://github.com/johnament/cxfmprestclient
>>
>>
>> JDA> John
>>
>>
> 


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Re: Implementing MicroProfile's Rest Client here at CXF?

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Le 4 déc. 2017 02:16, "John D. Ament" <jo...@apache.org> a écrit :

The problem I see has to do with how the ResponseExceptionMapper works.
JAX-RS doesn't define this provider, however the MP Rest Client does, and
CXF also has this type of provider.  The handling of this provider is in
two places, ClientProxyImpl and ClientProviderFactory.  We'd have to create
sublcasses of these to handle the MicroProfile specific cases.

FWIW, the API JAR is only 12kb.  I'm not sure it could be optional, since I
was planning to make the CXF interface extend the MP interface
(ResponseExceptionMapper).


Hmm, with config api it is more and even if size is small, it can conflict.
What is impacting also is the cdi extension which can conflict as well -
cxf client being widely used. All can be optional and I think it is not bad
as solution but if enforced, another module is better IMHO.



John

On Sun, Dec 3, 2017 at 5:40 PM Andriy Redko <dr...@gmail.com> wrote:

> Hey John,
>
> That would be an interesting feature, useful even beyond just Microprofile
> actually (imho) :)
> Should we have a dedicated module for it instead of using the client one?
> We would
> have the dependency to Microprofile REST Client SPI/API there, may be it
> is better
> not to introduce it into the existing client module (even as an optional)?
>
> Best Regards,
>     Andriy Redko
>
> JDA> Hey all
>
> JDA> Andy (McCright) and I (as well as some others who don't contribute to
> CXF)
> JDA> have been working on another project, specifically around
> standardizing how
> JDA> Type Safe rest clients can be built within MIcroProfile.  There's two
> main
> JDA> aspects to this, as well as some changes potentially required for a
> JDA> presently CXF specific provider.
>
> JDA> - Programmatic builder API for creating the clients from a JAX-RS
> annotated
> JDA> interface
> JDA> - CDI injection support for interfaces
>
> JDA> I have most of an implementation for this working, and would like to
> start
> JDA> to bring it into the CXF codebase.  My thought is to bring most of it
> JDA> directly into the client module, and update some of the core logic
> there to
> JDA> work with MicroProfile's APIs.  There are some functional differences
> JDA> though.  One of the things we felt was important was mapping Response
> codes
> JDA> into Exceptions, something that CXF already had support for.  The
> behavior
> JDA> is a little different in that we will evaluate multiple mappers as
> well as
> JDA> handle any response code.
>
> JDA> You can read more about the API and specification at
> JDA> https://github.com/eclipse/microprofile-rest-client
> JDA> You can also see the base impl I've started on at
> JDA> https://github.com/johnament/cxfmprestclient
>
>
> JDA> John
>
>

Re: Implementing MicroProfile's Rest Client here at CXF?

Posted by "John D. Ament" <jo...@apache.org>.
The problem I see has to do with how the ResponseExceptionMapper works.
JAX-RS doesn't define this provider, however the MP Rest Client does, and
CXF also has this type of provider.  The handling of this provider is in
two places, ClientProxyImpl and ClientProviderFactory.  We'd have to create
sublcasses of these to handle the MicroProfile specific cases.

FWIW, the API JAR is only 12kb.  I'm not sure it could be optional, since I
was planning to make the CXF interface extend the MP interface
(ResponseExceptionMapper).

John

On Sun, Dec 3, 2017 at 5:40 PM Andriy Redko <dr...@gmail.com> wrote:

> Hey John,
>
> That would be an interesting feature, useful even beyond just Microprofile
> actually (imho) :)
> Should we have a dedicated module for it instead of using the client one?
> We would
> have the dependency to Microprofile REST Client SPI/API there, may be it
> is better
> not to introduce it into the existing client module (even as an optional)?
>
> Best Regards,
>     Andriy Redko
>
> JDA> Hey all
>
> JDA> Andy (McCright) and I (as well as some others who don't contribute to
> CXF)
> JDA> have been working on another project, specifically around
> standardizing how
> JDA> Type Safe rest clients can be built within MIcroProfile.  There's two
> main
> JDA> aspects to this, as well as some changes potentially required for a
> JDA> presently CXF specific provider.
>
> JDA> - Programmatic builder API for creating the clients from a JAX-RS
> annotated
> JDA> interface
> JDA> - CDI injection support for interfaces
>
> JDA> I have most of an implementation for this working, and would like to
> start
> JDA> to bring it into the CXF codebase.  My thought is to bring most of it
> JDA> directly into the client module, and update some of the core logic
> there to
> JDA> work with MicroProfile's APIs.  There are some functional differences
> JDA> though.  One of the things we felt was important was mapping Response
> codes
> JDA> into Exceptions, something that CXF already had support for.  The
> behavior
> JDA> is a little different in that we will evaluate multiple mappers as
> well as
> JDA> handle any response code.
>
> JDA> You can read more about the API and specification at
> JDA> https://github.com/eclipse/microprofile-rest-client
> JDA> You can also see the base impl I've started on at
> JDA> https://github.com/johnament/cxfmprestclient
>
>
> JDA> John
>
>

Re: Implementing MicroProfile's Rest Client here at CXF?

Posted by Andriy Redko <dr...@gmail.com>.
Hey John,

That would be an interesting feature, useful even beyond just Microprofile actually (imho) :)
Should we have a dedicated module for it instead of using the client one? We would
have the dependency to Microprofile REST Client SPI/API there, may be it is better
not to introduce it into the existing client module (even as an optional)?

Best Regards,
    Andriy Redko

JDA> Hey all

JDA> Andy (McCright) and I (as well as some others who don't contribute to CXF)
JDA> have been working on another project, specifically around standardizing how
JDA> Type Safe rest clients can be built within MIcroProfile.  There's two main
JDA> aspects to this, as well as some changes potentially required for a
JDA> presently CXF specific provider.

JDA> - Programmatic builder API for creating the clients from a JAX-RS annotated
JDA> interface
JDA> - CDI injection support for interfaces

JDA> I have most of an implementation for this working, and would like to start
JDA> to bring it into the CXF codebase.  My thought is to bring most of it
JDA> directly into the client module, and update some of the core logic there to
JDA> work with MicroProfile's APIs.  There are some functional differences
JDA> though.  One of the things we felt was important was mapping Response codes
JDA> into Exceptions, something that CXF already had support for.  The behavior
JDA> is a little different in that we will evaluate multiple mappers as well as
JDA> handle any response code.

JDA> You can read more about the API and specification at
JDA> https://github.com/eclipse/microprofile-rest-client
JDA> You can also see the base impl I've started on at
JDA> https://github.com/johnament/cxfmprestclient


JDA> John


Re: Implementing MicroProfile's Rest Client here at CXF?

Posted by Romain Manni-Bucau <rm...@gmail.com>.
+1 from me (even if not in CXF community directly)

small request if possible: can mp-config be optional? it is very
located and should be easy to use system properties - or a SPI - as a
fallback if not available right?

Romain Manni-Bucau
@rmannibucau |  Blog | Old Blog | Github | LinkedIn


2017-12-03 18:46 GMT+01:00 John D. Ament <jo...@apache.org>:
> Hey all
>
> Andy (McCright) and I (as well as some others who don't contribute to CXF)
> have been working on another project, specifically around standardizing how
> Type Safe rest clients can be built within MIcroProfile.  There's two main
> aspects to this, as well as some changes potentially required for a
> presently CXF specific provider.
>
> - Programmatic builder API for creating the clients from a JAX-RS annotated
> interface
> - CDI injection support for interfaces
>
> I have most of an implementation for this working, and would like to start
> to bring it into the CXF codebase.  My thought is to bring most of it
> directly into the client module, and update some of the core logic there to
> work with MicroProfile's APIs.  There are some functional differences
> though.  One of the things we felt was important was mapping Response codes
> into Exceptions, something that CXF already had support for.  The behavior
> is a little different in that we will evaluate multiple mappers as well as
> handle any response code.
>
> You can read more about the API and specification at
> https://github.com/eclipse/microprofile-rest-client
> You can also see the base impl I've started on at
> https://github.com/johnament/cxfmprestclient
>
>
> John