SpringBootProperties_2_7:ChangeSpringPropertyKey doesn't properly handle spring.artemis.broker-url with port
What version of OpenRewrite are you using?
rewrite-maven-plugin 5.11.0 with rewrite-spring 5.1.1
How are you running OpenRewrite?
rewrite-maven-plugin. project is not public/sharable.
What is the smallest, simplest way to reproduce the problem?
application.properties file including:
spring.artemis.host=localhost
spring.artemis.port=61616
What did you expect to see?
If there is a spring.artemis.port property present in the original file, it should be incorporated into the resulting broker-url property along with the host:
spring.artemis.broker-url=localhost:61616
What did you see instead?
The current rule simply replaces "host" with "broker-url" and fails to account for "port" if it is also present.
spring.artemis.broker-url=localhost
spring.artemis.port=61616
What is the full stack trace of any errors you encountered?
No errors. openrewrite runs successfully, but just produces a sub-optimal result.
Are you interested in contributing a fix to OpenRewrite?
Not at this time.
Ah yes, thanks for reporting the issue! This is part of our generated Spring Boot properties migrations based on their configuration meta data. https://github.com/openrewrite/rewrite-spring/blob/87734334164fa908ed1ce7ef5217bf059fb9491a/src/main/resources/META-INF/rewrite/spring-boot-25-properties.yml#L25-L30
Looks like we'd need to
- Remove those lines above
- Add a dedicated recipe that detects both properties
- Combined those properties into one
broker-url
Since this is a one-off migration issue, I'll leave it up to an enthusiastic member of the community to pick this up.
@timtebeek I will pick up this one