Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Spring RestClient as TransportClientFactory and make it the default implementation #4257

Closed
ZIRAKrezovic opened this issue Feb 19, 2024 · 6 comments · Fixed by #4281
Milestone

Comments

@ZIRAKrezovic
Copy link
Contributor

ZIRAKrezovic commented Feb 19, 2024

Describe the solution you'd like

Complements: #4255

Consider implementing RestClientTransportClientFactory to complement existing RestTemplateClientFactory (not exactly based on RestTemplate), which is kind of deprecated.

https://docs.spring.io/spring-framework/reference/integration/rest-clients.html#rest-restclient

See note: https://docs.spring.io/spring-framework/reference/integration/rest-clients.html#rest-resttemplate

@OlgaMaciaszek
Copy link
Collaborator

Makes sense.

@injae-kim
Copy link

FYI, PR: #4281

@OlgaMaciaszek OlgaMaciaszek moved this to In Progress in 2023.0.2 May 6, 2024
@OlgaMaciaszek OlgaMaciaszek added this to the 4.1.2 milestone May 6, 2024
@OlgaMaciaszek
Copy link
Collaborator

Thanks, @injae-kim. @heowc is working on this now.

@ryanjbaxter ryanjbaxter removed this from 2023.0.2 Jun 10, 2024
@spencergibb spencergibb moved this to Todo in 2023.0.3 Jun 17, 2024
@OlgaMaciaszek OlgaMaciaszek moved this from Todo to In Progress in 2023.0.3 Jun 26, 2024
@OlgaMaciaszek OlgaMaciaszek modified the milestones: 4.1.2, 4.1.3 Jun 26, 2024
@spencergibb spencergibb removed this from 2023.0.3 Oct 28, 2024
@spencergibb spencergibb modified the milestones: 4.1.3, 4.1.4 Oct 28, 2024
@OlgaMaciaszek OlgaMaciaszek removed this from the 4.1.4 milestone Nov 4, 2024
@OlgaMaciaszek OlgaMaciaszek removed this from 2023.0.4 Nov 4, 2024
@OlgaMaciaszek OlgaMaciaszek moved this to In Progress in 2024.0.0-RC1 Nov 4, 2024
@OlgaMaciaszek OlgaMaciaszek added this to the 4.2.0-RC1 milestone Nov 4, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in 2024.0.0-RC1 Nov 4, 2024
@OlgaMaciaszek
Copy link
Collaborator

Update: there's still some work related to adjusting config in TransportClientFactories, that I'm working on here that has to be modified in order for RestClient to be used as the default.

@heowc
Copy link
Contributor

heowc commented Nov 7, 2024

Update: there's still some work related to adjusting config in TransportClientFactories, that I'm working on here that has to be modified in order for RestClient to be used as the default.

Thanks for looking into it. I think it can be modified with RestClient.Builder, but I'm curious as to why it needs to be added. 🤔

@OlgaMaciaszek
Copy link
Collaborator

We need to integrate with Netflix's native way of handling connections through TransportClientFactories, otherwise there'll be a TransportException.

com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server
	at com.netflix.discovery.shared.transport.decorator.RetryableEurekaHttpClient.execute(RetryableEurekaHttpClient.java:112) ~[eureka-client-2.0.4.jar:2.0.4]
	at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.register(EurekaHttpClientDecorator.java:56) ~[eureka-client-2.0.4.jar:2.0.4]
	at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$1.execute(EurekaHttpClientDecorator.java:59) ~[eureka-client-2.0.4.jar:2.0.4]
	at com.netflix.discovery.shared.transport.decorator.SessionedEurekaHttpClient.execute(SessionedEurekaHttpClient.java:76) ~[eureka-client-2.0.4.jar:2.0.4]
	at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.register(EurekaHttpClientDecorator.java:56) ~[eureka-client-2.0.4.jar:2.0.4]
	at com.netflix.discovery.DiscoveryClient.register(DiscoveryClient.java:828) ~[eureka-client-2.0.4.jar:2.0.4]
	at com.netflix.discovery.InstanceInfoReplicator.run(InstanceInfoReplicator.java:125) ~[eureka-client-2.0.4.jar:2.0.4]
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572) ~[na:na]
	at java.base/java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:317) ~[na:na]
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java) ~[na:na]

@OlgaMaciaszek OlgaMaciaszek changed the title Support Spring RestClient as TransportClientFactory Support Spring RestClient as TransportClientFactory and make it the default implementation Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants