Skip to content

UDP server ​

Listens on a UDP port and emits every received datagram as a UdpDatagram record. Use it to receive telemetry, syslog-style messages or device notifications sent over UDP. The component keeps the flow running.

Pins ​

PinKindTypesDescription
StartstartanyStarts the server. When unconnected, the server starts with the flow.
OutputoutputViaducta.Plugins.UdpTypes.UdpDatagramOne record per received datagram, with new metadata.

Configuration ​

FieldTypeDefaultDescription
Portinteger (1-65535)7000Required. UDP port to listen on (all local interfaces).
WorkerCountinteger (1-255)1Intended number of parallel workers for Output (see Notes).
MaxOutstandingRequestsinteger0Maximum number of received datagrams waiting for processing; 0 = unlimited. When the limit is reached, new datagrams are dropped.
ReceiveBufferSizeinteger (KB, 8-2048)64Socket receive buffer. Increase it for bursts, otherwise the OS drops datagrams.

Behaviour ​

  • The server binds Port on all interfaces, either when the flow starts (Start unconnected) or when Start is called.
  • Received datagrams are put into an internal in-memory queue and dispatched to Output one by one as UdpDatagram with IP and Port of the sender and Data (the payload bytes). Each datagram gets new metadata.
  • If Output has no connections, received datagrams are discarded.
  • When the queue holds MaxOutstandingRequests items, further datagrams are silently dropped until it drains.
  • The socket is closed and the queue cleared when the flow stops.

Notes ​

  • WorkerCount has no effect: the dispatcher calls Output synchronously from a single thread, so datagrams are always processed one at a time. To process in parallel, hand them to an asynchronous component (for example a queue) right after the server.
  • There is no reply pin; to answer a sender, use a UDP client with its address and port.
  • The MaxOutstandingRequests field validator has a minimum of 1, although 0 (unlimited) is the default and is accepted by the code.
  • Calling Start a second time tries to bind the port again and fails; trigger it only once.
  • Datagrams waiting in the queue are lost when the flow stops.

Example ​

json
{ "Port": 5140, "WorkerCount": 1, "MaxOutstandingRequests": 10000, "ReceiveBufferSize": 512 }

UDP server → (decode Data to text) → Bulk insert

Viaducta documentation