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

Spring as dependency injection framework #46

Open
chrsoo opened this issue Feb 1, 2016 · 2 comments
Open

Spring as dependency injection framework #46

chrsoo opened this issue Feb 1, 2016 · 2 comments

Comments

@chrsoo
Copy link

chrsoo commented Feb 1, 2016

Hi,

I am trying to figure out how to best use vertx-jersey with Spring as the dependency injection framework. Any ideas how to accomplish this without too much of a hassle?

Perhaps the easiest way is to leverage the existing HK2 spring-bridge and use HK2?

Note that I only want to use Spring for basic dependency injection to port an existing JAXRS application. The idea is not to use Spring MVC etc.

@adrianluisgonzalez
Copy link
Member

Yeah, I think the spring-bridge is the way to go. You can take a look at the guice-bridge for an example.

https://github.com/englishtown/vertx-jersey/blob/develop/vertx-jersey/src/main/java/com/englishtown/vertx/guice/GuiceJerseyServer.java#L39

If you want to submit a PR with Spring bridge support that would be great.

@jogardi
Copy link

jogardi commented Jun 12, 2017

I was able to integrate with spring dependency injection. First I copied and pasted the AutowiredInjectResolver class from jersey's GitHub into my project. Finally I just added an instance of this Binder to the service locator:

I think that adding these classes to vertx-jersey would make integrating with spring a lot easier but it is probably not worth introducing a dependency on Spring. However, we could also put these classes in a separate library or just add an example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants