-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Support SPEL expressions in @HttpExchange
and related annotations
#30125
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
Comments
Supporting SpEL expressions in such annotations is one thing and we can consider this. In this case, I think the best course of action would be configure that URL as the base URI used by the HTTP client used when generating the proxy. Have you tried this approach? |
No, I haven't because it wouldn't do what I want anyway (I would like to avoid hardcoding of any part of url template in such annotations. But in this case I still would have to specify relative part of url template in the annotation). |
These are not SpEL expressions, but property placeholders, and we already resolve these, see #28492. Make sure that you are setting |
Ok, after following change it works. Thanks var httpServiceProxyFactory = HttpServiceProxyFactory.builder(webClientAdapter)
.embeddedValueResolver(configurableBeanFactory::resolveEmbeddedValue)
.build(); (Now It would be nice that Intelij IDEA to support property placeholders in these annotations) |
@HttpExchange
and related annotations
So this got closed, but is it because there's no interest in supporting spel expressions? I would like spel expressions because I would like to use properties on objects in the current request scope. AFAIK the only way I'm going to get a correlation ID that I stuff into the request scope as a bean into an HTTP interface whilst trying to avoid passing it around is a spel expression. Am I wrong about that? either way could we get spel expression support? |
I would like to avoid hardcoding of url template in these annotations to be able to change it via configuration properties.
So, I would like to be able specify configuration property in these annotations, for example:
@GetExchange("${app.api.url}")
- whereapp.api.url
is a configuration property keyand
@GetExchange("#{@app.api.url}")
- whereapp
is some bean annotated with@ConfigurationProperties
Could you please implement such thing?
The text was updated successfully, but these errors were encountered: