mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-10-02 15:29:05 +00:00
Create spring-boot-websocket module
Closes gh-46144
This commit is contained in:
@@ -161,6 +161,7 @@ include "spring-boot-project:spring-boot-validation"
|
||||
include "spring-boot-project:spring-boot-webflux"
|
||||
include "spring-boot-project:spring-boot-webmvc"
|
||||
include "spring-boot-project:spring-boot-webservices"
|
||||
include "spring-boot-project:spring-boot-websocket"
|
||||
include "spring-boot-system-tests:spring-boot-deployment-tests"
|
||||
include "spring-boot-system-tests:spring-boot-image-tests"
|
||||
include "spring-boot-tests:spring-boot-integration-tests:spring-boot-configuration-processor-tests"
|
||||
|
||||
-1
@@ -9,4 +9,3 @@ org.springframework.boot.autoconfigure.web.reactive.function.client.ClientHttpCo
|
||||
org.springframework.boot.autoconfigure.web.reactive.function.client.WebClientAutoConfiguration
|
||||
org.springframework.boot.autoconfigure.web.servlet.HttpEncodingAutoConfiguration
|
||||
org.springframework.boot.autoconfigure.web.servlet.MultipartAutoConfiguration
|
||||
org.springframework.boot.autoconfigure.websocket.servlet.WebSocketMessagingAutoConfiguration
|
||||
|
||||
@@ -2126,7 +2126,8 @@ bom {
|
||||
"spring-boot-validation",
|
||||
"spring-boot-webflux",
|
||||
"spring-boot-webmvc",
|
||||
"spring-boot-webservices"
|
||||
"spring-boot-webservices",
|
||||
"spring-boot-websocket"
|
||||
]
|
||||
plugins = [
|
||||
"spring-boot-maven-plugin"
|
||||
|
||||
@@ -151,6 +151,7 @@ dependencies {
|
||||
autoConfiguration(project(path: ":spring-boot-project:spring-boot-webflux", configuration: "autoConfigurationMetadata"))
|
||||
autoConfiguration(project(path: ":spring-boot-project:spring-boot-webmvc", configuration: "autoConfigurationMetadata"))
|
||||
autoConfiguration(project(path: ":spring-boot-project:spring-boot-webservices", configuration: "autoConfigurationMetadata"))
|
||||
autoConfiguration(project(path: ":spring-boot-project:spring-boot-websocket", configuration: "autoConfigurationMetadata"))
|
||||
|
||||
configurationProperties(project(path: ":spring-boot-project:spring-boot", configuration: "configurationPropertiesMetadata"))
|
||||
configurationProperties(project(path: ":spring-boot-project:spring-boot-activemq", configuration: "configurationPropertiesMetadata"))
|
||||
|
||||
@@ -22,6 +22,5 @@ description = "Starter for building WebSocket applications using Spring Framewor
|
||||
|
||||
dependencies {
|
||||
api(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-web"))
|
||||
api("org.springframework:spring-messaging")
|
||||
api("org.springframework:spring-websocket")
|
||||
api(project(":spring-boot-project:spring-boot-websocket"))
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright 2012-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License);
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
plugins {
|
||||
id "java-library"
|
||||
id "org.springframework.boot.auto-configuration"
|
||||
id "org.springframework.boot.deployed"
|
||||
id "org.springframework.boot.optional-dependencies"
|
||||
}
|
||||
|
||||
description = "Spring Boot WebSocket"
|
||||
|
||||
dependencies {
|
||||
api(project(":spring-boot-project:spring-boot"))
|
||||
api("org.springframework:spring-messaging")
|
||||
api("org.springframework:spring-websocket")
|
||||
|
||||
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
|
||||
optional(project(":spring-boot-project:spring-boot-jackson"))
|
||||
|
||||
testImplementation(project(":spring-boot-project:spring-boot-test"))
|
||||
testImplementation(project(":spring-boot-project:spring-boot-tomcat"))
|
||||
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
|
||||
testImplementation(project(":spring-boot-project:spring-boot-webmvc"))
|
||||
testImplementation("org.apache.tomcat.embed:tomcat-embed-websocket")
|
||||
|
||||
testRuntimeOnly("ch.qos.logback:logback-classic")
|
||||
}
|
||||
+2
-2
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.autoconfigure.websocket.servlet;
|
||||
package org.springframework.boot.websocket.autoconfigure.servlet;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -49,7 +49,7 @@ import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerCo
|
||||
* @author Andy Wilkinson
|
||||
* @author Lasse Wulff
|
||||
* @author Moritz Halbritter
|
||||
* @since 1.3.0
|
||||
* @since 4.0.0
|
||||
*/
|
||||
@AutoConfiguration(afterName = "org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration")
|
||||
@ConditionalOnWebApplication(type = Type.SERVLET)
|
||||
+1
-1
@@ -17,4 +17,4 @@
|
||||
/**
|
||||
* Auto-configuration for WebSocket support in servlet web servers.
|
||||
*/
|
||||
package org.springframework.boot.autoconfigure.websocket.servlet;
|
||||
package org.springframework.boot.websocket.autoconfigure.servlet;
|
||||
+1
@@ -0,0 +1 @@
|
||||
org.springframework.boot.websocket.autoconfigure.servlet.WebSocketMessagingAutoConfiguration
|
||||
+3
-3
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.autoconfigure.websocket.servlet;
|
||||
package org.springframework.boot.websocket.autoconfigure.servlet;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
@@ -38,7 +38,6 @@ import org.skyscreamer.jsonassert.JSONAssert;
|
||||
import org.springframework.boot.LazyInitializationBeanFactoryPostProcessor;
|
||||
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.websocket.servlet.WebSocketMessagingAutoConfiguration.WebSocketMessageConverterConfiguration;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration;
|
||||
import org.springframework.boot.test.util.TestPropertyValues;
|
||||
@@ -47,6 +46,7 @@ import org.springframework.boot.tomcat.autoconfigure.servlet.TomcatServletWebSer
|
||||
import org.springframework.boot.tomcat.servlet.TomcatServletWebServerFactory;
|
||||
import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext;
|
||||
import org.springframework.boot.webmvc.autoconfigure.DispatcherServletAutoConfiguration;
|
||||
import org.springframework.boot.websocket.autoconfigure.servlet.WebSocketMessagingAutoConfiguration.WebSocketMessageConverterConfiguration;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.Ordered;
|
||||
@@ -146,7 +146,7 @@ class WebSocketMessagingAutoConfigurationTests {
|
||||
void predefinedThreadExecutorIsSelectedForInboundChannel() {
|
||||
AsyncTaskExecutor expectedExecutor = new SimpleAsyncTaskExecutor();
|
||||
ChannelRegistration registration = new ChannelRegistration();
|
||||
WebSocketMessagingAutoConfiguration.WebSocketMessageConverterConfiguration configuration = new WebSocketMessagingAutoConfiguration.WebSocketMessageConverterConfiguration(
|
||||
WebSocketMessageConverterConfiguration configuration = new WebSocketMessagingAutoConfiguration.WebSocketMessageConverterConfiguration(
|
||||
new ObjectMapper(),
|
||||
Map.of(TaskExecutionAutoConfiguration.APPLICATION_TASK_EXECUTOR_BEAN_NAME, expectedExecutor));
|
||||
configuration.configureClientInboundChannel(registration);
|
||||
Reference in New Issue
Block a user