[MGNLRESTCL-151] Refactor rest-client-module Created: 16/Mar/20 Updated: 19/May/20 Resolved: 14/Apr/20 |
|
| Status: | Closed |
| Project: | REST Client |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 2.0.1 |
| Type: | Improvement | Priority: | Neutral |
| Reporter: | Jorge Franco | Assignee: | Quach Hao Thien |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | 0d | ||
| Time Spent: | 11d 1h 10m | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Template: |
|
||||||||
| Acceptance criteria: |
Empty
|
||||||||
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
||||||||
| Release notes required: |
Yes
|
||||||||
| Documentation update required: |
Yes
|
||||||||
| Date of First Response: | |||||||||
| Epic Link: | Declarative REST clients | ||||||||
| Sprint: | 6.2.1 Ramp-up 21, 6.2.1 Ramp-up 22 | ||||||||
| Story Points: | 8 | ||||||||
| Description |
|
2020-03-13 16:27:56,865 TRACE class org.ehcache.core.Ehcache-REST_CLIENT_CACHE : Initializing
info.magnolia.rest.client.app.ui.debug.DebugFilter is already registered. 2nd registration is being ignored. After discussed with dai.ha, this log entry could be ignored since it causes no harm.
Criteria:
|
| Comments |
| Comment by Roman Kovařík [ 16/Apr/20 ] |
|
Up until recently, my old rest client worked without a problem. Now I get:
2020-04-16 11:00:00,067 ERROR info.magnolia.module.scheduler.CommandJob : Cannot execute command {0}-{1}.
java.lang.NullPointerException: null
at info.magnolia.rest.client.DefaultRestClient.buildWebTarget(DefaultRestClient.java:297) ~[magnolia-rest-client-2.0.1-SNAPSHOT.jar:?]
at info.magnolia.rest.client.DefaultRestClient.buildWebTarget(DefaultRestClient.java:283) ~[magnolia-rest-client-2.0.1-SNAPSHOT.jar:?]
at info.magnolia.rest.client.DefaultRestClient.proxy(DefaultRestClient.java:195) ~[magnolia-rest-client-2.0.1-SNAPSHOT.jar:?]
at info.magnolia.resteasy.client.RestEasyClient.getClientService(RestEasyClient.java:65) ~[magnolia-rest-client-2.0.1-SNAPSHOT.jar:?]
The deprecated ctor doesn't set the client field. Could you also update the title to reflect the refactoring? |
| Comment by Quach Hao Thien [ 16/Apr/20 ] |
|
since 2.0, I suggest to create RestClient via DefaultRestClientFactory |
| Comment by Roman Kovařík [ 16/Apr/20 ] |
|
I can see Anyway it's not so much about my code, I could workaround it, but we shouldn't break the compatibility |
| Comment by Quach Hao Thien [ 16/Apr/20 ] |
|
To have a WebTarget, the jaxrs Client requires to open a connection and the deprecated ctor allows to pass that webtarget to create RestClient, which should be avoid, since we don't want the Client opens connection before the RestClient is actual created. I understand that we should keep the compatibility, but in this case to control the webTarget keep the RestClient more messy. Do you think this is the perfect time to remove those deprecated ctors and methods? |