-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 jersey 2 for eureka #846
Comments
You'd have to take that up with the Ribbon devs. Ribbon is a Netflix project.
I'd be very surprised if it worked (it's a major upgrade of a core component), but if you have something that works, that's awesome. |
Do we document that ribbon and eureka use jersey and therefor could conflict? |
I guess so. Note that it's only a problem with eureka server as far as I know (which has never been very embeddable). |
There are additional problems when using ribbon clients. The exception is
The cause is that
which belongs to JAX-RS 1.x and is not available in JAX-RS 2. |
Yeah, that's right, sorry. You can't use ribbon with JAX-RS 2.0. |
I'm stuck with this problem agan. I have to migrate a monolithic app using Jersey 2.0 to a microservice. I guess having them migrate their code to use a Jersey 2.0 client is the the best bet to solve this problem. |
Short answer: the code allows an implementation now as there is an abstraction. Netflix isn't keen on building it themselves, but would be open to PR's. We may do some work on this, but it would likely be based on |
For those watching, Netflix has started a jersey 2 client. https://github.com/Netflix/eureka/tree/master/eureka-client-jersey2 Not sure how much more work they are going to do. |
Update in this thread, looks like Eureka Client 1.6 will be compatible: Netflix/eureka#821 |
@spencergibb Can this be included in 1.3.0.M1 milestone as this issue resolution is quite crucial to use Jersey 2 with Spring cloud? |
@aksain, probably not. I don't know what is involved to get this to work and haven't had time to look at it. |
@spencergibb Alright. For now, I have created one more starter on top of Spring cloud netflix one. Sharing the changes that i had to do, as this could be handy -
|
@aksain Pull Requests are welcome. |
Having Jersey 1.x on the classpath of a Spring Boot app running JAX-RS on Jetty prevents the application from starting with the Spring Boot Maven plugin. See ticket over here spring-projects/spring-boot#13290. We use Ribbon and not Eureka and at the moment, we're just excluding Jersey-Client 1.x. |
Same problem from me. Is there any roadmap, news about a migration path ? |
The migration path is to not use Jersey 1.x, I guess (https://cloud.spring.io/spring-cloud-netflix/multi/multi__service_discovery_eureka_clients.html#_eurekaclient_without_jersey). And I guess to not use Ribbon. |
I had wrongly guess that was not supported as this ticket is open. On my side i have also exclude the jsr311 (jax-rs 1) dependency as my point was to avoid conflict with jax-rs 2. Eureka client and core explicitly depend on it in addition to jersey. For reference my final gradle configuration is :
We have now to test in order to assure compatibility between Eureka and jaxrs 2. Thanks a lots for your help |
Using Jersey for the REST layer in a project, I've got a dependency conflict when using Spring Cloud as follow:
The Spring Boot Jersey dependency
org.springframework.boot:spring-boot-starter-jersey:jar:1.3.2.RELEASE
is used.The error is
and it comes from the fact that both
javax.ws.rs:javax.ws.rs-api:jar:2.0.1:compile
javax.ws.rs:jsr311-api:jar:1.1.1:runtime
are present in the classpath.
spring-cloud-starter-zuul
includesjsr311-api.jar
from itsribbon-httpclient
dependencyI solved it by excluding
jersey-client
like thisIt works when testing Zuul manually but I'm not sure it would under all conditions.
It's heavy handed but I figure I already have a much newer jersey client
org.glassfish.jersey.core:jersey-client:jar:2.22.1:compile
included with Spring Boot Jersey.Why would ribbon use older Jersey client dependency? Is there any reason it wouldn't work with the newest
org.glassfish.jersey.core:jersey-client:jar:2.22.1
??The text was updated successfully, but these errors were encountered: