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

Image hono-service-device-registry-jdbc-native:2.4.0 not available #3555

Closed
harism opened this issue Sep 30, 2023 · 6 comments
Closed

Image hono-service-device-registry-jdbc-native:2.4.0 not available #3555

harism opened this issue Sep 30, 2023 · 6 comments
Labels
JDBC Device Registry The JDBC based Device Registry implementation question
Milestone

Comments

@harism
Copy link
Contributor

harism commented Sep 30, 2023

Hello, I've been trying out the native images and noticed that the Hono 2.4.0 native image for JDBC device registry is not available on Docker Hub. I didn't find a reason for this and am rather asking is there going to be native build for this component in the future?

Edit: The answer was too close to find apparently https://github.com/eclipse-hono/hono/blob/master/services/device-registry-jdbc/pom.xml#L183 - I just wonder is this comment still valid and in progress?

         Currently we do not support compiling a native executable because it does not work with
         H2 in embedded mode. We can either drop support for H2 in embedded mode in the native image
         or always use the JVM based version.
@harism
Copy link
Contributor Author

harism commented Oct 1, 2023

I was going to try help a bit and run Hono integration tests with local native executable build against embedded H2 based JDBC native container to see if the issue still persists. But I faced some very likely Quarkus related native image creation issues and I will wait until issue [#3547] is resolved to see if updating Quarkus makes a difference.

@sophokles73
Copy link
Contributor

According to https://quarkus.io/version/3.2/guides/datasource#configure-datasources it should be possible to use H2 as well as PostgreSQL when compiling to native executables.

https://quarkus.io/version/3.2/guides/datasource#jdbc-datasource seems to indicate that H2 should also work in embedded mode in a native executable. This hadn't been the case back in the days ...

However, in order for all of this to work properly, I guess we (you?) would need to refactor the JDBC access layer to use a JDBC datasource provided by means of the H2 and/or PgSQL Quarkus extensions. IMHO that would be a great improvement because this would make compiling to native executables a much more pleasant experience since we would no longer need to configure the native build ourselves ...

@harism
Copy link
Contributor Author

harism commented Oct 5, 2023

Nice work on finding the background for this issue and yes, I could very well take a look on this eventually if no one else does it sooner.

@harism
Copy link
Contributor Author

harism commented Oct 10, 2023

@sophokles73 with the help of Quarkus 3.2 [#3547] and my initial work on Quarkus datasource migration [#3562] I was able to get some basic testing done with device registry native executable using H2. And it seems like the container/executable crashes hard as soon as a H2 connection is tried to open. And I am wondering already at this stage do the native executable containers have a normal Java file system access, do you happen to know?

I will try H2 in-memory use later on, but this occurred to my already now.

@sophokles73 sophokles73 added this to the 2.5.0 milestone Nov 22, 2023
@sophokles73 sophokles73 added the JDBC Device Registry The JDBC based Device Registry implementation label Nov 22, 2023
@harism
Copy link
Contributor Author

harism commented Dec 19, 2023

I have been able to run native integration tests with PostgreSQL and H2 JDBC device registry implementations. I prepare a pull request for these small changes very soon.

@sophokles73
Copy link
Contributor

closed via #3598

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JDBC Device Registry The JDBC based Device Registry implementation question
Projects
None yet
Development

No branches or pull requests

2 participants