Return to
Portfolio

109.37. ZeroMQ (im_zmq)

This module provides message transport over ZeroMQ, a scalable high-throughput messaging library.

The corresponding output module is om_zmq.

109.37.1. Configuration

The im_zmq module accepts the following directives in addition to the common module directives. The Address, ConnectionType, Port, and SocketType directives are required.

Address

This directive specifies the ZeroMQ socket address.

ConnectionType

This mandatory directive specifies the underlying transport protocol. It may be one of the following: TCP, PGM, or EPGM.

Port

This directive specifies the ZeroMQ socket port.

SocketType

This mandatory directive defines the type of the socket to be used. It may be one of the following: REQ, DEALER, SUB, XSUB, or PULL. This must be set to SUB if ConnectionType is set to PGM or EPGM.


Connect

If this boolean directive is set to TRUE, im_zmq will connect to the Address specified. If FALSE, im_zmq will bind to the Address and listen for connections. The default is FALSE.

InputType

See the InputType directive in the list of common module directives. The default is Dgram.

Interface

This directive specifies the ZeroMQ socket interface.

SockOpt

This directive can be used to set ZeroMQ socket options. For example, SockOpt ZMQ_SUBSCRIBE ANIMALS.CATS. This directive may be used more than once to set multiple options.

109.37.2. Examples

Example 577. Using the im_zmq Module

This example configuration accepts ZeroMQ messages over TCP and writes them to file.

nxlog.conf [Download file]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<Input zmq>
    Module         im_zmq
    SocketType     PULL
    ConnectionType TCP
    Address        10.0.0.1
    Port           1415
</Input>

<Output file>
    Module         om_file
    File           "/var/log/zmq-messages.log"
</Output>

<Route zmq_to_file>
    Path           zmq => file
</Route>