OSGi to SpringBoot - osgi

Currently we use OSGi framework for modular application development. But we are now planning to migrate it to springboot . Any relevant articles / tutorials / success stories on this ?
Any help would be greatly appreciated
Thanks
Niyas

I don`t think the is a simple migration path. Moving to spring boot will require changes all over the place in your application.
If you are looking into scaling in the form of microservices then this can also be done in OSGi. The enroute microservice tutorial shows how to leverage JAX-RS for REST communication and how to package your microservice into a runnable jar. This can then be easily deployed to kubernetes. See here for the code.

Related

Wicket-Springboot Implementation

I have an application developed in the Wicket-Spring framework. I want to implement Dynamic Database routing using the AbstractRoutingDataSource API of Spring framework. I have developed small wrapper application in Sprinbgoot using AbstractRoutingDataSource which is working fine.
Now, my requirement is that I have to Integrate that Springboot solution in the existing Applicaiton 'Wicket-Spring'. After searching for Springboot support for Wicket. I got this link:https://dzone.com/articles/enhance-wicket-with-spring-boot. But, I am still not able to integrate my Solution developed in Springboot to the Wicket-Spring application.
Thanks in advance. Highly appreciate any guidance and direction on it.
You may want to check out https://github.com/MarcGiffing/wicket-spring-boot project.
You may use it to create a new application or as an inspiration how to glue Spring-Boot with Apache Wicket.

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.
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.
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

Spring Boot vs Spring MVC (In depth)

I've got the basic idea of, what both of them are and when they can be used. I've already referred to this question as well. As of now what I understood was:
Spring Boot bundles a war file with server runtime like Tomcat. This allows easy distribution and deployment of web applications. As the industry is moving towards container based deployments, Spring Boot is useful in this context.
Spring MVC is a traditional web application framework that helps you to build web applications.
What I wanted to know is that, what can be the best practice when it comes to web applications and the differences of using either one of them in depth. Any help would be appreciated.

Sample OSGI project for RESTful web service using spring-3

I need a sample project of OSGI which creates RESTful Web service using spring framework and JPA persistence project.
I have tried creating project with these but i guess i am doing something wrong.. i tried a lot to find the solutions to those exceptions but failed..
You can use OSGi RemoteServices with Apache CXF DOSGi. You can check very nice blog article with JPA/JAX-RS/DOSGi.

App Servers or Web Server for Spring Framework

first of all: that might be a newbie question. However after few searches I cannot find anything that would bring me further.
Basically what would be the reasons to choose an app server over a Spring framework to develop a medium complex web application? I am fairly new to Spring, did some hard core WebSphere for few years. While reading about Spring I see that it comes with a good bunch of features (transactions, persistence, messaging, connectors etc). Is Spring hard to scale or manage in a clustered environment?
Any comments welcome.
Thanks
Spring is awesome.
Your terminology is way off though. Spring is a Framework. It's a library that you use to write a web application.
An app Server is what your application runs in. You need both. For example, use the Spring Framework to create an app that runs in the Tomcat app server.
EAR files aren't a requirement for doing Java EE development.
It's not either/or: if you deploy a Java EE application you need a container of some kind.
I've deployed Spring apps on Tomcat and WebLogic. I think WebLogic is the best Java EE app server on the market. My decision about whether to deploy to it or not would be based strictly on availability.
You've seen that Spring has their own Java EE container now. It forks Tomcat and marries it with OSGi and Spring. I haven't tried it yet, but if the quality is similar to their framework it will be very promising indeed.
Are you really asking "When would I write an application using Spring? When should I choose EJB3?"
My preference these days is Spring. I can do persistence, transactions, messaging, web services, and everything else I need.
Bpapa,
you got me there, yes the terminology is wrong. I meant Spring + web container vs. App Servers. Surely the web app has to be deployed somewhere. I guess that shifts the question to the server side features as per my first post.
Topology example: Spring + Tomcat vs. WebSphere.
As a side note: people argue if Tomcat is an app server, many consider it rather a web container. You could not deploy an EAR file to Tomcat, can you? All it takes is a WAR, am I right? But that gets too academic.
Thanks a lot
Rod Johnson's "Expert 1:1 Java EE Development Without EJBs" is the basis for Spring. It's an excellent book, but I'd say it's a bit out of date now. The book was written with EJB2 in mind. It was published before Spring became an open source project. The framework is up to version 3.0 now, so I'd say that the book is of historical interest only. I'd recommend a more modern take on the question that takes Spring 3.0 and EJB3 into account.
%

Resources