Nilesh Kumar
Nilesh Kumar

Reputation: 1

is it possible to use OSGI with spring boot microservices? Please tell me in detail

I want to use ODL framework for SDN development, in that internally OSGI framework is used to (karaf). Apart from that i want to use spring boot and spring cloud to achieve cloud services also. It is possible to use these all framework as a single unit. and how we can achieve this please tell.

Upvotes: 0

Views: 2689

Answers (2)

vorburger
vorburger

Reputation: 3928

This questions is somewhat overly broad and generic, but I'll try to answer it anyway making two assumptions:

If you want to use Spring Boot / Cloud "in-process", that is within ODL/ Karaf, then the answer to that would be that such an architecture would make little sense. Karaf (not ODL) has some Spring support as far as I know, but you'll probably have a hard time to marry that "nicely" with ODL...

The architecture of ODL is that you define YANG models and the RPCs you define in them "automagically" get exposed as HTTP REST APIs (via something called RESTCONF), and you can then consume those from other applications.

But if by your question you just mean if you can write a separate new Spring Boot / Cloud application and from that invoke OpenDaylight services via remote RESTCONF, then the answer is that this is certainly possible - and the recommended way to write integrations.

BTW: In this context, you may also be interested in https://lighty.io.

PS: You could have a look at https://github.com/vorburger/opendaylight-simple/ for some inspiration as well; but that is a POC which is not ready for consumption by you.

Upvotes: 5

StasKolodyuk
StasKolodyuk

Reputation: 4524

It's possible to use Spring Boot in OSGI container. Please, see my answer on similar question: Can Spring Boot be used with OSGi ? If not, any plans to have an OSGi Spring Boot?

Here's a link to Spring Boot + Apache Karaf demo app: https://github.com/StasKolodyuk/osgi-spring-boot-demo

Upvotes: 0

Related Questions