riemann.transport.tcp

Accepts messages from external sources. Associated with a core. Sends incoming events to the core’s streams, queries the core’s index for states.

epoll-netty-implementation

(epoll-netty-implementation)

gen-tcp-handler

(gen-tcp-handler core stats channel-group handler)

Wraps Netty boilerplate for common TCP server handlers. Given a reference to a core, a stats package, a channel group, and a handler fn, returns a ChannelInboundHandlerAdapter which calls (handler core stats channel-handler-context message) for each received message.

Automatically handles channel closure, and handles exceptions thrown by the handler by logging an error and closing the channel.

initializer

(initializer core stats channel-group ssl-context)

A channel pipeline initializer for a TCP server.

int32-frame-decoder

(int32-frame-decoder)

int32-frame-encoder

(int32-frame-encoder)

kqueue-netty-implementation

(kqueue-netty-implementation)

netty-implementation

nio-netty-implementation

(nio-netty-implementation)

ssl-handler

(ssl-handler context)

Given an SSLContext, creates a new SSLEngine and a corresponding Netty SslHandler wrapping it.

tcp-handler

(tcp-handler core stats ctx message)

Given a core, a channel, and a message, applies the message to core and writes a response back on this channel.

tcp-server

(tcp-server)(tcp-server opts)

Create a new TCP server. Doesn’t start until (service/start!).

Options:

  • :host The host to listen on (default 127.0.0.1).
  • :port The port to listen on. (default 5554 with TLS, or 5555 std)
  • :core An atom used to track the active core for this server.
  • :so-backlog The maximum queue length for incoming tcp connections (default 50).
  • :channel-group A global channel group used to track all connections.
  • :initializer A ChannelInitializer for creating new pipelines.

TLS options:

  • :tls? Whether to enable TLS
  • :key A PKCS8-encoded private key file
  • :cert The corresponding public certificate
  • :ca-cert The certificate of the CA which signed this key