GH-8681: Expose send-buffer-overflow-strategy
Fixes https://github.com/spring-projects/spring-integration/issues/8681 * Expose `send-buffer-overflow-strategy` attribute for WebSocket XML configuration * GH-8681: Add send-buffer-overflow-strategy to documentation
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2019 the original author or authors.
|
||||
* Copyright 2014-2023 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.
|
||||
@@ -33,6 +33,7 @@ import org.springframework.util.xml.DomUtils;
|
||||
* the {@code <websocket:client-container/>} element.
|
||||
*
|
||||
* @author Artem Bilan
|
||||
* @author Julian Koch
|
||||
* @since 4.1
|
||||
*/
|
||||
public class ClientWebSocketContainerParser extends AbstractSingleBeanDefinitionParser {
|
||||
@@ -55,6 +56,7 @@ public class ClientWebSocketContainerParser extends AbstractSingleBeanDefinition
|
||||
|
||||
IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "send-buffer-size-limit");
|
||||
IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "send-time-limit");
|
||||
IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "send-buffer-overflow-strategy");
|
||||
IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "origin");
|
||||
IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, IntegrationNamespaceUtils.AUTO_STARTUP);
|
||||
IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, IntegrationNamespaceUtils.PHASE);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014-2019 the original author or authors.
|
||||
* Copyright 2014-2023 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.
|
||||
@@ -36,6 +36,7 @@ import org.springframework.util.xml.DomUtils;
|
||||
* the {@code <websocket:server-container/>} element.
|
||||
*
|
||||
* @author Artem Bilan
|
||||
* @author Julian Koch
|
||||
* @since 4.1
|
||||
*/
|
||||
public class ServerWebSocketContainerParser extends AbstractSingleBeanDefinitionParser {
|
||||
@@ -104,6 +105,7 @@ public class ServerWebSocketContainerParser extends AbstractSingleBeanDefinition
|
||||
IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "handshake-handler");
|
||||
IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "send-buffer-size-limit");
|
||||
IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "send-time-limit");
|
||||
IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "send-buffer-overflow-strategy");
|
||||
IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "allowed-origins");
|
||||
}
|
||||
|
||||
|
||||
@@ -94,6 +94,20 @@
|
||||
<xsd:union memberTypes="xsd:int xsd:string"/>
|
||||
</xsd:simpleType>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="send-buffer-overflow-strategy">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
The WebSocket session's outbound message buffer overflow strategy.
|
||||
|
||||
Concurrently generated outbound messages are buffered if sending is slow.
|
||||
This strategy determines the behavior when the buffer has reached the limit
|
||||
configured with <send-buffer-size-limit>.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleType>
|
||||
<xsd:union memberTypes="overflowStrategyEnumeration xsd:string"/>
|
||||
</xsd:simpleType>
|
||||
</xsd:attribute>
|
||||
<xsd:attributeGroup ref="integration:smartLifeCycleAttributeGroup"/>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
@@ -320,6 +334,20 @@
|
||||
<xsd:union memberTypes="xsd:int xsd:string"/>
|
||||
</xsd:simpleType>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="send-buffer-overflow-strategy">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
The WebSocket session's outbound message buffer overflow strategy.
|
||||
|
||||
Concurrently generated outbound messages are buffered if sending is slow.
|
||||
This strategy determines the behavior when the buffer has reached the limit
|
||||
configured with <send-buffer-size-limit>.
|
||||
</xsd:documentation>
|
||||
</xsd:annotation>
|
||||
<xsd:simpleType>
|
||||
<xsd:union memberTypes="overflowStrategyEnumeration xsd:string"/>
|
||||
</xsd:simpleType>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="allowed-origins" type="xsd:string">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation>
|
||||
@@ -505,4 +533,11 @@
|
||||
<xsd:attributeGroup ref="integration:channelAdapterAttributes"/>
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:simpleType name="overflowStrategyEnumeration">
|
||||
<xsd:restriction base="xsd:token">
|
||||
<xsd:enumeration value="TERMINATE"/>
|
||||
<xsd:enumeration value="DROP"/>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
|
||||
</xsd:schema>
|
||||
|
||||
Reference in New Issue
Block a user