Replies: 2 comments 3 replies
-
You could try to define the prefix dbzm.database and, instead of a Properties, create a pojo with hostname, port and user properties. |
Beta Was this translation helpful? Give feedback.
1 reply
-
You can do something like this: @ConfigMapping(prefix = "dbzm")
public interface Dbzm {
@WithParentName
Map<String, String> properties();
} dbzm."database.hostname"=10.110.116.22
dbzm."database.port"=5432
dbzm."database.user"=nms Note that the key segment must be quoted, so the entire segment is handled as a key entry in the Map. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi; following insights episode 103 the debezium demo code needs to read properties from the application.properties with a specific prefix into a properties object.
i would assume that we would have something like
@ConfigProperties(prefix="dbzm") public Properties<String, String> inj;
which would inject to the properties object all props from the file starting wiht the specified prefix (minus the porefix)
however, they actually coded the conversion by reading all properties, substringing them and building the properties "from scrach"
i tried to find the way to achieve this with simple injection and didnt find the way.
is this missing in smallrye/mp config?
again assuming we have application.properties as such:
dbzm.database.hostname=10.110.116.22 dbzm.database.port=5432 dbzm.database.user=nms
I would like to do something like:
@ConfigProperties(prefix="dbzm") public Properties<String, String> inj;
and use this properties object where needed.
looks straight forward to me. am I missing something?
thanks
Beta Was this translation helpful? Give feedback.
All reactions