Quarkus and Activiti: definig the datasource with Agroal not possible

289 views
Skip to first unread message

Werner Gresshoff

unread,
Dec 16, 2019, 9:05:49 AM12/16/19
to Quarkus Development mailing list
Hello,

I'm using the workflow engine Activiti in a project and just migrated from Thorntail to Quarkus 1.0.1. I'm having some difficulties in defining the database access:

- Quarkus doesn't support JNDI, so that's a nogo.
- Quarkus delivers Agroal as connection pool, but Activiti needs a default (no args) constructor of the Datasource which Agroal doesn't provide.
- just configure Activiti with jdbcUrl, user and password doesn't work too well. Sometimes IBatis (standard in Activiti) won't connect

Currently I'm using Apache DBCP2 from the commons project (and it works), but I would clearly prefer using Agroal, cause it's a standard extension. Is thera a way to circumvent the problems? One possibility would surely be overriding the DataSource implementation of Agroal. Has anyone had similar problems?

Best regards
Werner

Guillaume Smet

unread,
Dec 16, 2019, 11:40:12 AM12/16/19
to werner.g...@gmail.com, Quarkus Development mailing list
Hi Werner,

Activiti does not support CDI?

--
You received this message because you are subscribed to the Google Groups "Quarkus Development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to quarkus-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/quarkus-dev/9c5ac608-2087-49b7-9216-49e77f3e4d86%40googlegroups.com.

Stuart Douglas

unread,
Dec 16, 2019, 3:35:16 PM12/16/19
to Guillaume Smet, werner.g...@gmail.com, Quarkus Development mailing list
Maybe we should create a simple JNDI extension to allow for this sort of case, although I am not sure how hard it would be to get it working in native. I think there will be a lot of 3rd party libraries that expect to be able to look up datasources from JNDI, so a simple read only quarkus-jndi extension could be useful.

 I would tie it to CDI @Named, so you can just look up named beans and nothing else.


George Gastaldi

unread,
Dec 16, 2019, 4:16:39 PM12/16/19
to Stuart Douglas, Guillaume Smet, werner.g...@gmail.com, Quarkus Development mailing list
The idea is interesting, not only for Datasources but maybe JMS Queues as well - a feature that could be modeled as a BuildItem I think. 

Best Regards,


George Gastaldi

Principal Software Engineer

Red Hat



Martin Kouba

unread,
Dec 17, 2019, 4:23:56 AM12/17/19
to sdou...@redhat.com, Guillaume Smet, werner.g...@gmail.com, Quarkus Development mailing list
Dne 16. 12. 19 v 21:35 Stuart Douglas napsal(a):
> Maybe we should create a simple JNDI extension to allow for this sort of
> case, although I am not sure how hard it would be to get it working in
> native. I think there will be a lot of 3rd party libraries that expect
> to be able to look up datasources from JNDI, so a simple read only
> quarkus-jndi extension could be useful.
>
>  I would tie it to CDI @Named, so you can just look up named beans and
> nothing else.

Be careful with @Named, its primary purpose is to give a bean a name and
a bean with a name may be referred in templates (in general it's
accessible outside the java code).

>
>
> On Tue, 17 Dec 2019 at 03:40, Guillaume Smet <guillau...@gmail.com
> <mailto:guillau...@gmail.com>> wrote:
>
> Hi Werner,
>
> Activiti does not support CDI?
>
> On Mon, Dec 16, 2019 at 3:05 PM 'Werner Gresshoff' via Quarkus
> Development mailing list <quark...@googlegroups.com
> <mailto:quark...@googlegroups.com>> wrote:
>
> Hello,
>
> I'm using the workflow engine Activiti in a project and just
> migrated from Thorntail to Quarkus 1.0.1. I'm having some
> difficulties in defining the database access:
>
> - Quarkus doesn't support JNDI, so that's a nogo.
> - Quarkus delivers Agroal as connection pool, but Activiti needs
> a default (no args) constructor of the Datasource which Agroal
> doesn't provide.
> - just configure Activiti with jdbcUrl, user and password
> doesn't work too well. Sometimes IBatis (standard in Activiti)
> won't connect
>
> Currently I'm using Apache DBCP2 from the commons project (and
> it works), but I would clearly prefer using Agroal, cause it's a
> standard extension. Is thera a way to circumvent the problems?
> One possibility would surely be overriding the DataSource
> implementation of Agroal. Has anyone had similar problems?
>
> Best regards
> Werner
>
> --
> You received this message because you are subscribed to the
> Google Groups "Quarkus Development mailing list" group.
> To unsubscribe from this group and stop receiving emails from
> it, send an email to quarkus-dev...@googlegroups.com
> <mailto:quarkus-dev...@googlegroups.com>.
> <https://groups.google.com/d/msgid/quarkus-dev/9c5ac608-2087-49b7-9216-49e77f3e4d86%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Quarkus Development mailing list" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to quarkus-dev...@googlegroups.com
> <mailto:quarkus-dev...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/quarkus-dev/CALt0%2Bo8L%3DW9R48P497dm1jfptZqvC6Hsg%3DW4nWWDX%3DG58iv8%2BA%40mail.gmail.com
> <https://groups.google.com/d/msgid/quarkus-dev/CALt0%2Bo8L%3DW9R48P497dm1jfptZqvC6Hsg%3DW4nWWDX%3DG58iv8%2BA%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Quarkus Development mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to quarkus-dev...@googlegroups.com
> <mailto:quarkus-dev...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/quarkus-dev/CAD%2BL2cw9kza94oxZ2HLLsW4_%3D0JJwcko-F5T0HKVaFShao1cgg%40mail.gmail.com
> <https://groups.google.com/d/msgid/quarkus-dev/CAD%2BL2cw9kza94oxZ2HLLsW4_%3D0JJwcko-F5T0HKVaFShao1cgg%40mail.gmail.com?utm_medium=email&utm_source=footer>.

--
Martin Kouba
Senior Software Engineer
Red Hat, Czech Republic

Stuart Douglas

unread,
Dec 17, 2019, 5:34:46 AM12/17/19
to Martin Kouba, Guillaume Smet, werner.g...@gmail.com, Quarkus Development mailing list
On Tue, 17 Dec 2019 at 20:23, Martin Kouba <mko...@redhat.com> wrote:
Dne 16. 12. 19 v 21:35 Stuart Douglas napsal(a):
> Maybe we should create a simple JNDI extension to allow for this sort of
> case, although I am not sure how hard it would be to get it working in
> native. I think there will be a lot of 3rd party libraries that expect
> to be able to look up datasources from JNDI, so a simple read only
> quarkus-jndi extension could be useful.
>
>   I would tie it to CDI @Named, so you can just look up named beans and
> nothing else.

Be careful with @Named, its primary purpose is to give a bean a name and
a bean with a name may be referred in templates (in general it's
accessible outside the java code).


That is the same use case, when you make it named you would also allow it to be looked up from JNDI. As the main use case would be enabling legacy code that requires it then the user can bind anything they need via @Named producer methods.

Stuart

Werner Gresshoff

unread,
Dec 19, 2019, 4:18:00 AM12/19/19
to Quarkus Development mailing list
Hi Guillaume,

there is an extension for Activiti to add CDI support. What is it about?

Best regards
Werner

Am Montag, 16. Dezember 2019 17:40:12 UTC+1 schrieb Guillaume Smet:
Hi Werner,

Activiti does not support CDI?

On Mon, Dec 16, 2019 at 3:05 PM 'Werner Gresshoff' via Quarkus Development mailing list <quark...@googlegroups.com> wrote:
Hello,

I'm using the workflow engine Activiti in a project and just migrated from Thorntail to Quarkus 1.0.1. I'm having some difficulties in defining the database access:

- Quarkus doesn't support JNDI, so that's a nogo.
- Quarkus delivers Agroal as connection pool, but Activiti needs a default (no args) constructor of the Datasource which Agroal doesn't provide.
- just configure Activiti with jdbcUrl, user and password doesn't work too well. Sometimes IBatis (standard in Activiti) won't connect

Currently I'm using Apache DBCP2 from the commons project (and it works), but I would clearly prefer using Agroal, cause it's a standard extension. Is thera a way to circumvent the problems? One possibility would surely be overriding the DataSource implementation of Agroal. Has anyone had similar problems?

Best regards
Werner

--
You received this message because you are subscribed to the Google Groups "Quarkus Development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to quark...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages