SpringBoot gitHub config server not able to read from folder in Repo - github

I was getting my hands into spring boot with using a git based config file.
This is my repo.
In here I have some config files inside tolls-config folder this does retrieve the config file
But when in the tutorial this repo is used it works
API call :
localhost:8888/s1rates/default
My Questions
Do I need to modify the API call
Should my uri be pointing to specific folder in repo( I tried putting folder URL and it gives a 500)
Every config file has to been its own repo ( there is no way
around it )

I loked at your repo and it seems that you misspelled the property for searchPaths instead of search-paths like you have in your config.
spring:
cloud:
config:
server:
git:
uri: https://github.com/spring-cloud-samples/config-repo
searchPaths: foo,bar*

Related

spring cloud config custom path

git structure
/--|
|--/tenant-name1|
- tenant-name1.properties
|
|--/tenant-name2|
- tenant-name2.properties
i using props from single app but with multiple tenants. Tenants can be applied to project in runtime. All tenants properties in their own folder.
How i can configure path for get properties for tenantX?
tried different variants like
localhost:8888/tenantX/tenantX.properties
my spring cloud application.yaml
server.port: 8888
spring:
profiles:
active: git
cloud.config:
server:
git:
uri: https://gitlab.some.path.git
search-paths: '{application}'
username: dummy
password: dummy
default-label: release-candidate
just adding property
spring.cloud.config.server.native.searchLocations: {application}
and for application= tenantA it will be search in /tenantA/* folder
native using due underlying git cloned into local (into some /tmp/ fodler) and searching file via native (aka FileSystem repository)

NextJS API routes are missing from Vercel's build outputs when folder contains index.js/ts

I'm using NextJS /api routes and deploying to Vercel.
It seems that wherever I have an index.ts file located within the /api folder structure, Vercel will replace the contents of its containing folder (including /api itself) with a single file. All of the sibling route files will be ignored.
Oddly enough, the folder that contains the index file will remain--but without contents.
Ex:
/api/index.ts
/api/mock1/index.ts
/api/mock1/mock1-endpoint.ts
/api/mock2/index.ts
/api/mock2/mock2-endpoint.ts
This will produce an output of:
/api // empty folder
λ api
Note: you'll have to deploy this code to see the output in Vercel's dashboard
Reproducible code: https://github.com/angusryer/missing-lambdas-vercel-nextjs
Deployed example: https://missing-lambdas-vercel-nextjs.vercel.app/
The api routes are visible as seen in the 'source' tab of the production deployment:
But they are not available in the 'output' tab:
Does anyone know why this happens and ways to get around it?

Config Server in Play framework 2.7

I am implementing a web socket server application using play framework 2.7
I would like to implement a remote configuration where all the application's
configuration should reside in a github.
When i searched for documents to implement it, i found below url,
https://github.com/play-rconf
but accessing configuration from github is not listed.
Is there any better way or document do access the config server from github (like in Spring) ?
You can try play-rconf-http by specifying a URL of your config file:
remote-configuration {
## Provider - HTTP
# ~~~~~
# Retrieves configuration from a simple HTTP server
http {
# URL where is located the configuration file to fetch. You can
# use basic authentication
url = "https://raw.githubusercontent.com/<user>/<repo>/<branch>/<path-to-file>"
url = ${?REMOTECONF_HTTP_URL}
}
}
You can use basic authentication as well.
Look Download single files from GitHub for more info regarding GitHub link.

Spring cloud config with github

I just got a problem when using spring cloud config with github.I'm not really good at English,I hope I could explained this problem clearly.And thinks
you guys for reading this.
The problem is about Spring Cloud Config with github.And it happened when I added some more folds and config files to the repository where hold all my cloud config files.
First,I set uri,searchPaths,username,password under the cloud.config.server.git in the application.yml file belonged to config server.
Then,I push all my config files to the github.I called the parent repository ConfigRepo,and in this repo,I got two folders named A and B.
The construction is just look like this.
-ConfigRepo
-A
-A.yml
-B
-B.yml
Finally,I set the other applications' application name in their bootstrap.yml which means A and B.
After I've done that,I started my applications.All the client servers could find the config server and got the correct config yml file by the url.For example, the client A get its configs from
github.com/user/ConfigRepo/A/A.yml
But cause I needed to add a new application C,so I created a new folder C to hold and save the Application C's config file and push it to the github.
I finished the config work of application C just like above and start the it.But I found the url represent config file has changed.I mean,it suppose to be
github.com/user/ConfigRepo/C/C.yml
But in fact,the url of github has changed to
github.com/user/ConfigRepo/tree/master/C/C.yml
The worse thing is,not only the url represents C's config file has changed,all the url represents config file in the ConfigRepo has changed.
And no matter how i change the uri or searchPaths under cloud.config.server.git,the client server's log shows me that the name of located property source's mapPropertySource always is
github.com/user/ConfigRepo/C/C.yml
As a result,i cant get any configs except null so all the applications cant be started even include the A and B which could started before i pushed the new config file to the github.
So,what should I do?Is a way to make github get rid of /tree/master in the url?Or how to config my config server to support my project?
Thanks Again!
We are doing micro service project and used below configuration for retrieve configuration from GitHub. you need to add label as master to retrieve configuration.
spring:
application:
name: ####
profiles:
active: ####
cloud:
enable: true
config:
uri: ${CONFIG_SERVER_URL}
failFast: true
retry:
maxAttempts: 20
label: master
profile: ######

loading multiple properties with config-server

I have successfully tested loading properties from SVN repository, currently in my config server i have provided the URI and default-label: trunk and i have application specific property under trunk. below is the contents of my consuming application's application.yml and able to pull the properties successfully
spring:
application:
name: foo-development
cloud:
config:
uri: http://localhost:${config.port:8888}
now i have a shared property in different folder thats shared across other applications as well, so how do i load this into my application along with my application specific
The spring.cloud.config.name property allows you to specify multiple application names separated by a comma, so all you have to do is change your application.yml to
spring:
application:
name: foo-development
cloud:
config:
uri: http://localhost:${config.port:8888}
name: foo-development,myshared
This will load both foo-development properties as well as myshared properties.
You can create a general application.yml in the root folder of SVN.
See the example config repo here:
https://github.com/spring-cloud-samples/config-repo
And here is an example consumer
https://github.com/spring-cloud-samples/customers-stores/blob/master/rest-microservices-store/src/main/resources/bootstrap.yml
The customer-stores project will read from application.yml and also from stores.yml in the repo.
To confirm, check the /env URL if you have actuator added and you should see two configService entries