I'm using Spring boot (1.5.6.RELEASE) to supply a default property if none is set elsewhere. However, instead of the expected result, I get a leftover curly bracket "}" in the result.
I've created a github test case which reproduces it. See:
https://github.com/garethrandall/spring-boot-property-failure
In rabbitmq-context.xml, this line has a default value for the addresses property:
<rabbit:connection-factory id="rabbitmqConnectionFactory" addresses="${rabbit.host:localhost}:5672"/>
Expected result: addresses property ends up as:
"localhost:5672"
Actual result: addresses ends up as this:
"localhost}:5672"
which then causes a parse error later in Spring.
Exception message is:
Caused by: org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'addresses' threw exception; nested exception is java.lang.NumberFormatException: For input string: "localhost}:5672"
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:121)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:75)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1564)
... 37 more
Has anyone seen this before? There is a Spring Boot 2.0.0 but it's not a stable release yet, so I'm keen to fix this on 1.5.6.RELEASE.
[This is different from another question because the answer to that question does NOT work (surround default with single quotes).]