Skip to content

Declarative Restclient Interfaces not compatible with the Property Placeholder in Spring Boot 4.0 #36017

@yigsvnsla

Description

@yigsvnsla

Hi team,

I noticed that property placeholders (${...}) are not being resolved inside @HttpExchange(url = "...") when using declarative RestClient interfaces in Spring Boot 4.0.

Even though placeholders work correctly in other annotations (e.g., @JmsListener(destination = "${mq.config.requestQueue}")), the following fails:

@HttpExchange(url = "${provider.auth.url}")
public interface AuthClient { ... }

This results in:

java.lang.IllegalArgumentException: Map has no value for 'provider.auth.url'
    at org.springframework.web.util.UriComponents$MapTemplateVariables.getValue(UriComponents.java:336)
    ...

Is placeholder resolution currently supported for @HttpExchange and @ImportHttpServices?
Or is this a missing feature that will be added later?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions