Skip to content
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

support @Value annotation in Spring SDK #1646

Open
aludwiko opened this issue May 29, 2023 · 2 comments · May be fixed by #1647
Open

support @Value annotation in Spring SDK #1646

aludwiko opened this issue May 29, 2023 · 2 comments · May be fixed by #1647
Labels
DX Developer Experience related issue java-sdk kalix-runtime Runtime and SDKs sub-team

Comments

@aludwiko
Copy link
Contributor

We need to provide a way to configure Kalix components. In Spring, usually, this is done via @Value annotation.

public class EchoAction extends Action {

  public EchoAction(@Value("${test.config.int}") int value) {
    System.out.println(value);
  }

this doesn't work because we have a custom DefaultListableBeanFactory without additional configuration.

@aludwiko aludwiko added kalix-runtime Runtime and SDKs sub-team java-sdk labels May 29, 2023
@aludwiko aludwiko linked a pull request May 29, 2023 that will close this issue
@aludwiko aludwiko linked a pull request May 29, 2023 that will close this issue
@aludwiko
Copy link
Contributor Author

I was able to fix that: https://github.com/lightbend/kalix-jvm-sdk/pull/1647/files#diff-145fb34add220ff4456929bdec52eb12dd0b294dad2c6d6fcde36ff8674c8e87R262 but I'm not comfortable with that change. It feels hacky and maybe there is a more elegant solution.

@aludwiko aludwiko added the DX Developer Experience related issue label Jul 10, 2023
@aludwiko
Copy link
Contributor Author

Another idea might be to look at PropertyPlaceholderAutoConfiguration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DX Developer Experience related issue java-sdk kalix-runtime Runtime and SDKs sub-team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant