You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by fm...@apache.org on 2023/01/26 15:07:00 UTC
[camel] 04/04: Restore useStreaming
This is an automated email from the ASF dual-hosted git repository.
fmariani pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 0d782a16548f467d477d5b94e7267b971a4049bf
Author: Croway <fe...@gmail.com>
AuthorDate: Thu Jan 26 11:45:19 2023 +0100
Restore useStreaming
---
.../atmosphere/websocket/WebsocketEndpointConfigurer.java | 9 ++++++---
.../atmosphere/websocket/WebsocketEndpointUriFactory.java | 2 +-
.../component/atmosphere/websocket/atmosphere-websocket.json | 2 +-
.../component/atmosphere/websocket/WebsocketConsumer.java | 3 ++-
.../component/atmosphere/websocket/WebsocketEndpoint.java | 10 +++++-----
.../component/atmosphere/websocket/WebsocketRouteTest.java | 2 +-
.../atmosphere/websocket/WebsocketRouteWithInitParamTest.java | 6 +++---
.../modules/ROOT/pages/camel-4-migration-guide.adoc | 4 ----
8 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/components/camel-atmosphere-websocket/src/generated/java/org/apache/camel/component/atmosphere/websocket/WebsocketEndpointConfigurer.java b/components/camel-atmosphere-websocket/src/generated/java/org/apache/camel/component/atmosphere/websocket/WebsocketEndpointConfigurer.java
index 870be2f87f8..d817561f479 100644
--- a/components/camel-atmosphere-websocket/src/generated/java/org/apache/camel/component/atmosphere/websocket/WebsocketEndpointConfigurer.java
+++ b/components/camel-atmosphere-websocket/src/generated/java/org/apache/camel/component/atmosphere/websocket/WebsocketEndpointConfigurer.java
@@ -27,7 +27,8 @@ public class WebsocketEndpointConfigurer extends ServletEndpointConfigurer imple
case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
case "sendtoall":
case "sendToAll": target.setSendToAll(property(camelContext, boolean.class, value)); return true;
- case "streaming": target.setStreaming(property(camelContext, boolean.class, value)); return true;
+ case "usestreaming":
+ case "useStreaming": target.setUseStreaming(property(camelContext, boolean.class, value)); return true;
default: return super.configure(camelContext, obj, name, value, ignoreCase);
}
}
@@ -41,7 +42,8 @@ public class WebsocketEndpointConfigurer extends ServletEndpointConfigurer imple
case "lazyStartProducer": return boolean.class;
case "sendtoall":
case "sendToAll": return boolean.class;
- case "streaming": return boolean.class;
+ case "usestreaming":
+ case "useStreaming": return boolean.class;
default: return super.getOptionType(name, ignoreCase);
}
}
@@ -56,7 +58,8 @@ public class WebsocketEndpointConfigurer extends ServletEndpointConfigurer imple
case "lazyStartProducer": return target.isLazyStartProducer();
case "sendtoall":
case "sendToAll": return target.isSendToAll();
- case "streaming": return target.isStreaming();
+ case "usestreaming":
+ case "useStreaming": return target.isUseStreaming();
default: return super.getOptionValue(obj, name, ignoreCase);
}
}
diff --git a/components/camel-atmosphere-websocket/src/generated/java/org/apache/camel/component/atmosphere/websocket/WebsocketEndpointUriFactory.java b/components/camel-atmosphere-websocket/src/generated/java/org/apache/camel/component/atmosphere/websocket/WebsocketEndpointUriFactory.java
index 4a810dbd2f1..70656c71cf5 100644
--- a/components/camel-atmosphere-websocket/src/generated/java/org/apache/camel/component/atmosphere/websocket/WebsocketEndpointUriFactory.java
+++ b/components/camel-atmosphere-websocket/src/generated/java/org/apache/camel/component/atmosphere/websocket/WebsocketEndpointUriFactory.java
@@ -46,9 +46,9 @@ public class WebsocketEndpointUriFactory extends org.apache.camel.support.compon
props.add("sendToAll");
props.add("servicePath");
props.add("servletName");
- props.add("streaming");
props.add("traceEnabled");
props.add("transferException");
+ props.add("useStreaming");
PROPERTY_NAMES = Collections.unmodifiableSet(props);
SECRET_PROPERTY_NAMES = Collections.emptySet();
MULTI_VALUE_PREFIXES = Collections.emptySet();
diff --git a/components/camel-atmosphere-websocket/src/generated/resources/org/apache/camel/component/atmosphere/websocket/atmosphere-websocket.json b/components/camel-atmosphere-websocket/src/generated/resources/org/apache/camel/component/atmosphere/websocket/atmosphere-websocket.json
index 3ecdc2691be..66c0abc87a1 100644
--- a/components/camel-atmosphere-websocket/src/generated/resources/org/apache/camel/component/atmosphere/websocket/atmosphere-websocket.json
+++ b/components/camel-atmosphere-websocket/src/generated/resources/org/apache/camel/component/atmosphere/websocket/atmosphere-websocket.json
@@ -47,8 +47,8 @@
"chunked": { "kind": "parameter", "displayName": "Chunked", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "If this option is false the Servlet will disable the HTTP streaming and set the content-length header on the response" },
"disableStreamCache": { "kind": "parameter", "displayName": "Disable Stream Cache", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Determines whether or not the raw input stream from Servlet is cached or not (Camel will read the stream into a in memory\/overflow to file, Stream caching) cache. By default Camel will cache the Servlet inpu [...]
"sendToAll": { "kind": "parameter", "displayName": "Send To All", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether to send to all (broadcast) or send to a single receiver." },
- "streaming": { "kind": "parameter", "displayName": "Streaming", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "To enable streaming to send data as multiple text fragments." },
"transferException": { "kind": "parameter", "displayName": "Transfer Exception", "group": "common", "label": "common", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If enabled and an Exchange failed processing on the consumer side, and if the caused Exception was send back serialized in the response as a application\/x-java-serialized-object content type. On the producer si [...]
+ "useStreaming": { "kind": "parameter", "displayName": "Use Streaming", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "To enable streaming to send data as multiple text fragments." },
"headerFilterStrategy": { "kind": "parameter", "displayName": "Header Filter Strategy", "group": "common (advanced)", "label": "common,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.HeaderFilterStrategy", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom HeaderFilterStrategy to filter header to and from Camel message." },
"httpBinding": { "kind": "parameter", "displayName": "Http Binding", "group": "common (advanced)", "label": "common,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.http.common.HttpBinding", "deprecated": false, "autowired": false, "secret": false, "description": "To use a custom HttpBinding to control the mapping between Camel message and HttpClient." },
"async": { "kind": "parameter", "displayName": "Async", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Configure the consumer to work in async mode" },
diff --git a/components/camel-atmosphere-websocket/src/main/java/org/apache/camel/component/atmosphere/websocket/WebsocketConsumer.java b/components/camel-atmosphere-websocket/src/main/java/org/apache/camel/component/atmosphere/websocket/WebsocketConsumer.java
index 4115c9efa56..5fbfb09a551 100644
--- a/components/camel-atmosphere-websocket/src/main/java/org/apache/camel/component/atmosphere/websocket/WebsocketConsumer.java
+++ b/components/camel-atmosphere-websocket/src/main/java/org/apache/camel/component/atmosphere/websocket/WebsocketConsumer.java
@@ -59,10 +59,11 @@ public class WebsocketConsumer extends ServletConsumer {
initializer.configureFramework(config, false, false, AtmosphereFramework.class);
this.framework = initializer.framework();
this.framework.setUseNativeImplementation(false);
+ this.framework.addInitParameter(ApplicationConfig.JSR356_MAPPING_PATH, this.getEndpoint().getHttpUri().getPath());
this.framework.addInitParameter(ApplicationConfig.ANALYTICS, "false");
this.framework.addInitParameter(ApplicationConfig.WEBSOCKET_SUPPORT, "true");
this.framework.addInitParameter(ApplicationConfig.WEBSOCKET_PROTOCOL,
- getEndpoint().isStreaming() ? WebsocketStreamHandler.class.getName() : WebsocketHandler.class.getName());
+ getEndpoint().isUseStreaming() ? WebsocketStreamHandler.class.getName() : WebsocketHandler.class.getName());
this.framework.init(config);
WebSocketProtocol wsp = this.framework.getWebSocketProtocol();
diff --git a/components/camel-atmosphere-websocket/src/main/java/org/apache/camel/component/atmosphere/websocket/WebsocketEndpoint.java b/components/camel-atmosphere-websocket/src/main/java/org/apache/camel/component/atmosphere/websocket/WebsocketEndpoint.java
index afc64c3e57e..2ec631602ef 100644
--- a/components/camel-atmosphere-websocket/src/main/java/org/apache/camel/component/atmosphere/websocket/WebsocketEndpoint.java
+++ b/components/camel-atmosphere-websocket/src/main/java/org/apache/camel/component/atmosphere/websocket/WebsocketEndpoint.java
@@ -51,7 +51,7 @@ public class WebsocketEndpoint extends ServletEndpoint {
@UriParam
private boolean sendToAll;
@UriParam
- private boolean streaming;
+ private boolean useStreaming;
public WebsocketEndpoint(String endPointURI, WebsocketComponent component, URI httpUri) throws URISyntaxException {
super(endPointURI, component, httpUri);
@@ -86,15 +86,15 @@ public class WebsocketEndpoint extends ServletEndpoint {
this.sendToAll = sendToAll;
}
- public boolean isStreaming() {
- return streaming;
+ public boolean isUseStreaming() {
+ return useStreaming;
}
/**
* To enable streaming to send data as multiple text fragments.
*/
- public void setStreaming(boolean streaming) {
- this.streaming = streaming;
+ public void setUseStreaming(boolean useStreaming) {
+ this.useStreaming = useStreaming;
}
WebSocketStore getWebSocketStore() {
diff --git a/components/camel-atmosphere-websocket/src/test/java/org/apache/camel/component/atmosphere/websocket/WebsocketRouteTest.java b/components/camel-atmosphere-websocket/src/test/java/org/apache/camel/component/atmosphere/websocket/WebsocketRouteTest.java
index 2ad0f94eb43..6c1b4366ba3 100644
--- a/components/camel-atmosphere-websocket/src/test/java/org/apache/camel/component/atmosphere/websocket/WebsocketRouteTest.java
+++ b/components/camel-atmosphere-websocket/src/test/java/org/apache/camel/component/atmosphere/websocket/WebsocketRouteTest.java
@@ -149,7 +149,7 @@ public class WebsocketRouteTest extends WebsocketCamelRouterTestSupport {
}).to("atmosphere-websocket:///broadcast?sendToAll=true");
// route for a single stream line
- from("atmosphere-websocket:///hola3?streaming=true").to("log:info").process(new Processor() {
+ from("atmosphere-websocket:///hola3?useStreaming=true").to("log:info").process(new Processor() {
public void process(final Exchange exchange) {
createResponse(exchange, true);
}
diff --git a/components/camel-atmosphere-websocket/src/test/java/org/apache/camel/component/atmosphere/websocket/WebsocketRouteWithInitParamTest.java b/components/camel-atmosphere-websocket/src/test/java/org/apache/camel/component/atmosphere/websocket/WebsocketRouteWithInitParamTest.java
index 4d4467ce1bd..aaf6ae26ea0 100644
--- a/components/camel-atmosphere-websocket/src/test/java/org/apache/camel/component/atmosphere/websocket/WebsocketRouteWithInitParamTest.java
+++ b/components/camel-atmosphere-websocket/src/test/java/org/apache/camel/component/atmosphere/websocket/WebsocketRouteWithInitParamTest.java
@@ -115,13 +115,13 @@ public class WebsocketRouteWithInitParamTest extends WebsocketCamelRouterWithIni
WebsocketTestClient wsclient3 = new WebsocketTestClient("ws://localhost:" + PORT + "/guarantee", 2);
wsclient1.connect();
- wsclient1.await(1);
+ wsclient1.await(awaitTime);
wsclient2.connect();
- wsclient2.await(1);
+ wsclient2.await(awaitTime);
wsclient3.connect();
- wsclient3.await(1);
+ wsclient3.await(awaitTime);
//all connections were registered in external store
assertEquals(EXISTED_USERS.length, connectionKeyUserMap.size());
diff --git a/docs/user-manual/modules/ROOT/pages/camel-4-migration-guide.adoc b/docs/user-manual/modules/ROOT/pages/camel-4-migration-guide.adoc
index 9aced6d8c00..4853f5615db 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-4-migration-guide.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-4-migration-guide.adoc
@@ -59,7 +59,3 @@ All the `camel-test` modules that were JUnit 4.x based has been removed. All tes
=== camel-caffeine
The `keyType` parameter has been removed. The Key for the cache will now be only `String` type. More information in CAMEL-18877.
-
-=== camel-atmosphere-websocket
-
-The `useStreaming` parameter was renamed to `streaming`. More information in CAMEL-18978.