jvermillard / leshan

OMA Lightweight M2M java implementation - LWM2M
40 stars 25 forks source link

Implemented OSGi support for leshan server #39

Closed ingoschaal closed 9 years ago

ingoschaal commented 9 years ago

Kai Hudalla, Ingo Schaal, Alexander Ellwein from Bosch Software Innovations implemented OSGi support for the leshan lwm2m Server.

The leshan-osgi module provides an OSGi-fied implementation of the ClientRegistry called OsgiBasedClientRegistry, which can be used inside an OSGi container as a OSGi service. The LWM2M clients are registered with this registry and can be controlled over it. There are also some integration tests based on Pax Exam test framework for testing the basic functionality.

jvermillard commented 9 years ago

Thanks for the PR, I hope you are not in a hurry because we started to merge the shim PR and it's probably going to take some time.

I'm not that fluent in OSGi, but I have a question: it's not a scalability/performance issue to bring a service each time a client connect? If 10000 clients connect your OSGi container won't explode under the pressure?

sophokles73 commented 9 years ago

Julien, you raised a valid concern and we have thought about this a lot as well. In our current setup we intend to use leshan on a gateway close to the devices. On this gateway we will probably only manage several hundred devices only, thus this should not be a problem. However, when we start to deploy leshan in our back end in the cloud and we want to manage millions of devices, this may very well become a problem. We are therefore already discussing an alternative approach that does not involve registration of LWM2M clients as services within the OSGi service registry. This way we would also reduce the amount of state kept in the container which would also make it easier to set up clusters providing fail over. We definitely see this as something to implement as well. Both approaches have their pros and cons and I think we should provide support for both and leave the decision, which one to use, to the user of leshan. Does this make sense to you?

jvermillard commented 9 years ago

@sophokles73 it's fine for me, until you maintain the code :)

Anyway I'm trying to rebase on current master (some conflict) and I seen you introduced logback, can you please remove it? we already use log4j2, I don't want to deal with two logging framework

jvermillard commented 9 years ago

since we broke it again re-factoring the code, I wonder if it would make sense to have the OSGi integration in a different repo and following the release version and not the current snashot version?

ingoschaal commented 9 years ago

@jvermillard thanks for the note. of course i will remove the logback, so that we only use log4j.

ingoschaal commented 9 years ago

@jvermillard I agree with the proposal to move to the OSGi integration in a different repo. I will close this pull request. Regarding the log4j2 comment, it is not possible to use as log4j2 implementation, since this is incompatible with the pax Framework. I tried to configure it does not work, sorry. But it is no problem to use the implementation of the pax-logging Framework because the scope is only "test" Thus, no other logging - framework is delivered and we do not deal with multiple frameworks.