2

I am working on a project which is kinda old. It is a spring 4 rest server application which uses Jax RS @Path annotations over spring's @RestController annotation. And the default servlet is also Jax Rs's Application. Its weird.. and I have no clue why the original devs did that. And it doesn't use Spring boot.

I'm trying to write a reverse proxy into this server which will let me use newer microservices projects to expose new endpoints and thus new functionality.

Now, I have a few options.

  1. I can implement something like Zuul proxy.. which from online examples.. uses Spring Boot annotations like @EnableZuulProxy .. I'm not sure if my non-spring boot rest API would understand that annotation.

  2. I can use Spring's RestTemplate to define generic HTTP services and do header and server/service management myself.

In this case, I want to use a properties file to inject values of Servers and the services they host as a Map<String, List<String>> serviceMapping; Using @Value and @ConfigurationProperties annotations. The second one I believe comes with Spring Boot.

I guess my questions are..

  1. can I use auto-configuration that springboot provides in a Spring container app that is built without boot.
  2. And what are your thoughts on Zuul vs rest template approaches?
  3. What could be the reason to use JAX-RS annotations over spring's?
M. Deinum
  • 115,695
  • 22
  • 220
  • 224
jay
  • 48
  • 7

0 Answers0