Win a copy of Fixing your Scrum this week in the Agile forum!

Sam Mallick

Greenhorn
+ Follow
since Jul 19, 2021
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sam Mallick

Hello Everyone,

I am trying to learn Spring Cloud Config Server/Client setup. But more I read, the more I sink into a rabbit hole. The resources available online are good to get started with, but I am having a hard time with the complexity of what I am trying to build. So I have a few questions regarding what is doable and what is not doable! I am learning as I go!

First let me get this out of the way. I am not planning on using GIT. I will be using a local file system on Unix and run the Spring Cloud Server there.

1. To run with a file system, I need to use the profile "native". Is there a way to use dev, production etc profiles with a file system? I tried it but I keep getting the error GIT URI is needed when I start my application. I am not able to overcome this (this is probably my first major hurdle).

2. I have about six servers that will be sending requests for properties/files to Spring Cloud server. So I wanted to make six folders in the file system, and serve requests depending on where they are coming from. So I thought of making six profiles with different "spring.cloud.config.server.native.searchLocations" and maybe with a different port for each in them. Is this doable?

3. To do the above, I learned a bit about "composite" profiles. But couldn't find much examples online for it. So am I am not able to get it off the ground. Will it be helpful in what I am trying to achieve?


I have a lot more questions regarding Spring Cloud, but this is a start. Please help! I am a bit lost!
1 month ago
My problem is the GIT thing. Probably with Git the code might just work out fine. But I am using a native profile and trying to read a properties file from a local file system.

And with that URL I get:
1 month ago
Unfortunately the result is the same. I still get an empty JSON.
1 month ago
Hello Everyone,

I am trying to learn Spring Cloud Config because the application I work on is deployed on different servers with different properties. Previously it used Ant and filtering to create properties for each server at deployment time. But we are moving to Maven. So that option is gone. And moreover it was a very crude way of going about things. But then again, 15 years ago that was the only option they had I guess.

Okay that is the background. I have read some tutorials and gone through some of the code given there. I wrote a Spring Boot App that reads the property files, and I try to fetch it on the browser.

But the problem is, the properties show up empty. It is a very basic piece of code. So it not working has really dented my confidence!

My code is like this:




And my application.properties is like:



My pom.xml is:



But when I hit the URL:



I only see this:


Now I am not quite sure why the propertySource would be empty here. It should list the properties that I have in the properties file. The tutorials make it look easy. And the startup logs, dont shed any light on it. Although I do not know what to look for really!

I am on a Windows machine and running the code in Eclipse.

Now I have seen different tutorials have different property keys for the search locations, can you please tell me which one is right?


OR



I dont know what else information to provide, if you need anything else, please do let me know, I will add it to the question. Any help is greatly appreciated. Thanks!

1 month ago