Proxy

This consumer reads messages from a given socket like consumer.Socket but allows reverse communication, too. Producers which require this kind of communication can access message.GetSource to write data back to the client sending the message. See producer.Proxy as an example target producer.

Parameters

Enable (default: true)

Switches this plugin on or off.

Address

Defines the protocol, host and port or the unix domain socket to listen to. This can either be any ip address and port like “localhost:5880” or a file like “unix:///var/gollum.socket”. Only unix and tcp protocols are supported. By default this parameter is set to “:5880”.

Partitioner

Defines the algorithm used to read messages from the router. The messages will be sent as a whole, no cropping or removal will take place. By default this parameter is set to “delimiter”.

delimiter

Separates messages by looking for a delimiter string. The delimiter is removed from the message.

ascii

Reads an ASCII number at a given offset until a given delimiter is found. Everything to the left of and including the delimiter is removed from the message.

binary

reads a binary number at a given offset and size. The number is removed from the message.

binary_le

is an alias for “binary”.

binary_be

acts like “binary”_le but uses big endian encoding.

fixed

assumes fixed size messages.

Delimiter (default: n)

Defines the delimiter string used to separate messages if partitioner is set to “delimiter” or the string used to separate the message length if partitioner is set to “ascii”. By default this parameter is set to “n”.

Offset (default: 0)

Defines an offset in bytes used to read the length provided for partitioner “binary” and “ascii”. By default this parameter is set to 0.

Size (default: 4)

Defines the size of the length prefix used by partitioner “binary” or the message total size when using partitioner “fixed”. When using partitioner “binary” this parameter can be set to 1,2,4 or 8 when using uint8,uint16,uint32 or uint64 length prefixes. By default this parameter is set to 4.

Parameters (from core.SimpleConsumer)

Streams

Defines a list of streams a consumer will send to. This parameter is mandatory. When using “*” messages will be sent only to the internal “*” stream. It will NOT send messages to all streams. By default this parameter is set to an empty list.

ShutdownTimeoutMs (default: 1000, unit: ms)

Defines the maximum time in milliseconds a consumer is allowed to take to shut down. After this timeout the consumer is always considered to have shut down. By default this parameter is set to 1000.

Modulators

Defines a list of modulators to be applied to a message before it is sent to the list of streams. If a modulator specifies a stream, the message is only sent to that specific stream. A message is saved as original after all modulators have been applied. By default this parameter is set to an empty list.

ModulatorRoutines

Defines the number of go routines reserved for modulating messages. Setting this parameter to 0 will use as many go routines as the specific consumer plugin is using for fetching data. Any other value will force the given number fo go routines to be used. By default this parameter is set to 0

ModulatorQueueSize

Defines the size of the channel used to buffer messages before they are fetched by the next free modulator go routine. If the ModulatorRoutines parameter is set to 0 this parameter is ignored. By default this parameter is set to 1024.

Examples

This example will accepts 64bit length encoded data on TCP port 5880.

proxyReceive:
  Type: consumer.Proxy
  Streams: proxyData
  Address: ":5880"
  Partitioner: binary
  Size: 8