Grails 2.4 application as Spring cloud microservice - spring-boot

We want to integrate legacy grails 2.4 and java7 application to our microservices infrastructure. We use spring cloud netflix, Camden.SR4 release and java8 in microservices setup. We use zuul, eureka, config service.
I know that with grails 3 this task is relatively easy, but currently we cant do that.
The biggest question is how can I register grails 2.4 app in Eureka.
Also, we don't want to use sidecar at the moment.

Spring Cloud requires Spring Boot. There's nothing keeping you from using the netflix eureka libraries directly.
https://github.com/Netflix/eureka/blob/master/eureka-examples/src/main/java/com/netflix/eureka/ExampleEurekaClient.java

Related

Spring Boot Confusion (using spring cloud dependency in spring boot framework)

I am new to spring framework. I have a confusion regarding spring boot and spring cloud.
I used https://start.spring.io/ to initialize a spring boot application. I think I am using the spring boot framework. However, I would like to use some spring cloud dependencies such as spring-cloud-stream-binder-kafka.
Question 1: If I added this dependency above to my spring boot application, I am wondering if I still can go with the spring boot framework, or I have to change to spring cloud framework.
Question 2: I am wondering if there is any difference when deploying the spring boot or spring cloud application. Or, they just have the different frameworks, and we could deploy them in the same way.
Thank you so much!
You can use together Spring Boot and Spring Cloud packages.
Spring Boot is just a preconfigured Spring Framework with some extra functionalities. It also uses library versions compatibile with each other. Spring Cloud is also the part of the Spring ecosystem, contains libraries that mostly used in cloud applications.
In the background, these packages will pull all necessary Spring (and other) libraries into your project, as transitive dependencies.
So you can use the generated pom/gradle, and add other dependencies. In this case Spring boot will be your core and cloud add extras.

Any chance Spring Zuul updated for Spring boot 2.4.x?

TLDR
Any chance of getting spring cloud netflix zuul 1 running on spring boot 2.4?
Context:
We have an app that uses spring zuul 1 and runs on spring boot 2.3.x
zuul simply "doesn't work" on spring boot 2.4.x, i.e. wasn't updated to run on spring 2.4.x.
I would have expected to see 'deprecation' or 'end of life' warnings. Maybe I missed them.
Why we care
Spring boot 2.4.x adds nice functionality for building docker images; this functionaltiy doesn't work on spring 2.3.x .
e.g..
The generated image can be published to a Docker registry by enabling a publish option and configuring authentication for the registry using docker.publishRegistry properties.
https://docs.spring.io/spring-boot/docs/current/gradle-plugin/reference/htmlsingle/
Question
Any chance that zuul 1 maintainers will updat zuul 1 to run on spring 2.4? If so, when?
Any documentation on "migrating from zuul1 to spring cloud gateway"
We ran into a few 'gotchas' with zuul--so know that switching from zuul to spring cloud gateway might require non-trivial work.
Thanks!

Can a micro service (in Spring-boot 1.x) hit a REST endpoint of another micro service(in spring-boot 2.x) when using Feign?

We have few micro services on spring-boot 1.x and we are trying to upgrade them to spring-boot 2.x.
As part of this upgrade, we converted few micro services into spring-boot 2.x and some of them are still on spring-boot 1.x. Now my question is, if a micro service is using Feign to invoke/call a REST endpoint of another micro service, should we have both the micro services on same spring-boot version or can they still communicate with being on two different versions?

How to deploy Spring Cloud Gateway 2.1 on Jboss or Tomcat?

I want to a deploy Spring Cloud Gateway but it is built on Spring Framework 5, Project Reactor.
Can I create a WAR file and deploy it on a traditional application server such as Jboss or Tomcat.
The Spring documentation in this page says it is possible.
Spring WebFlux is supported on Tomcat, Jetty, Servlet 3.1+ containers
Note:
this is Spring Cloud Gateway project link
https://spring.io/projects/spring-cloud-gateway
I don't think this is possible, as Spring Cloud Gateway is itself a Spring Boot WebFlux application and this use case is only supported with embedded servers, as mentioned in the Spring Boot reference documentation.

Spring Cloud Netflix - how to access Eureka/Ribbon from traditional web app?

Everything I found on the internet about Spring Cloud Netflix is about running microservices from Boot applications using #EnableEurekaClients and so on.
Now I'm trying to connect my logging microservice within a traditional war application (springmvc, jaxws etc) - piece of legacy which can not be converted to Boot or modified in any way (by technical task).
I've created a new maven module "log-server-client" that knows nothing about upper web layer and intended to be used as a simple dependency in any maven project.
How should I configure access to Spring Cloud Netflix for this simple dependency? At least, how to configure Eureka and Ribbon?
I just extracted some lines of code from RestTemplate and created my custom JmsTemplate (microservice works with jms remoting with apache camel and activemq), exactly how it is done in RestTemplate, but this code stil lacks connection to infrastructure
afaik, we can create a global singleton bean, run a separate thread from this bean, and run Boot app from this thread, but don't you think that it is very ugly and can lead to problems? How it really should be used?
Great question!
One approach is to use a "sidecar". This seems to be a companion Spring Boot application that registers with the Eureka Server on behalf of your traditional web app.
See e.g.:
http://www.java-allandsundry.com/2015/09/spring-cloud-sidecar.html
http://cloud.spring.io/spring-cloud-netflix/spring-cloud-netflix.html#_polyglot_support_with_sidecar
Another approach is to use the following library:
"A small lib to allow registration of legacy applications in Eureka service discovery."
https://github.com/sawano/eureka-legacy-registrar
This library can be used outside of Spring Boot.

Resources