Skip to content

Configuring_0mq_Endpoints

Rehan Iftikhar edited this page Dec 7, 2011 · 6 revisions

Configuring 0mq Endpoints

Engine.js uses 0mq and the node.js 0mq bindings to communicate between server components. Most of the internal 0mq endpoints are configurable at runtime. All default internal 0mq endpoints are designed to work together “out of the box”.

Note: If you change a 0mq endpoint from its default make sure you also change the corresponding endpoint for the complementary server component. See the Default Endpoints & Mappings section.

0mq transport types

Even though 0mq supports 4 different types of transports only 2 types are supported by Engine.js (ipc and tcp)

  • ipc: The inter-process (ipc) transport passes messages between local processes using a system-dependent IPC mechanism. This is the default transport type for all Engine.js components.
  • tcp: TCP is an ubiquitous, reliable, unicast transport. Use this transport type when distributing server components across mulitple machines.

IPC Endpoints

IPC endpoints have the format: ipc://[socket-name]. See the relevant 0mq documentation for more information about the ipc transport.

TCP Endpoints

TCP endpoints have the format: tcp://[interface]:[port]. See the relevant 0mq documentation for more information about the tcp transport.

  • interface: An IPv4 network address. Domain names will not work (but local-network DNS names will).
    • If the endpoint is marked as “exclusive” then you can use * as the interface. All interfaces will then be bound to the specified port.
  • port: The TCP port number to use.
    • To see if a TCP port is free for an endpoint to use, use lsof -i :[PORT]

Default Endpoints & Mappings

Component Param Default Endpoint Complementary Component Complementary Param
Client sending_endpoint ipc:///tmp/intake-listener.ipc Intake listening_endpoint
Client listening_endpoint ipc:///tmp/exhaust-publisher.ipc Exhaust publishing_endpoint
Intake sending_endpoint ipc:///tmp/cylinder-listener.ipc Cylinder listening_endpoint
Intake listening_endpoint ipc:///tmp/intake-listener.ipc Client sending_endpoint
Cylinder listening_endpoint ipc:///tmp/cylinder-listener.ipc Intake sending_endpoint
Cylinder exhaust_endpoint ipc:///tmp/exhaust-listener.ipc Exhaust listening_endpoint
Exhaust listening_endpoint ipc:///tmp/exhaust-listener.ipc Cylinder exhaust_endpoint
Exhaust publishing_endpoint ipc:///tmp/exhaust-publisher.ipc Client listening_endpoint