Rest Client: URI vs. URL

50 views
Skip to first unread message

Harald Wellmann

unread,
Feb 18, 2018, 6:43:23 AM2/18/18
to Eclipse MicroProfile
Playing around with the Rest Client (using WildFly 12.0.0.Beta1), I came across

    RestClientBuilder baseUrl(URL url);

which is a bit of a surprise, given that JAX-RS normally uses URI instead of URL, so I would have expected

    RestClientBuilder baseUri(URI uri);

instead, or at least as an alternative.

My main concern is not about the subtle logical differences between URIs and URLs, but about spurious conversions and unchecked vs. checked exceptions (e.g. MalformedURLException).

What was the motivation for using URL in this API signature?

Regards,
Harald

Werner Keil

unread,
Feb 18, 2018, 2:25:44 PM2/18/18
to Eclipse MicroProfile
Good point. Hopefully these kind of inconsistencies can be fixed when the project merges with EE4J ;-)

Regards,
Werner

Craig McClanahan

unread,
Feb 18, 2018, 6:53:17 PM2/18/18
to microp...@googlegroups.com
IIRC, there is also a pretty substantial performance penalty for using URL, as it actually tries to resolve this to a real destination, while URI is just concerned with the syntax.

Craig McClanahan

--
You received this message because you are subscribed to the Google Groups "Eclipse MicroProfile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to microprofile+unsubscribe@googlegroups.com.
To post to this group, send email to microp...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/microprofile/523300a9-3891-4588-b805-fdd5f1bd2c09%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Emily Jiang

unread,
Feb 19, 2018, 9:41:33 AM2/19/18
to Eclipse MicroProfile
Adding baseURI() sounds good. I think it is best to open an issue on the repo https://github.com/eclipse/microprofile-rest-client/.

Emily


On Sunday, February 18, 2018 at 11:53:17 PM UTC, Craig McClanahan wrote:
IIRC, there is also a pretty substantial performance penalty for using URL, as it actually tries to resolve this to a real destination, while URI is just concerned with the syntax.

Craig McClanahan
On Sun, Feb 18, 2018 at 3:43 AM, Harald Wellmann <hwellm...@gmail.com> wrote:
Playing around with the Rest Client (using WildFly 12.0.0.Beta1), I came across

    RestClientBuilder baseUrl(URL url);

which is a bit of a surprise, given that JAX-RS normally uses URI instead of URL, so I would have expected

    RestClientBuilder baseUri(URI uri);

instead, or at least as an alternative.

My main concern is not about the subtle logical differences between URIs and URLs, but about spurious conversions and unchecked vs. checked exceptions (e.g. MalformedURLException).

What was the motivation for using URL in this API signature?

Regards,
Harald

--
You received this message because you are subscribed to the Google Groups "Eclipse MicroProfile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to microprofile...@googlegroups.com.

Harald Wellmann

unread,
Feb 20, 2018, 12:33:26 PM2/20/18
to microp...@googlegroups.com
For the record, I've created an issue here:
https://github.com/eclipse/microprofile-rest-client/issues/76

Regards,
Harald

To unsubscribe from this group and stop receiving emails from it, send an email to microprofile+unsubscribe@googlegroups.com.

To post to this group, send email to microp...@googlegroups.com.

Andy McCright

unread,
Feb 21, 2018, 2:19:48 PM2/21/18
to Eclipse MicroProfile
Thanks Harald - we'll try to get that put in to the 1.1 release.
Reply all
Reply to author
Forward
0 new messages