Spring Boot App with WebSockets and without WebContainer - spring-boot

I am supposed to make an application with Spring Boot and WebSockets. But I should not use Jetty, JavaEE or Tomcat (or any other webcontainer servlet stuff). Is that even possible using "plain spring boot"???? Every example I am finding uses some kind of WebContainer. How would Spring Boot work without that to manage Http Connections and WebSocket communication?

I didnt find any working example with websockets and without a servlet. So it seems mandatory.

Related

Port Unification in spring boot Application

I have a http rest server written using spring boot application. I want to use port unification(http and https request), Something similar to one provided by jetty.
https://www.eclipse.org/jetty/documentation/jetty-10/programming-guide/index.html#pg-server-io-arch-connection-factory-detecting
Is it possible to do something similar in spring boot application?
My application is similar to one in the spring tutorial here. https://spring.io/guides/tutorials/rest/

Spring Reactive WebSocket does not come up when spring-web is present

I have an existing spring web application that uses spring-boot-starter-web; I have been planning to introduce reactive into this application. For a new feature that I am working, I have pulled in spring reactive web socket, configured and coded as specified in the spring doc; but unfortunately it does not work (got 404).
I tried a sample application and that works perfectly.
I used this one as my sample application.
I found that the sample application comes up on Netty, not on Tomcat. So I added spring-boot-starter-web to it, got the server to start in Tomcat and got the same 404 as I got in my application.
I also added TomcatRequestUpgradeStrategy unsuccessfully.
should I assume that spring-web and spring-webflux conflict with each other and I should go back to the regular websocket? Please advise.
Spring said that if both spring web and spring webflux present in the classpath; spring web kicks in and reactive websocket won't come up.
More details here: https://github.com/spring-projects/spring-boot/issues/23236

Control migration of a spring jersey app to webflux through a feature flag

We are thinking of how to migrate spring jersey app to webflux gradually, by converting jersey services to webflux controllers, and converting jersey filters to webfilters one by one, controlled by a feature flag. Since webflux can run on modern servlet containers, I am thinking of mapping the original path to a servlet that just does the forwarding based on the value of the feature flag. However, as I understand, spring boot does not allow webflux to co-exist with spring MVC/Jersey. What's a best way to migrate existing app to webflux?

How to configure TLS for Netty in a Spring Boot app?

My microservices are using the latest releases of Spring Boot, Spring WebFlux (Undertow), Spring Data MongoDB, Spring Cloud Netflix, and Kotlin...
Now I've setup a demo project to use the new functional interface instead of the annotations in Spring WebFlux. Using Netty with HTTP works fine. However, I cannot find any information how to configure Netty with TLS resp. HTTPS. Any hint is appreciated!
At the time of writing, configuration of TLS with Netty hasn't been implemented. The work is being tracked by this issue.

With Spring do you still need a java application server and when?

looks to me you need tomcat or some other servlet engine for the web part.
what about data access part using hibernate and jms? Thanks.
No, you don't need an application server, you can see Spring as a proprietary, modular application server implementation / adapter. But you still need an a servlet container.
Data access part: you can use hibernate and some standalone connection pool
jms: Spring is not a JMS provider, but it nicely integrates POJOs with any JMS provider
Spring also has comprehensive transactions support
Finally you have jmx and aop support built-in and easy integration with bean validation, jpa, web services, rmi, jci, task scheduling, caching...
As you can see you can either use certified application server and Java EE stack or built on top of Tomcat and pick Spring modules you need. Sometimes Spring uses standard Java EE APIs (like JPA), more often it builts its own.

Resources