WebSocket
Publishes processed events to web clients via WebSocket transport, ideal for real-time dashboards and applications
Overview
Examples & DSL attributes
websocketPublisher:
topic: quotesExample client
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>WebSocket Client</title>
</head>
<body>
<button onclick="contactServer">Start Streaming</button>
</body>
<script>
const socket = new WebSocket('ws://localhost:7070/joule/ws/stream/quotes');
socket.addEventListener('open', function (event) {
socket.send('Connection Established');
});
socket.addEventListener('message', function (event) {
console.log(event.data);
});
const contactServer = () => {
socket.send("Initialize");
}
</script>
</html>Attributes schema
Attribute
Description
Data Type
Required
Last updated