Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[hono-dev] Extending the Hono server application

Hi,

we want to extend the Hono server application and use our own device registry implementation. 
The code for it should be managed outside of our Hono fork (ie. separate repo/maven module).

Doing this didn't look so straightforward, therefore I want to discuss here possible approaches and changes in Hono to support this.

What we did:
We have created a maven module with our own springboot application with "Application" and "ApplicationConfig" classes (mostly identical to the hono equivalents).
There we can set the ComponentScan to also include our own packages (for an annotation-based configuration - our device-registry implementation class having @Service and @Primary) or, as an alternative with a java-based configuration, we can explicitly use our own device registry in the "ApplicationConfig" class.

So, this approach looks quite flexible. 
And we end up with one springboot fat jar, containing all dependencies, making it easy to deploy the application.

But the problem is, that the Hono "Application" class contains quite a lot of code that we have to duplicate.
In that sense, it would be better to have a minimal "Application" class in Hono and all the initialization logic moved to the hono-server module.

Another approach we considered was using the original hono-application jar and starting the application with additional jars for our device registry implementation.
But having one springboot jar with everything inside looks a lot more convenient.

Any thoughts on this?

--
Best regards

Carsten Lohmann

Bosch Software Innovations GmbH
Schöneberger Ufer 89-91
10785 Berlin
GERMANY
www.bosch-si.com

Registered office: Berlin, Register court: Amtsgericht Charlottenburg, HRB 148411 B
Executives: Dr.-Ing. Rainer Kallenbach, Michael Hahn


Back to the top