I want to implement atmosphere for websocket and fallback mechanisms. But in the latest version of jhipster the support of Atmosphere has been removed. There is only support for spring websockets now. What steps should I take to move from spring websockets to atmosphere?
Originally there were some troubles when integrating atmosphere to spring. That led JHipster project to drop atmosphere support. AFAIK the last issue was in spring-boot and since it's fixed Atmosphere should play nicely with Spring. Unfortunately JHipster project did not re-add Atmosphere support so you will have to integrate the framework yourself.
I think you can take a look at this application that shows how to enable Atmosphere in spring-boot. The configuration is done in Java Config here.
If you want to use DI inside your Atmosphere services you might be interested by this page.
Related
I have a server I built a few years ago which provides both REST endpoints and websocket.
It packages as a jar file (as opposed to war) with an embedded Jetty server. Rest is provided by Jersey(2.26). Jersey and JEE Websocket are each ContextHandlers configured into Jetty. The server was built on Java 8.
I want to update the server. My main goals of the update is move to Java 17 and from JEE->Jakarta.
I just found Helidon and thought it to be the perfect solution, particularly since it even has an example of a server that combines REST and websocket.
As I started working with Helidon I found to my disappointment that helidon-webserver-jersey pulls in Jersey2.35 (JEE) not Jersey3.x (Jakarta).
I know that Jersey is doing parallel development in 2.x and 3.x, but I'm still surprised that something as new as Helidon connects to 2.x not 3.x.
I'm curious what the reasoning was behind that decision and if there are plans in the near future to move to Jersey3.x
I haven't started on the websocket piece yet, but I'm guessing its JEE not Jarkata as well. Is that true?
Jersey 3.x as well as the full "jakartification" of Helidon will come with version 3.x.
3.0.0-M1 is already available: https://medium.com/helidon/helidon-3-0-0-m1-release-7dad655cd469
We have started new project on spring stack and using latest versions. But we have workflow requirement and I used activiti in past. But as I see there is no spring boot 2 support for activiti and camunda. Can anybody suggest which BPM is best that can be integrated with spring boot 2.
You will find a bunch of Spring Boot 2 starters in the Flowable github repo.
The documentation explains step-by-step how to create a BPM enabled Spring Boot application. There is also the blog post The road to Spring Boot 2.0 that the improved support for Flowable within Spring Boot as part of the Flowable 6.3.0 release.
You ask for suggestions on which BPM is best. Well, I cannot be objective since I am part of the Flowable Team, but I can say that our Spring Boot implementation is pretty neat:
All engines are supported (BPMN, CMMN, DMN), both embedded and exposing their respective REST APIs.
There is an automatic configuration of Spring Security to use the Flowable IDM engine (in case no other custom security is configured).
There is no "EE" version of the starter. Flowable provides Spring Boot 2 support 100% Open Source.
The Spring Actuator integration is quite powerful.
Did I mention Open Source? ;-)
In order to get the all engines you would need to use the flowable-spring-boot-starter(-rest) dependency. The (-rest) needs to be used if you want the Flowable REST APIs to be automatically configured.
There is also the option to run the BPMN, CMMN or DMN engines in standalone mode. For that you would need one of the following dependencies:
flowable-spring-boot-starter-process(-rest)
flowable-spring-boot-starter-cmmn(-rest)
flowable-spring-boot-starter-dmn(-rest)
So, compare for yourself, but for me, it's pretty clear and of course I am open to discussion.
The Activiti is working on Activiti Cloud fully based on Spring Boot 2 and Spring Cloud Finchley (targeting kubernetes deployments, but it can be used outside kubernetes if that is not your thing) if you are looking for a BPMN runtime for Cloud Native applications. We are working hard on releasing the first Beta1 release at the moment, and we will very welcome feedback about it. Hope this helps.
If you use the camunda-bpm-spring-boot-starter you can write self contained services running camunda process engine with spring boot 2.
What is the status of the current developments around Spring and OSGi?
It looks like things have gotten a bit quiet lately.
The latest version of the doc at (http://docs.spring.io/osgi/) is from 2009.
I see some announcements that Spring DM has become Eclipse Gemini Blueprint (http://www.eclipse.org/gemini/blueprint/documentation/migration/). But also there, the latest release is from August 2012.
Is Spring and OSGi a dead path? If so, what other options are there to make a spring application modular (e.g. allow deployment, starting, stopping & updating of a module within a running JVM)?
Thanks
I agre that spring on OSGi is a dead end. There does not seem to be any real drive in it since springsource abandoned OSGi.
There are some alternatives though. The most stable and complete one is Apache Aries at the moment. It provides blueprint support which is similar to spring xml and some extensions like jpa container managed transactions. Be aware though that aries still contains much less functionality then spring. So for example annotation support is very limited.
Alternatives to Aries blueprint are Declarative Services and pax CDI. Declarative services is very small footprint and quite stable and has great supports for the dynamics of OSGi. On the other hand it is even more limited than blueprint. So for example there is no special jpa support at all.
PAX CDI aims to provide Java EE on OSGi using Open Webbeans or Weld + some extensions like Deltaspike. Together it would provide similar comfort like Java EE 6. Unfortunately it is not completely finished so at the moment I would not yet consider it ready for production use.
Gemini Blueprint is still active, right now gemini blueprint upgraded to support R5 and M2 is available in the eclipse nexus.
I'm analyzing on using Spring framework with Play 2.1 to support DI. Apart from DI, can i also use spring's AOP interceptors, transaction, DAO and REST support with Play 2.1? I'm not sure whether it is the right approach. If not, what is the best way to handle these things with Play? Are there any inbuilt support in Play on these areas or do i need to go with separate libraries like AspectJ, Guice, Jersey etc?
Yes you can integrate Spring with the Play Framework. I did it in a project just some weeks ago. As shown in the tutorial linked by Pere Villega this can easily be achived by extending GlobalSettings. This way also works for other DI solutions like Guice (as shown here). As far as I know, there currently is no native solution for DI in Play 2.x.
Of course you can also use other features provdided by Spring, like their DAO support or transaction management (however this may require further configuration). We even used Spring Data's MongoDB support.
Just some personal note: I really like the Play Framework for building typical Java MVC webapps, but I found it quite temperamental for building an API only. So if you are also writing your web client using Play, the provided routing and templating are great and give you a head start. For a pure REST service however I ended up using JAX-RS (on Jersey), some basic Spring components and Jetty. We then wrote the web client completely in JavaScript using Backbone, Node and Airbnb's Rendr.
Play has it's own way of managing REST, transactions (depending on the JPA library used) and interceptors.
You can integrate it with Spring, see this demo in github, but I'd first think about if you really need it.
Ive been working now with the Spring Framework 3.0.5 and Spring Security 3.0.5 for several time. I know that Spring Framework uses DI and AOP. I also know that Spring Security uses DI, for example when writing custom handlers or filters. Im not sure whether Spring Security also uses AOP - so my first question is: does it?
Well, Id also like to know how Spring Security can be used for non-spring-based applications. Its written in their documentation that this is possible. Well, I wonder how - it seems like it uses DI, so how should it work in a simple java web application? I guess at least a web container which supports dependency injection is needed, correct? (Which one could that be?)
Thank you for answering :-)
[EDIT]
documentation says:
"documentation says: "Spring Security provides comprehensive security services for J2EE-based enterprise software applications. There is a particular emphasis on supporting projects built using The Spring Framework, which is the leading J2EE solution for enterprise software development. If you're not using Spring for developing enterprise applications, we warmly encourage you to take a closer look at it. Some familiarity with Spring - and in particular dependency injection principles - will help you get up to speed with Spring Security more easily.""
j2ee-based enterprise software applications......... emphasis on supporting projects using spring framework...... well this means it should be possible to work with it without Spring Framework itself!
?
AND:
Even though we use Spring to configure Spring Seurity, your application doesn't have to be Spring-based. Many people use Spring Security with web frameworks such as Struts, for example.
This is from the spring security homepage. well....
Does it use AOP ?
Yes spring-security uses AOP for its method security (you'd have to search the page to find it).
Can you use spring-security without spring ?
Generally no.
As you need to define spring beans for several spring-security elements.
But! You can use Acegi security without spring as far as I know. Which should give you close to the same functionality.
Can you secure a non-J2EE application
Definitely.
Anything that can run in a servlet container can be secured with spring-security. You just need Spring's IoC/DI.
This answer can help you on the minimal spring-security dependencies.