Websocket Source
Provided by: "Apache Software Foundation"
Support Level for this Kamelet is: "Preview"
Websocket endpoints for communicating with clients
Configuration Options
The following table summarizes the configuration options available for the websocket-source
Kamelet:
Property | Name | Description | Type | Default | Example |
---|---|---|---|---|---|
Resource Uri |
Required Name of the websocket channel to use. |
string |
|||
Allowed Origins |
The CORS allowed origins. Use to allow all. |
string |
|||
Bridge Rrror Handler |
Allows for bridging the consumer to the Camel routing Error Handler. |
bool |
false |
||
Buffer Size |
Set the buffer size of the websocketServlet. |
integer |
8192 |
||
Cross Origin Filter |
Whether to enable CORS. |
bool |
false |
||
Filter Path |
Enable JMX support. |
bool |
false |
||
Filter Path |
Context path for filtering CORS. |
string |
|||
Lazy Start Producer |
Whether the producer should be started lazy (on the first message). |
bool |
false |
||
Max Binary Message Size |
Can be used to set the size in bytes that the websocket created by the websocketServlet may be accept before closing. (Default is -1 - or unlimited). |
integer |
-1 |
||
Max Idle Time |
SetSet the time in ms that the websocket created by the websocketServlet may be idle before closing. |
integer |
300000 |
||
Send Timeout |
Timeout in millis when sending to a websocket channel. The default timeout is 30000 (30 seconds). |
integer |
30000 |
||
Session Support |
Whether to enable session support which enables HttpSession for each http request. |
bool |
false |
||
Subprotocol |
Comma-separated list of subprotocols that are supported by the application. |
string |
any |
||
Host |
The hostname. |
string |
0.0.0.0 |
||
Port |
The port number. |
integer |
9292 |
Dependencies
At runtime, the websocket-source
Kamelet relies upon the presence of the following dependencies:
-
camel:kamelet
-
camel:core
-
camel:websocket
Usage
This section describes how you can use the websocket-source
.
Knative source
You can use the websocket-source
Kamelet as a Knative source by binding it to a Knative object.
apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
metadata:
name: websocket-source-binding
spec:
source:
ref:
kind: Kamelet
apiVersion: camel.apache.org/v1alpha1
name: websocket-source
properties:
resourceUri: The Resource Uri
sink:
ref:
kind: Channel
apiVersion: messaging.knative.dev/v1
name: mychannel
Prerequisite
You have Camel K installed on the cluster.
Kafka source
You can use the websocket-source
Kamelet as a Kafka source by binding it to a Kafka topic.
apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
metadata:
name: websocket-source-binding
spec:
source:
ref:
kind: Kamelet
apiVersion: camel.apache.org/v1alpha1
name: websocket-source
properties:
resourceUri: The Resource Uri
sink:
ref:
kind: KafkaTopic
apiVersion: kafka.strimzi.io/v1beta1
name: my-topic
Prerequisites
-
You’ve installed Strimzi.
-
You’ve created a topic named
my-topic
in the current namespace. -
You have Camel K installed on the cluster.