Skip to content

Fix vault example: hashicorp secret separator and unmarshalled JDBC result - #214

Open
Croway wants to merge 1 commit into
mainfrom
fix-vault-example
Open

Fix vault example: hashicorp secret separator and unmarshalled JDBC result#214
Croway wants to merge 1 commit into
mainfrom
fix-vault-example

Conversation

@Croway

@Croway Croway commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • camel-hashicorp-vault resolves {{hashicorp:secret:<path>#<key>}} using # to separate the secret path from the field key, not /. The datasource bean (cars-datasource.yaml) used /, so the placeholders never resolved and the app failed to start against a real Vault.
  • Aligned the README's instructed secret name (myDatabase) with the path actually used in code (database), and flagged the now-stale screenshot.
  • GET /api/cars 500'd with NoTypeConversionAvailableException converting the JDBC SELECT's ArrayList result to InputStream for the text/plain REST response. Now marshals the result to JSON (camel-jackson-starter added) and serves it as application/json.

Test plan

  • mvn -pl vault -am compile
  • Ran real hashicorp/vault:1.16.1 and postgres containers, created the database secret via the Vault API, started the app with mvn spring-boot:run
  • GET /api/cars200 []
  • POST /api/cars with a car payload → 200
  • GET /api/cars200 [{"brand":"Ford","model":"Mustang","year":2024}]

🤖 Generated with Claude Code

https://claude.ai/code/session_01HseDjsECuZhsCXxxioiD1k

…led JDBC result

camel-hashicorp-vault resolves {{hashicorp:secret:<path>#<key>}} using
'#' to separate the secret path from the field key, not '/'. The
datasource bean used '/', so the placeholders never resolved and the
app failed to start against a real Vault. Also aligned the README's
secret name (myDatabase) with the path actually used in
cars-datasource.yaml (database).

Separately, GET /api/cars 500'd with NoTypeConversionAvailableException
converting the JDBC SELECT's ArrayList result to InputStream for the
text/plain REST response. Marshal the result to JSON (adding
camel-jackson-starter) and serve it as application/json instead.

Verified end-to-end against real Vault and Postgres containers: app
starts, GET returns [], POST inserts a row, GET then returns it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HseDjsECuZhsCXxxioiD1k
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant