use spring cloud config in web application without spring boot - spring-cloud

i want to know is there any way to use spring cloud config client without spring boot in a spring web application.
i want to use spring cloud config with #Value annotation and i don't like to use spring cloud server rest api in my web application
i have tried what developers said in Spring Cloud Config Client Without Spring Boot link but it didn't work

Yes it's possible. You will have to add spring boot but don't have to really use it (we had it working in a non-springboot app). Check this code here https://github.com/4finance/micro-infra-spring/tree/master/micro-infra-spring-config . You don't need a config server then to use the properties. I don't have a code snippet for that but you would have to create manually a spring boot context in your just to make this work. Also check this answer - Spring Cloud Config Client Without Spring Boot . Even if you will make it work it doesn't mean that the ordering will be proper.
The suggested solution then is to actually use Spring Boot :)

I provided an answer here : Spring Cloud Config Client Without Spring Boot that can help you. It's a working prototype to load property sources from Zookeeper using Spring Cloud Config Zookeeper in a webapplication without Spring Boot.

Related

Can one setup Spring Boot 2.6 and Spring Cloud 2021.x to use Ribbon and Hystrix with Spring WebClient and Feign?

I know that Spring Cloud at some version (3.0?) dropped direct support for some Netflix libraries like Ribbon or Hystrix. Now I'm trying to make a smooth migration of around 20 microservices running on production having some custom code extending Ribbon (and Hystrix to a lesser degree). The main goal is to upgrade from Spring Boot 2.3 to 2.6. As a consequence I need to upgrade Spring Cloud to 3.1.x, right?
My guess was to proceed with 2-step upgrade to avoid a one big-step migration:
Upgrade to Spring Boot 2.6 and Spring Cloud 3.1 while still using Ribbon and Hystrix
Make a way through a jungle of an old code and getting rid of Ribbon and Hystrix in smaller increments.
However to achieve this I'm trying to use simultanously Spring Boot 2.6, Spring Cloud with release train 2021.01 and 2 selected starters from older Spring Cloud (latest versions of these artifacts):
spring-cloud-starter-netflix-hystrix 2.2.10.RELEASE
spring-cloud-starter-netflix-ribbon 2.2.10.RELEASE
Is this possible at all? We are heavilly using Feign and Spring WebClient - client-side load-balancing must work for these. So far I found out Feign clients are not automatically integrated with Ribbon.
#spencergibb #OlgaMaciaszek - especially counting on you.
Answering my own question after receiving confirmation from Spring Cloud team by other means: this is a bad idea to try use Ribbon with Spring Cloud 2021.01 and it would require a really hard work to make it working.
So short answer is: "no".

what are the advantages of aws cloud config over spring cloud config?

Based on what parameters can we decide on a config server? aws cloud config vs spring cloud config server?
if the application is developed based on Spring framework, which one will be a better option? aws-cloud-config / spring-config?
does both support XML/properties configuration other than YAML?
Can both be configured for High Availability?
Is it possible to define a workflow (for approval of changes that need to be moved to PRODUCTION, using jenkins for example?)
If your application is based on Spring, it makes sense to use Spring Cloud Config as you would be using a specific framework instead of a Generic framework like AWS config
yes, Spring Cloud Config supports both YAML and property files
Ultimately the Spring Cloud Config is a Spring Boot App, hence you can make it high available using the same strategy that we use for any Spring Application
The simplest Approval work flow would be
Configure your Jenkins Job to send mail for approval
Set-up Promotion using https://wiki.jenkins.io/display/JENKINS/Promoted+Builds+Plugin
Deploy the Artificats to the specific environment

Configuring Spring Cloud Stream in Camden.SR5 with Spring boot 1.5.1

First off, thanks to the Spring team for all their work pushing this work forward!
Now that Camden.SR5 is official, I have some questions on how to correctly configure the spring cloud stream kafka binder when using Spring Boot 1.5.1.
Spring boot 1.5.1 has auto configuration for kafka and those configuration options seem to be redundant with those in the spring cloud stream kafka binder.
Do we use the core spring boot properties (spring.kafka.) or do we use (spring.cloud.stream.kafka.binder.)?
I did find this issue, but I am curious if this work will be included in the next Camden release?
https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/73
Additionally, I saw this issue reported on Stack Overflow and I believe it will also be an issue with Camden.SR5?
Failed to start bean 'inputBindingLifecycle' when using spring-boot:1.5.1 and spring-cloud-stream
Thanks
Supporting the Boot 1.5 configuration options is an issue in progress. Also, since dedicated 1.5 support is coming only with Spring Cloud Stream Chelsea release train (which is included in the Dalston release of Spring Cloud), it will be available only there.
Also, when using Spring Cloud Camden with Boot 1.5 you will need to override the Kafka dependencies as described in Failed to start bean 'inputBindingLifecycle' when using spring-boot:1.5.1 and spring-cloud-stream. This will be avoided in future versions of Spring Cloud Stream (and Spring Cloud) but only starting in the Chelsea release train of Spring Cloud Stream (and the Dalston release of Spring Cloud) - see https://github.com/spring-cloud/spring-cloud-stream-binder-kafka/issues/88 for details.

Spring Batch Admin Manager alternative

Spring Batch Admin Manager implementation is not updated since January 2015.
Is there something else that have to be used instead?
Or should I still use Spring Batch Admin Manager to provide some generic UI for Spring Batch application?
Assuming you mean the Spring Batch Admin v1.3.1 release then:
Is there something else? Yes, if your spring batch application is a spring boot variant have a look at https://github.com/codecentric/spring-boot-admin and how to configure it checkout http://codecentric.github.io/spring-boot-admin/1.4.1/#getting-started and https://blog.codecentric.de/en/2014/09/spring-boot-admin-first-official-release/
The Spring Batch Admin Git Repository claim
NOTE: This project is being moved to the Spring Attic and is not recommended for new projects. Spring Cloud Data Flow is the recommended replacement for managing and monitoring Spring Batch jobs going forward. You can read more about migrating to Spring Cloud Data Flow here.

Spring Cloud with Archaius

I'm having a hard time to understand how to use Netflix Archaius with Spring Boot Config.
I have a a microservice that gets the configuration from a Spring Cloud Config Server but I would like to have the configuration automatically refreshed when it is changed. As I understand this can be achieved with Archaius in the client side by pulling the info from the repository.
I have searched but cannot find a tutorial or example where this is done.