Describe the bug
Spring Cloud Version: 2022.0.0
We are comparing a Git and S3 backend to better understand the differences, specifically for serving text files. There's some different behavior between requesting files between the S3 and Git backends and was trying to understand why this is expected.
Unless we're misunderstanding, it makes switching out the back-ends impact the clients. Only handling JSON files in S3 is fine for now, but we would have expected the application name and routes to be consistent between the two back-ends.
In the S3 implementation, it's treating the {application}
as part of the object key prefix so the following requests work differently between the back-ends.
Git:
curl localhost:8080/foo/default/master/data1.json
(works)
S3:
curl localhost:8080/foo/default/master/data1.json
(does not work)
curl localhost:8080/foo/default/master/data1
(does not work)
curl localhost:8080/data/default/master
(works)
Thanks for any guidance.
Sample
Git Repo and Bucket have a single file called data1.json
. In Git, it is in the master
branch. In the S3 bucket, there is a master
folder in bucket bucket1
S3 Config
awss3:
bucket: bucket1
region: us-east-1
endpoint: http://localhost:9000
Git Config
git:
uri: file:///Users/tgaines/dev/config-data
default-label: master
clone-on-start: true
Comment From: ryanjbaxter
To make this work we originally relied on Spring Cloud AWS. You would need to add Spring Cloud AWS to the classpath.
https://github.com/spring-cloud/spring-cloud-config/pull/1517
However there are a couple of issues that I see with this.
- There doesn't appear to be a GA release of Spring Cloud AWS that is compatible with Spring Boot 3.0.x yet.
- The class we relied on
SimpleStorageProtocolResolver
appears to have been removed from Spring Cloud AWS in their main branch.
Did this work with Spring Cloud 2021.0.5?
Comment From: tjg184
Thanks for the reply @ryanjbaxter. I moved to 2021.0.5
and now getting compilation issues about S3Client
vs AmazonS3
.
I am including Spring Cloud AWS (3.0.0-M3
).
Technically, everything works in 2022.0.0
but is it expected to have different behaviors for how files are retrieved between a Git and S3 backend? In the Git version, it treats the first part of the route as the application name whereas in S3 it uses it as part of the object key for retrieving a file.
Git (foo
is the application name here)
curl localhost:8080/foo/default/master/data1.json
S3 (foo
is used to build the object key - this doesn't work)
curl localhost:8080/foo/default/master/data1.json
Thanks again.
Comment From: ryanjbaxter
Can you provide a sample config server application that uses 3.0.0-M3?
Comment From: tjg184
Main repo (Spring Boot 3) https://github.com/tjg184/spring-cloud-config
I'm using Minio so just manually configured it in com.tgaines.config.Configuration
. There may be a simpler way here, but this worked for now.
I pushed a repo up with sample data.. Spring Cloud Config Data: https://github.com/tjg184/spring-cloud-config-data
Comment From: tjg184
May be related to https://github.com/spring-cloud/spring-cloud-config/issues/1939
Comment From: ryanjbaxter
FYI there is another bug in Spring Cloud AWS 3.0.0 which blocks this from working https://github.com/awspring/spring-cloud-aws/issues/650