Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spring Cloud Config with JDBC backend dosn't support all HTTP service's resources #2047

Closed
shaikezam opened this issue Feb 9, 2022 · 17 comments

Comments

@shaikezam
Copy link

shaikezam commented Feb 9, 2022

Describe the bug
I've create two projects:

  1. Spring Cloud Config Server with H2 database as a backend
  2. Spring Boot simple app that acts as a Spring Cloud Config Client.
    Fetch properties & auto refresh working great,

This is the properties table:
image

Once I navigate to http://localhost:8888/client/dev/latest I get:

{
	"name": "client",
	"profiles": ["dev"],
	"label": "latest",
	"version": null,
	"state": null,
	"propertySources": [{
		"name": "client-dev",
		"source": {
			"my.value": "Hello world"
		}
	}]
}

According to the doc:
image

And if I navigate to http://localhost:8888/client-dev.json I get an empty {} (the same for yml or properties - just an empty response)

Any help how to fetch an entire application configuration for specific profile?

Thanks!

@ryanjbaxter
Copy link
Contributor

Can you provide a complete, minimal, verifiable sample that reproduces the problem? It should be available as a GitHub (or similar) project or attached to this issue as a zip file.

@shaikezam
Copy link
Author

Hi @ryanjbaxter thanks.
Not sure if this is relevant, but this is the Git Hub repo - https://github.com/shaikezam/spring-cloud-config-jdbc

@ryanjbaxter
Copy link
Contributor

I cannot get the config server to start successfully, can you please provide a minimal example that demonstrates the problem and instructions on how to reproduce the problem with the example

@shaikezam
Copy link
Author

@ryanjbaxter
Copy link
Contributor

Duplicate of #2020

@ryanjbaxter ryanjbaxter marked this as a duplicate of #2020 Feb 15, 2022
@shaikezam
Copy link
Author

Thanks @ryanjbaxter

It's still didn't fetch me the URL of /{application}-{profile}.properties (/{label}/{application}-{profile}.json working)

@ryanjbaxter
Copy link
Contributor

I know I closed this because it is the same problem as another issue already open

@shaikezam
Copy link
Author

Thanks @ryanjbaxter
Any estimation when this will fixed?

@ryanjbaxter
Copy link
Contributor

I'm going to take a look at it today. There is a workaround in the issue I referenced to change the matching algorithm

@shaikezam
Copy link
Author

Thanks @ryanjbaxter
The workaround spring.mvc.pathmatch.matching-strategy=ant_path_matcher still didn't resolved the URL of /{application}-{profile}.properties

@ryanjbaxter
Copy link
Contributor

I added spring.mvc.pathmatch.matching-strategy=ant_path_matcher to the server in your sample and went to http://localhost:8888/teva/client-dev.properties and got the properties

@shaikezam
Copy link
Author

Thanks @ryanjbaxter
So as me, but it still didn't fetch me the URL of /{application}-{profile}.properties
http://localhost:8888/client-dev.properties

@ryanjbaxter
Copy link
Contributor

Right you are missing the label in the URL

@shaikezam
Copy link
Author

Thanks @ryanjbaxter

But I want properties of entire application + profile without label.
According to
image

You support /{application}-{profile}.properties

@ryanjbaxter
Copy link
Contributor

Without specifying a label the default will be master the label in your DB is teva, there is no data with a label master

@shaikezam
Copy link
Author

thanks @ryanjbaxter
So it will be /master/client-dev.json when I execute the API http://localhost:8888/client-dev.properties?

@ryanjbaxter
Copy link
Contributor

Correct those would be equivalent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants