Skip to main content

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

Hi Carsten,

Imho both approaches described by you are reasonable. We had originally separated the application from the server module in order to have a server module that does not depend on Spring Boot. FMPOV trying to move common code into the server module makes sense as long as we do not introduce a Spring Boot dependency. Would that work for you?

Kai


Lohmann Carsten (INST/ECS4) <Carsten.Lohmann@xxxxxxxxxxxx> schrieb am Mi., 8. März 2017, 09:10:
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
_______________________________________________
hono-dev mailing list
hono-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/hono-dev

Back to the top