Dynamic Params in drop-down UI

5 views
Skip to first unread message

Ajay Babu

unread,
Sep 9, 2025, 10:56:37 AM (10 days ago) Sep 9
to Nussknacker

Hi,

I created a custom Database Enricher (since it's not available in the open-source version) that executes queries on a database.I want to add a drop-down in the UI where users can select a pool name to execute JDBC queries. I’ve created a YAML file that contains a list of pool configurations, including properties like driver, url, username, password, minPoolSize, and maxPoolSize, etc.

A singleton DatabaseManager class loads this YAML file and maintains a map or list of available pool names.My goal is to populate the poolName parameter in the UI drop-down with these names. When the user deploys the flow, I will internally create a connection pool using the selected pool's configuration. This connection pool will be reused whenever the same pool name is selected again.

I’ve tried multiple approaches, but none have worked so far. I’ve also attached a sample class annotation for reference.

Could you please suggest the correct way to implement this, or recommend a better approach to achieve the desired functionality?

DatabaseEnricher.scala
DatabaseConnectionManager.java

Ajay Babu

unread,
Sep 11, 2025, 10:19:32 AM (8 days ago) Sep 11
to Nussknacker

Hi,

Kindly update.

Thanks,
Ajay Babu Maguluri.

Arkadiusz Burdach

unread,
Sep 11, 2025, 1:18:46 PM (8 days ago) Sep 11
to Ajay Babu, Nussknacker, sup...@nussknacker.io
Hi,


On 11.09.2025 16:19, Ajay Babu wrote:

Hi,

Kindly update.

Thanks,
Ajay Babu Maguluri.

On Tuesday, September 9, 2025 at 8:26:37 PM UTC+5:30 Ajay Babu wrote:

Hi,

I created a custom Database Enricher (since it's not available in the open-source version)

Database Enricher is available in the open-source version: https://nussknacker.io/documentation/docs/integration/Sql/

that executes queries on a database.I want to add a drop-down in the UI where users can select a pool name to execute JDBC queries. I’ve created a YAML file that contains a list of pool configurations, including properties like driver, url, username, password, minPoolSize, and maxPoolSize, etc.

A singleton DatabaseManager class loads this YAML file and maintains a map or list of available pool names.My goal is to populate the poolName parameter in the UI drop-down with these names. When the user deploys the flow, I will internally create a connection pool using the selected pool's configuration. This connection pool will be reused whenever the same pool name is selected again.

I’ve tried multiple approaches, but none have worked so far. I’ve also attached a sample class annotation for reference.

Could you please suggest the correct way to implement this, or recommend a better approach to achieve the desired functionality?

Why do you want to reuse the connection pool? Am I right that you want to avoid creating a separate connections for each deployed scenario?
What engine do you use?
The approach that you've sent, won't work with Flink out of the box, because Flink creates a separate classloader for each job so DatabaseConnectionManager accessed by job1 will different from DatabaseConnectionManager accessed by job2. You can work around this problem by adding the jar with DatabaseConnectionManager to Flink's lib. Thanks to that, this class will be on "parent" classpath.

--
You received this message because you are subscribed to the Google Groups "Nussknacker" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nussknacker...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/nussknacker/a7017842-8f05-49d0-9630-95e505123889n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages