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

Missing clientId in application.yml causing an error #293

Closed
VaishnaviNandakumar opened this issue May 8, 2023 · 8 comments · Fixed by #295
Closed

Missing clientId in application.yml causing an error #293

VaishnaviNandakumar opened this issue May 8, 2023 · 8 comments · Fixed by #295
Labels
bug Something isn't working released

Comments

@VaishnaviNandakumar
Copy link
Contributor

VaishnaviNandakumar commented May 8, 2023

Describe the bug

When I first tried to clone and run the template I was stuck at the following issue.
Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'mqtt.broker.clientId' in value "${mqtt.broker.clientId}"
This is caused due to a missing property in the application.yml file.
I wanted to know if there was a specific reason for excluding it. If there isn't, I would like to pick this issue up and contribute.

How to Reproduce

  • asyncapi generate fromTemplate asyncapi.yaml @asyncapi/java-spring-template -o spring-output-test
  • Run application

Expected behavior

Spring boot application will not start.

@VaishnaviNandakumar VaishnaviNandakumar added the bug Something isn't working label May 8, 2023
@github-actions
Copy link

github-actions bot commented May 8, 2023

Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

@VaishnaviNandakumar
Copy link
Contributor Author

@Tenischev @derberg Hi, could you please take a look at this? Thanks

Copy link
Member

derberg commented May 11, 2023

@Tenischev please have a look 🙏

@Tenischev
Copy link
Member

Hello @VaishnaviNandakumar!
Probably you do not specify value of clientId in your asyncapi file.
Please have a look on example -

servers:
production:
url: mqtt://localhost:{port}
protocol: mqtt
description: dummy MQTT broker
bindings:
mqtt:
clientId: guest

@VaishnaviNandakumar
Copy link
Contributor Author

@Tenischev Thanks for the response!
I would like to contribute to a feature where this clientId would be configured in the template and be present automatically in the generated code rather than adding it manually.
If there are no particular constraints to this problem, could I be assigned to this issue?

@Tenischev
Copy link
Member

@VaishnaviNandakumar you could do it. I think, adding mqttClientId to parameters also will be a good option.

So I suggest the following order of applying the value (the higher the better):

  1. parameter mqttClientId
  2. value from asyncapi file
  3. some default value

@VaishnaviNandakumar
Copy link
Contributor Author

@Tenischev Thank you. Will work on this and let you know once I've made a PR.

@asyncapi-bot
Copy link
Contributor

🎉 This issue has been resolved in version 0.29.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants