SlideShare uma empresa Scribd logo
1 de 71
Baixar para ler offline
ØMQ @ NodeJS
ØMQ: Small Pieces for Scalable Software
Fernando D. Alonso
1. Facts about ØMQ
[ ]
Facts about ØMQ
Low level messaging library
○ It is written in C++.
○ A thin layer between application and transport
layers.
○ Message-passing using in-memory queues.
○ Concise API which talks over the ZMTP protocol.
○ Works on top of TCP, IPC, in-memory, and
PGM/EPGM communication protocols.
○ Philosophy: horizontal scalability to reduce points
of failure.
○ Network topology aware. Point to point
communication reduce latencies.
○ Communication is reduced to a few patterns, which
combined are powerful.
○ No need to have a multitenant service.
Facts about ØMQ
A broker is not mandatory
Facts about ØMQ
Messaged oriented communication
○ Messages as first-class citizen. No need to fight
with framing or buffering.
○ You can send multipart messages.
○ Messages are atomic.
○ Asynchronous messaging. A single background I/O
thread does the job for ØMQ sockets.
"A ØMQ message is a discrete unit of data passed between
applications or components of the same application. ØMQ messages
have no internal structure and from the point of view of ØMQ itself
they are considered to be opaque binary data."
Facts about ØMQ
Fast for development
○ Interchangeable transports: e.g, scaling from one
IPC server to a bunch of TCP.
○ Automatic reconnections.
○ Multicore made easy.
○ Provides zmq_poll to read BSD sockets.
○ It doesn't provide message persistence.
○ It doesn't provide data serialization.
○ It doesn't provide data compression.
○ It doesn't provide message encryption.
○ It doesn't provide security mechanisms. Not in the
next version of the ZMTP protocol !
(*) ZTMP 3.0 draft protocol: http://hintjens.com/blog:39
Facts about ØMQ
Aims for simplicity
Facts about ØMQ
Platforms & Languages
○ Bindings for 30+ languages including NodeJS, Ruby,
Python, Java, C, C++, Scala, Erlang, Perl, PHP, .NET.
○ Linux & Windows.
○ Raspberry PI.
○ Android OS.
2. Install
[ , ]
Install
On Linux from source
sudo apt-get install build-essential libtool autoconf automake uuid-dev
wget http://download.zeromq.org/zeromq-3.2.3.tar.gz
tar xvzf zeromq-3.2.3.tar.gz
./configure
make
sudo make install
sudo ldconfig
NOTES:
(*) Check http://download.zeromq.org/ for more versions.
(**) Avoid 3.0.x, 3.1.x, 3.2.0, 3.2.1 versions. They lack backwards
compatibility.
(***) Check ./configure --help for more options on build.
(****) ./configure --with-pgm
Install
On Linux using packages
Libzmq 3.2:
● Debian Sid: sudo apt-get install libzmq3-dev
Libzmq 2.2:
● Debian Wheezy, Jessie, Sid: sudo apt-get install libzmq-dev
● Debian Squeeze backport: http://packages.debian.org/squeeze-
backports/libzmq1
Install
On Mac
brew install zmq
Install
NodeJS bindings
NPM Packages:
● zmq (https://github.com/JustinTulloss/zeromq.node) [RECOMMENDED]
● zmq-stream (https://github.com/Schoonology/zmq-stream)
npm install zmq
node
> var zmq = require('zmq');
Install
Bindings in other languages
Ruby: https://github.com/chuckremes/ffi-rzmq [RECOMMENDED]
Python: https://github.com/zeromq/pyzmq
Erlang: https://github.com/zeromq/erlzmq2
Java JZMQ (uses JNI): https://github.com/zeromq/jzmq
Java JeroMQ: https://github.com/zeromq/jeromq
Scala ZeroMQ: https://github.com/mDialog/scala-zeromq
Scala ZeroMQ (official): https://github.com/valotrading/zeromq-scala-binding
...
3. Sockets
Sockets
Creation
(*) http://api.zeromq.org/3-2:zmq-socket
ØMQ C API
NodeJS ZMQ
req ZMQ_REQ
rep ZMQ_REP
dealer ZMQ_DEALER
router ZMQ_ROUTER
push ZMQ_PUSH
pull ZMQ_PULL
ØMQ C APINodeJS ZMQ
pub ZMQ_PUB
sub ZMQ_SUB
xsub ZMQ_XSUB
xpub ZMQ_XPUB
var sock = zmq.socket
("<SOCKET_TYPE>");
zmq_socket(context, <SOCKET_TYPE>);
Request
Reply
Dealer (async Request)
Router (async Reply)
Push
Pull
Publisher
Subscriber
XSubscriber
XPublisher
Sockets
Bind & Connect
sock.bind("tcp://10.0.0.1:5555",
function(err) {
..
});
sock.connect("tcp://10.0.0.1:5555");
sock.close();
(*) http://api.zeromq.org/3-2:zmq-bind
(**) http://api.zeromq.org/3-2:zmq-connect
(***) http://api.zeromq.org/3-2:zmq-close
ØMQ C API
zmq_bind(socket, "tcp://10.0.0.1:5555");
zmq_connect(socket, "tcp://10.0.0.1:
5555");
zmq_close(socket);
NodeJS ZMQ
Bind
Connect
Close
Sockets
Bind & Connect
sock.bindSync("tcp://10.0.0.1:5555");
// This line gets executed once the socket
// is binded, but it breaks on error.
NodeJS ZMQ
BindSync
Sockets
Transports
TCP
● usage: tcp://<address>:<port>
sock.bind("tcp://192.168.1.100:5555");
sock.bind("tcp://eth0:5555");
// binds to the first eth0 interface
sock.bind("tcp://*:5555");
// binds to all interfaces
(*) http://api.zeromq.org/3-2:zmq-tcp
ØMQ C API
zmq_bind(socket, "tcp://192.168.1.100:
5555");
zmq_bind(socket, "tcp://eth0:5555");
zmq_bind(socket, "tcp://*:5555");
NodeJS ZMQ
Sockets
Transports
Inter-Process Communication (IPC)
● usage: ipc://<address>
● Requires RW permissions on the specified path.
(*) http://api.zeromq.org/3-2:zmq-ipc
sock.bind("ipc:///tmp/mysocket");
ØMQ C API
zmq_bind(socket, "ipc:///tmp/mysocket");
NodeJS ZMQ
Sockets
Transports
In-process Communication (in-memory)
● usage: inproc://<address>
● Requires to bind before connect.
● Max. address name length is 256.
(*) http://api.zeromq.org/3-2:zmq-inproc
(**) Buggy on node-zmq package.
sock.bind("inproc://queue");
ØMQ C API
zmq_bind(socket, "ipc://queue");
NodeJS ZMQ
Sockets
Transports
PGM (multicast)
● usage: pgm://<address>;<multicast_address>:<port>
● Requires sudo privileges to access raw IP sockets.
● Needs ØMQ built with PGM extension (./configure --with-pgm).
(*) http://api.zeromq.org/3-2:zmq-pgm
sock.bind(
"pgm://192.168.1.100;239.192.1.1:3055"
);
ØMQ C API
zmq_bind(socket, "pgm://192.168.1.100;
239.192.1.1:3055");
NodeJS ZMQ
Sockets
Transports
Encapsulated PGM (multicast)
● usage: epgm://<address>;<multicast_address>:<port>
● Needs ØMQ built with PGM extension (./configure --with-pgm).
(*) http://api.zeromq.org/3-2:zmq-pgm
sock.bind(
"epgm://192.168.1.100;239.192.1.1:3055"
);
ØMQ C API
zmq_bind(socket, "epgm://192.168.1.100;
239.192.1.1:3055");
NodeJS ZMQ
Sockets
Send & Receive
Send
sock.send("My message");
sock.on("message", function(msg) {
console.log(msg.toString());
});
(*) http://api.zeromq.org/3-2:zmq-send
(**) http://api.zeromq.org/3-2:zmq-recv
Receive
sock.on("message", function(msg) {
console.log("Received " + msg);
});
// <msg> is a Buffer object.
Sockets
Multipart messages
ØMQ Queue
zmq_send(socket, "Como", 4, ZMQ_SNDMORE);
Messages are atomic
A ØMQ message is composed of 1 or more
message parts.
zmq_send(socket, "andas", 5, 0);
4 ComoPart 1
5 andasPart 2
ØMQ ensures that peers receive either all message parts of a message or
none at all.
The total number of message parts is unlimited except by available memory.
Sockets
Multipart messages
sock.send("First part", zmq.ZMQ_SNDMORE);
sock.send("Second part");
sock.send(["First part", "Second part"]);
Send
var r = sock.send("Como", zmq.
ZMQ_SNDMORE);
console.log(r);
Check the outgoing buffer and socket state:
running this
will output ->
> { type: 'req',
_zmq: { state: 0, onReady:
[Function] },
_outgoing: [ [ <Buffer 43 6f
6d 6f>, 2 ] ],
_shouldFlush: true,
_events: { message: [Function]
} }
Sockets
Multipart messages
sock.on("message", function(first_part, second_part) {
console.log(first_part.toString());
console.log(second_part.toString());
});
sock.on("message", function() {
for(var key in arguments) {
console.log("Part " + key + ": " + arguments[key]);
};
});
Receive
sock.on("message", function() {
var messages = Array.prototype.slice.call(arguments);
messages.forEach(function(msg) {
console.log("Part:" + msg);
});
});
Sockets
Batched messaging
ØMQ Queue
3 Msg
"ØMQ batches messages in opportunistic manner. It sends all the
messages available at the moment in one go. Latency of subsequent
messages will be improved because sending single batch to the card
is faster then sending lot of small messages."
sock.send("Part A",
zmq.ZMQ_SNDMORE);
sock.send("Msg");
sock.send("Part
B");
6 Part A
6 Part B
ØMQ Socket
send
send
send
<write busy>
<write ready>
Client Thread ØMQ I/O Thread
send
batch
<write busy>
Patterns
Plugging multiple transports
Example
var zmq = require('zmq'),
pub = zmq.socket('pub');
pub.bindSync('tcp://127.0.0.1:5555');
pub.bindSync('ipc:///tmp/zmq.sock');
setInterval(function() {
pub.send("I am polyglot!");
}, 1000);
sub = zmq.socket('sub');
sub.connect('ipc:///tmp/zmq.sock');
sub.subscribe('');
sub.on('message', function(msg) {
console.log("Received: " + msg);
});
var zmq = require('zmq'),
sub = zmq.socket(sub');
sub.connect('tcp://127.0.0.1:5555');
sub.subscribe('');
sub.on('message', function(msg) {
console.log(Received: ' + msg);
});
Sockets
Setting Socket Options
(*) http://api.zeromq.org/3-2:zmq-setsockopt
Setsockopt
● usage (NodeJS ZMQ API): sock.setsockopt(<option>, <value>);
or sock.<option> = <value>;
sock.identity = 'monitor-1';
sock.setsockopt('identity', 'monitor-1');
Identity:
// value can be any string up to 255 length.
// identity is required on sockets
// connecting to a Router.
Sockets
Setting Socket Options
Setsockopt
subscriber.subscribe('MUSIC');
subscriber.setsockopt('subscribe',
'MUSIC');
Subscribe:
// sets a message filter for subscriber sockets.
subscriber.unsubscribe('MUSIC');
susbscriber.setsockopt('subscribe',
'POP');
Unsubscribe:
// sets off a message filter for subscriber
sockets.
4. Patterns
[ ]
Patterns
Request / Reply
Synchronous task distribution
Ø REP #1
Ø REP # 2
Ø REQ
< round robin >
...
< synchronous >
Used when each message needs to be matched with a response. Handles
only one message at time. Strict send-recv cycle.
Patterns
Request / Reply
Ø REP #1 Ø REP # 2Ø REQ
send
recv (wait response)
send
recv (dont wait response)
recv (dont wait response)
Patterns
Request / Reply
Ø REP #1 Ø REP # 2Ø REQ
send
recv
recv
send
send
-> REP #1 is down
FAILURE
REQ #1 will not recover !
Patterns
Request / Reply
Basic Request / Reply
var zmq = require('zmq');
reply = zmq.socket('rep');
reply.bind('tcp://127.0.0.1:5555',
function(err) {
if (err) throw err;
}
);
reply.on('message', function(msg) {
console.log('Received: ' + msg);
reply.send('Pong!');
});
var zmq = require('zmq');
request = zmq.socket('req');
request.connect('tcp://127.0.0.1:5555');
request.send('Ping');
request.on('message', function(msg) {
console.log('Response: ' + msg);
});
Patterns
Request / Reply
Dealer socket message delivery
Messages have to be multipart, consisting on: an empty delimiter header,
followed by the content body parts.
sock.send("Body");
Outgoing Queue
0
6 Body
sock.send(new Buffer([]), zmq.
ZMQ_SNDMORE);
send
send
Patterns
Request / Reply
Dealer socket message delivery
Outgoing messages are round-robined among all connected peers.
However, sending depends on the availability of the receiver.
sock.send(
["", "Msg"]);
Outgoing Queue
3 Msg
6 Part A
Peer Socket A Peer Socket B
sock.send(
["", "Bla");
sock.send(
["", "Msg2"]);
send
send
send
To A
To B
To A
send
<write
ready>
<write
busy>
<write
ready>
0
0
4 Msg2
0
Patterns
Request / Reply
Dealer socket message delivery
Reconnections are handled automatically: messages are asynchronously
delivered. Response time does not block sending more messages.
Outgoing Queue Peer Socket A Peer Socket B
send
-> Up again
sock.send(
["", "Msg"]);
3 Msg
sock.send(
["", "Msg2"]);
send
send
To A
To A
0
4 Msg2
0
Patterns
Request / Reply
Ø REP #1 Ø REP # 2Ø DEALER
enqueue < Msg A >
send < Msg B >
-> REP #1 is down
enqueue < Msg C >
send < Msg A, Msg C >
send < Msg D >
Dealer socket handles peer reconnection automatically. It will send
messages that queued for that peer once it has established connection.
Patterns
Request / Reply
> Response from: 5001
> Response from: 5001
> Response from: 5002
> Response from: 5001
> Response from: 5001
> Response from: 5002
> ...
Dealer example
var dealer = zmq.socket('dealer');
dealer.connect('tcp://127.0.0.1:5001');
dealer.connect('tcp://127.0.0.1:5002');
setInterval(function() {
dealer.send(["", "Msg"]);
}, 1000);
dealer.on('message', function(h, msg) {
console.log('Response from: ' + msg);
});
running this
'might' output
->
Patterns
Request / Reply
Router socket messaging
Messages have to be multipart, consisting on: an identity frame, an empty
delimiter frame, followed by the content body parts. This applies to both
incoming and outgoing messages.
sock.send("Body");
Outgoing Queue
0
6 Body
sock.send("", zmq.
ZMQ_SNDMORE);
send
send
sock.send(
"worker-1", zmq.
ZMQ_SNDMORE); 8 worker-1
send
Patterns
Request / Reply
Router is asynchronous
Incoming messages are fair-queued among all connected and available
peers.
Peer Socket A Peer Socket B
ØMQ Router
Incoming Queue
Socketsend
send
send
Patterns
Request / Reply
Router is asynchronous
Receiving depends on the availability of the sender.
Peer Socket A Peer Socket B
ØMQ Router
Incoming Queue
Socketsend
send
Patterns
Push / Pull
Unidirectional data distribution
The Push / Pull pattern fits well on pipelined communication, i.e., when no
response is required for a given message.
Ø
Ø
...
ØØ
Patterns
Push / Pull
Binding the Push socket
Outgoing messages are round-robined among all connected and available
peers.
push.send("Msg");
push.send("Part
B");
Outgoing Queue Peer Socket A Peer Socket B
push.send("Part A",
zmq.ZMQ_SNDMORE);
push.send("Msg2");
3 Msg
6 Part A
6 Part B
4 Msg2
send
send
send
send
Patterns
Push / Pull
Binding the Push socket
Outgoing messages are round-robined among all connected and available
peers.
Outgoing Queue Peer Socket A Peer Socket B
-> Down3 Msg
6 Part A
6 Part B
4 Msg2
send
send
send
push.send("Msg");
push.send("Part
B");
push.send("Part A",
zmq.ZMQ_SNDMORE);
push.send("Msg2");
send
send
send
send
Patterns
Push / Pull
Binding the Push socket
Disconnections and reconnections are handled automatically.
Outgoing Queue Peer Socket A Peer Socket B
4 More
6 Part 1
6 Part 2
5 Other
send
send
send
push.send("More"); send
push.send("Part
2");
push.send("Part 1",
zmq.ZMQ_SNDMORE);
send
send
push.send("Other");
send
Patterns
Push / Pull
Parallel task distribution
Ø PULL #1
Ø PULL # 2
Ø PUSH
< round robin >
...
Patterns
Push / Pull
Passive agents / Monitor
Ø PULLØ PUSH
...
Ø PUSH
Patterns
Push / Pull
Binding the Pull socket
Push's outgoing messages are round-robined among all connected peers.
push.send("Msg");
push.send("Part
B");
Outgoing Queue Peer Socket A Peer Socket B
push.send("Part A",
zmq.ZMQ_SNDMORE);
push.send("Msg2");
send
send
send
send
3 Msg
6 Part A
6 Part B
4 Msg2
To A
To B
To A
Patterns
Push / Pull
Binding the Pull socket
Push's outgoing messages are round-robined among all connected peers.
push.send("Msg");
push.send("Part
B");
Outgoing Queue Peer Socket A Peer Socket B
push.send("Part A",
zmq.ZMQ_SNDMORE);
push.send("Msg2");
send
send
send
send
send
send
send
3 Msg
6 Part A
6 Part B
4 Msg2
To A
To B
To A
Patterns
Push / Pull
Binding the Pull socket
Disconnections and reconnections are handled automatically.
Outgoing Queue Peer Socket A Peer Socket B
send
send
-> Down4 More
6 Part 1
6 Part 2
5 Other
To A
To A
To B
push.send("More"); send
push.send("Part
2");
push.send("Part 1",
zmq.ZMQ_SNDMORE);
send
send
push.send("Other");
send
Patterns
Push / Pull
Binding the Pull socket
Sending is asynchronous, it depends on the availability of the receiver.
Outgoing Queue Peer Socket A Peer Socket B
send
-> Up again
5 OtherTo B
push.send("More"); send
push.send("Part
2");
push.send("Part 1",
zmq.ZMQ_SNDMORE);
send
send
push.send("Other");
send
Patterns
Push / Pull
Ø PULLØ PUSH #1
...
Ø PUSH #2
Active agents / collector pattern
Patterns
Publish / Subscribe
Broadcast data distribution
Ø SUB #1
Ø PUB #1
...
Ø SUB #2
Ø SUB #2
Message distribution
Patterns
Publish / Subscribe
sock.send("Msg");
Outgoing Queue
3 Msg
Subscriber A
Subscriber B
send
send
Outgoing messages are send to each connected and available peers.
Subscriber C
Message distribution
Patterns
Publish / Subscribe
sock.send("Msg");
Outgoing Queue
3 Msg
Subscriber A
Subscriber B
send
send
Outgoing messages are send to each connected and available peers.
Subscriber C
5 Othersock.send("Other");
send
Subscribers can register to a specific topic.
Data filtering
Patterns
Publish / Subscribe
ØMQ Publisher
Subscriber A
Subscriber B
Subscriber C
Outgoing Queue
subscribe AR
subscribe VE
Socket
subscribe VE
Subscribers can register to a specific topic.
Data filtering
Patterns
Publish / Subscribe
ØMQ Publisher
Subscriber A
Subscriber B
Subscriber C
Outgoing Queue
subscribe AR
subscribe VE
Socket
subscribe VE
sock.send("AR
news");
send
7 AR news
send
Subscribers can register to a specific topic.
Data filtering
Patterns
Publish / Subscribe
ØMQ Publisher
Subscriber A
Subscriber B
Subscriber C
Outgoing Queue
subscribe AR
subscribe VE
Socket
subscribe VE
sock.send("VE
news");
send
7 VE news
sendsend
Patterns
Publish / Subscribe
Data filtering example
pub = zmq.socket('pub');
pub.bindSync("tcp://10.0.0.12:3055");
count = 0
setInterval(function() {
pub.send("TEST " + count++);
}, 1000);
sub = zmq.socket('sub');
sub.connect("tcp://10.0.0.12:3055");
sub.subscribe("TEST");
sub.on("message", function(msg) {
console.log("Received: " + msg);
});
// older messages won't be
// received
> TEST 6
> TEST 7
> TEST 8
> TEST 9
> TEST 10
running this
'might'
output ->
Patterns
Publish / Subscribe
Multicast example
var zmq = require('zmq'),
pub = zmq.socket('pub');
pub.bind(
"epgm://10.0.0.12;239.192.1.1:3055",
function(err) {
if(err) throw err;
}
)
setInterval(function() {
pub.send("From pid: " + process.pid);
}, 1000);
var zmq = require('zmq'),
sub = zmq.socket('sub');
sub.connect(
"epgm://10.0.0.13;239.192.1.1:3055"
);
sub.subscribe("");
sub.on('message', function(msg) {
console.log("Received " + msg);
});
(*) See running demo at http://youtu.be/NQrH0SATPk0
"XSUB and XPUB are exactly like SUB and PUB except they expose
subscriptions as special messages."
Data distribution proxy
Patterns
XSUB / XPUB
XSUB/XPUB Proxy
Subscriber A
Subscriber B
Subscriber C
XPUB Socket
XSUB Socket
Publisher A
Publisher B
Publisher C
subscribe
PY
forward
subscription
Messages are forwarded by the proxy to the registered subscribers.
Data distribution proxy
Patterns
XSUB / XPUB
XSUB/XPUB Proxy
Subscriber A
Subscriber B
Subscriber C
XPUB Socket
XSUB Socket
Publisher A
Publisher B
Publisher C
forward
message
send "PY<msg>"
send
5. Useful links
[ ]
Useful Links
Workshop examples
http://github.com/krakatoa/node_zmq_workshop
Useful Links
The Guide
http://zguide.zeromq.org/page:all
Useful Links
Pieter Hintjens personal blog
http://hintjens.com/
Useful Links
API References
http://api.zeromq.org/3-2:zmq-socket
http://api.zeromq.org/3-2:zmq-setsockopt
Preguntas ?
fedario@gmail.com
github.com/krakatoa
Fernando Dario Alonso
Gracias !

Mais conteúdo relacionado

Mais procurados

Introduction to rust: a low-level language with high-level abstractions
Introduction to rust: a low-level language with high-level abstractionsIntroduction to rust: a low-level language with high-level abstractions
Introduction to rust: a low-level language with high-level abstractionsyann_s
 
BETTER TOGETHER 〜VMware NSXとJuniperデバイスを繋いでみよう!〜
BETTER TOGETHER 〜VMware NSXとJuniperデバイスを繋いでみよう!〜BETTER TOGETHER 〜VMware NSXとJuniperデバイスを繋いでみよう!〜
BETTER TOGETHER 〜VMware NSXとJuniperデバイスを繋いでみよう!〜Juniper Networks (日本)
 
[KubeConEU] Building images efficiently and securely on Kubernetes with BuildKit
[KubeConEU] Building images efficiently and securely on Kubernetes with BuildKit[KubeConEU] Building images efficiently and securely on Kubernetes with BuildKit
[KubeConEU] Building images efficiently and securely on Kubernetes with BuildKitAkihiro Suda
 
Linux Kernel vs DPDK: HTTP Performance Showdown
Linux Kernel vs DPDK: HTTP Performance ShowdownLinux Kernel vs DPDK: HTTP Performance Showdown
Linux Kernel vs DPDK: HTTP Performance ShowdownScyllaDB
 
OpenStack API's and WSGI
OpenStack API's and WSGIOpenStack API's and WSGI
OpenStack API's and WSGIMike Pittaro
 
Performance Tuning EC2 Instances
Performance Tuning EC2 InstancesPerformance Tuning EC2 Instances
Performance Tuning EC2 InstancesBrendan Gregg
 
Kubernetes From Scratch .pdf
Kubernetes From Scratch .pdfKubernetes From Scratch .pdf
Kubernetes From Scratch .pdfssuser9b44c7
 
How VXLAN works on Linux
How VXLAN works on LinuxHow VXLAN works on Linux
How VXLAN works on LinuxEtsuji Nakai
 
DRBD/Heartbeat/Pacemakerで作るKVM仮想化クラスタ
DRBD/Heartbeat/Pacemakerで作るKVM仮想化クラスタDRBD/Heartbeat/Pacemakerで作るKVM仮想化クラスタ
DRBD/Heartbeat/Pacemakerで作るKVM仮想化クラスタ株式会社サードウェア
 
Efficient Schemas in Motion with Kafka and Schema Registry
Efficient Schemas in Motion with Kafka and Schema RegistryEfficient Schemas in Motion with Kafka and Schema Registry
Efficient Schemas in Motion with Kafka and Schema RegistryPat Patterson
 
VirtualBox と Rocky Linux 8 で始める Pacemaker ~ VirtualBox でも STONITH 機能が試せる! Vi...
VirtualBox と Rocky Linux 8 で始める Pacemaker  ~ VirtualBox でも STONITH 機能が試せる! Vi...VirtualBox と Rocky Linux 8 で始める Pacemaker  ~ VirtualBox でも STONITH 機能が試せる! Vi...
VirtualBox と Rocky Linux 8 で始める Pacemaker ~ VirtualBox でも STONITH 機能が試せる! Vi...ksk_ha
 
日本OpenStackユーザ会 第37回勉強会
日本OpenStackユーザ会 第37回勉強会日本OpenStackユーザ会 第37回勉強会
日本OpenStackユーザ会 第37回勉強会Yushiro Furukawa
 
痛い目にあってわかる HAクラスタのありがたさ
痛い目にあってわかる HAクラスタのありがたさ痛い目にあってわかる HAクラスタのありがたさ
痛い目にあってわかる HAクラスタのありがたさTakatoshi Matsuo
 
Grokking Techtalk #37: Software design and refactoring
 Grokking Techtalk #37: Software design and refactoring Grokking Techtalk #37: Software design and refactoring
Grokking Techtalk #37: Software design and refactoringGrokking VN
 
Rust system programming language
Rust system programming languageRust system programming language
Rust system programming languagerobin_sy
 

Mais procurados (20)

Introduction to rust: a low-level language with high-level abstractions
Introduction to rust: a low-level language with high-level abstractionsIntroduction to rust: a low-level language with high-level abstractions
Introduction to rust: a low-level language with high-level abstractions
 
BETTER TOGETHER 〜VMware NSXとJuniperデバイスを繋いでみよう!〜
BETTER TOGETHER 〜VMware NSXとJuniperデバイスを繋いでみよう!〜BETTER TOGETHER 〜VMware NSXとJuniperデバイスを繋いでみよう!〜
BETTER TOGETHER 〜VMware NSXとJuniperデバイスを繋いでみよう!〜
 
[KubeConEU] Building images efficiently and securely on Kubernetes with BuildKit
[KubeConEU] Building images efficiently and securely on Kubernetes with BuildKit[KubeConEU] Building images efficiently and securely on Kubernetes with BuildKit
[KubeConEU] Building images efficiently and securely on Kubernetes with BuildKit
 
Linux Kernel vs DPDK: HTTP Performance Showdown
Linux Kernel vs DPDK: HTTP Performance ShowdownLinux Kernel vs DPDK: HTTP Performance Showdown
Linux Kernel vs DPDK: HTTP Performance Showdown
 
ZeroMQ in PHP
ZeroMQ in PHPZeroMQ in PHP
ZeroMQ in PHP
 
How MQTT work ?
How MQTT work ?How MQTT work ?
How MQTT work ?
 
OpenStack API's and WSGI
OpenStack API's and WSGIOpenStack API's and WSGI
OpenStack API's and WSGI
 
Performance Tuning EC2 Instances
Performance Tuning EC2 InstancesPerformance Tuning EC2 Instances
Performance Tuning EC2 Instances
 
RabbitMQ
RabbitMQ RabbitMQ
RabbitMQ
 
Kubernetes From Scratch .pdf
Kubernetes From Scratch .pdfKubernetes From Scratch .pdf
Kubernetes From Scratch .pdf
 
How VXLAN works on Linux
How VXLAN works on LinuxHow VXLAN works on Linux
How VXLAN works on Linux
 
DRBD/Heartbeat/Pacemakerで作るKVM仮想化クラスタ
DRBD/Heartbeat/Pacemakerで作るKVM仮想化クラスタDRBD/Heartbeat/Pacemakerで作るKVM仮想化クラスタ
DRBD/Heartbeat/Pacemakerで作るKVM仮想化クラスタ
 
Zenoh Tutorial
Zenoh TutorialZenoh Tutorial
Zenoh Tutorial
 
Efficient Schemas in Motion with Kafka and Schema Registry
Efficient Schemas in Motion with Kafka and Schema RegistryEfficient Schemas in Motion with Kafka and Schema Registry
Efficient Schemas in Motion with Kafka and Schema Registry
 
VirtualBox と Rocky Linux 8 で始める Pacemaker ~ VirtualBox でも STONITH 機能が試せる! Vi...
VirtualBox と Rocky Linux 8 で始める Pacemaker  ~ VirtualBox でも STONITH 機能が試せる! Vi...VirtualBox と Rocky Linux 8 で始める Pacemaker  ~ VirtualBox でも STONITH 機能が試せる! Vi...
VirtualBox と Rocky Linux 8 で始める Pacemaker ~ VirtualBox でも STONITH 機能が試せる! Vi...
 
Message Broker System and RabbitMQ
Message Broker System and RabbitMQMessage Broker System and RabbitMQ
Message Broker System and RabbitMQ
 
日本OpenStackユーザ会 第37回勉強会
日本OpenStackユーザ会 第37回勉強会日本OpenStackユーザ会 第37回勉強会
日本OpenStackユーザ会 第37回勉強会
 
痛い目にあってわかる HAクラスタのありがたさ
痛い目にあってわかる HAクラスタのありがたさ痛い目にあってわかる HAクラスタのありがたさ
痛い目にあってわかる HAクラスタのありがたさ
 
Grokking Techtalk #37: Software design and refactoring
 Grokking Techtalk #37: Software design and refactoring Grokking Techtalk #37: Software design and refactoring
Grokking Techtalk #37: Software design and refactoring
 
Rust system programming language
Rust system programming languageRust system programming language
Rust system programming language
 

Destaque

Ten Key Factors that Influence Successful Bilingualism and Multilingualism
Ten Key Factors that Influence Successful Bilingualism and MultilingualismTen Key Factors that Influence Successful Bilingualism and Multilingualism
Ten Key Factors that Influence Successful Bilingualism and MultilingualismSjoerd Heeringa
 
On-line book store presentation
On-line book store presentation On-line book store presentation
On-line book store presentation Smit Patel
 
Key Passages in Jane Eyre
Key Passages in Jane EyreKey Passages in Jane Eyre
Key Passages in Jane EyreJ Aragonite
 
4. heredity and evolution
4. heredity and evolution4. heredity and evolution
4. heredity and evolutionAbhay Goyal
 
Internet of Things (IOT) - Technology and Applications
Internet of Things (IOT) - Technology and ApplicationsInternet of Things (IOT) - Technology and Applications
Internet of Things (IOT) - Technology and ApplicationsDr. Mazlan Abbas
 
Environmental Impact Assessment (EIA) report on Rampal 1320MW coal-based powe...
Environmental Impact Assessment (EIA) report on Rampal 1320MW coal-based powe...Environmental Impact Assessment (EIA) report on Rampal 1320MW coal-based powe...
Environmental Impact Assessment (EIA) report on Rampal 1320MW coal-based powe...Probir Bidhan
 
Mathematics high school level quiz - Part I
Mathematics high school level quiz - Part IMathematics high school level quiz - Part I
Mathematics high school level quiz - Part IITfC-Edu-Team
 
61 Beautiful & Inspirational Timeline Cover on Facebook
61 Beautiful & Inspirational Timeline Cover on Facebook61 Beautiful & Inspirational Timeline Cover on Facebook
61 Beautiful & Inspirational Timeline Cover on FacebookConsonaute
 
Thai tech startup ecosystem report 2017
Thai tech startup ecosystem report 2017Thai tech startup ecosystem report 2017
Thai tech startup ecosystem report 2017Techsauce Media
 
Engaging Learners with Technology
Engaging Learners with TechnologyEngaging Learners with Technology
Engaging Learners with TechnologyDean Shareski
 
Vernacular Architecture (Case Study- H.P.)
Vernacular Architecture (Case Study- H.P.)Vernacular Architecture (Case Study- H.P.)
Vernacular Architecture (Case Study- H.P.)divya_binu
 
Principles and Practices in Continuous Deployment at Etsy
Principles and Practices in Continuous Deployment at EtsyPrinciples and Practices in Continuous Deployment at Etsy
Principles and Practices in Continuous Deployment at EtsyMike Brittain
 

Destaque (20)

Ten Key Factors that Influence Successful Bilingualism and Multilingualism
Ten Key Factors that Influence Successful Bilingualism and MultilingualismTen Key Factors that Influence Successful Bilingualism and Multilingualism
Ten Key Factors that Influence Successful Bilingualism and Multilingualism
 
On-line book store presentation
On-line book store presentation On-line book store presentation
On-line book store presentation
 
The Power of Color in Branding
The Power of Color in BrandingThe Power of Color in Branding
The Power of Color in Branding
 
Key Passages in Jane Eyre
Key Passages in Jane EyreKey Passages in Jane Eyre
Key Passages in Jane Eyre
 
Biofertilizer
BiofertilizerBiofertilizer
Biofertilizer
 
5000 Sat Words With Definitions
5000 Sat Words With Definitions5000 Sat Words With Definitions
5000 Sat Words With Definitions
 
4. heredity and evolution
4. heredity and evolution4. heredity and evolution
4. heredity and evolution
 
Internet of Things (IOT) - Technology and Applications
Internet of Things (IOT) - Technology and ApplicationsInternet of Things (IOT) - Technology and Applications
Internet of Things (IOT) - Technology and Applications
 
New Time Mgt
New Time MgtNew Time Mgt
New Time Mgt
 
BUSINESS QUIZ -Round 1
 BUSINESS QUIZ -Round 1 BUSINESS QUIZ -Round 1
BUSINESS QUIZ -Round 1
 
Environmental Impact Assessment (EIA) report on Rampal 1320MW coal-based powe...
Environmental Impact Assessment (EIA) report on Rampal 1320MW coal-based powe...Environmental Impact Assessment (EIA) report on Rampal 1320MW coal-based powe...
Environmental Impact Assessment (EIA) report on Rampal 1320MW coal-based powe...
 
Mathematics high school level quiz - Part I
Mathematics high school level quiz - Part IMathematics high school level quiz - Part I
Mathematics high school level quiz - Part I
 
61 Beautiful & Inspirational Timeline Cover on Facebook
61 Beautiful & Inspirational Timeline Cover on Facebook61 Beautiful & Inspirational Timeline Cover on Facebook
61 Beautiful & Inspirational Timeline Cover on Facebook
 
Thai tech startup ecosystem report 2017
Thai tech startup ecosystem report 2017Thai tech startup ecosystem report 2017
Thai tech startup ecosystem report 2017
 
Mri brain anatomy Dr Muhammad Bin Zulfiqar
Mri brain anatomy Dr Muhammad Bin ZulfiqarMri brain anatomy Dr Muhammad Bin Zulfiqar
Mri brain anatomy Dr Muhammad Bin Zulfiqar
 
Lean Manufacturing - Toyota Production System
Lean Manufacturing - Toyota Production SystemLean Manufacturing - Toyota Production System
Lean Manufacturing - Toyota Production System
 
Engaging Learners with Technology
Engaging Learners with TechnologyEngaging Learners with Technology
Engaging Learners with Technology
 
Vernacular Architecture (Case Study- H.P.)
Vernacular Architecture (Case Study- H.P.)Vernacular Architecture (Case Study- H.P.)
Vernacular Architecture (Case Study- H.P.)
 
Principles and Practices in Continuous Deployment at Etsy
Principles and Practices in Continuous Deployment at EtsyPrinciples and Practices in Continuous Deployment at Etsy
Principles and Practices in Continuous Deployment at Etsy
 
BIOLOGICAL DIVERSITY
BIOLOGICAL DIVERSITYBIOLOGICAL DIVERSITY
BIOLOGICAL DIVERSITY
 

Semelhante a ZeroMQ with NodeJS

ZeroMQ - Sockets on steroids!
ZeroMQ - Sockets on steroids!ZeroMQ - Sockets on steroids!
ZeroMQ - Sockets on steroids!Pedro Januário
 
Mirage: ML kernels in the cloud (ML Workshop 2010)
Mirage: ML kernels in the cloud (ML Workshop 2010)Mirage: ML kernels in the cloud (ML Workshop 2010)
Mirage: ML kernels in the cloud (ML Workshop 2010)Anil Madhavapeddy
 
MQTT enabling the smallest things
MQTT enabling the smallest thingsMQTT enabling the smallest things
MQTT enabling the smallest thingsIan Craggs
 
Python Ireland 2012 - Message brokers and Python by Fernando Ciciliati
Python Ireland 2012 - Message brokers and Python by Fernando Ciciliati Python Ireland 2012 - Message brokers and Python by Fernando Ciciliati
Python Ireland 2012 - Message brokers and Python by Fernando Ciciliati Python Ireland
 
CurveZMQ, ZMTP and other Dubious Characters
CurveZMQ, ZMTP and other Dubious CharactersCurveZMQ, ZMTP and other Dubious Characters
CurveZMQ, ZMTP and other Dubious Characterspieterh
 
Building a QT based solution on a i.MX7 processor running Linux and FreeRTOS
Building a QT based solution on a i.MX7 processor running Linux and FreeRTOSBuilding a QT based solution on a i.MX7 processor running Linux and FreeRTOS
Building a QT based solution on a i.MX7 processor running Linux and FreeRTOSFernando Luiz Cola
 
Where is My Message
Where is My MessageWhere is My Message
Where is My MessageMatt Leming
 
Zmq in context of openstack
Zmq in context of openstackZmq in context of openstack
Zmq in context of openstackYatin Kumbhare
 
NUSE (Network Stack in Userspace) at #osio
NUSE (Network Stack in Userspace) at #osioNUSE (Network Stack in Userspace) at #osio
NUSE (Network Stack in Userspace) at #osioHajime Tazaki
 
DCCN 2016 - Tutorial 2 - 4G for SmartGrid ecosystem
DCCN 2016 - Tutorial 2 - 4G for SmartGrid ecosystemDCCN 2016 - Tutorial 2 - 4G for SmartGrid ecosystem
DCCN 2016 - Tutorial 2 - 4G for SmartGrid ecosystemrudndccn
 
Exploiting Network Protocols To Exhaust Bandwidth Links 2008 Final
Exploiting Network Protocols To Exhaust Bandwidth Links 2008 FinalExploiting Network Protocols To Exhaust Bandwidth Links 2008 Final
Exploiting Network Protocols To Exhaust Bandwidth Links 2008 Finalmasoodnt10
 
Attacks and their mitigations
Attacks and their mitigationsAttacks and their mitigations
Attacks and their mitigationsMukesh Chaudhari
 
Cotopaxi - IoT testing toolkit (Black Hat Asia 2019 Arsenal)
Cotopaxi - IoT testing toolkit (Black Hat Asia 2019 Arsenal)Cotopaxi - IoT testing toolkit (Black Hat Asia 2019 Arsenal)
Cotopaxi - IoT testing toolkit (Black Hat Asia 2019 Arsenal)Jakub Botwicz
 
Bar-BoF session about Simplemux at IETF93, Prague
Bar-BoF session about Simplemux at IETF93, PragueBar-BoF session about Simplemux at IETF93, Prague
Bar-BoF session about Simplemux at IETF93, PragueJose Saldana
 
Mom those things v1
Mom those things v1 Mom those things v1
Mom those things v1 von gosling
 
Where is my MQ message on z/OS?
Where is my MQ message on z/OS?Where is my MQ message on z/OS?
Where is my MQ message on z/OS?Matt Leming
 
øMQ Vortrag
øMQ VortragøMQ Vortrag
øMQ Vortragmirosso25
 

Semelhante a ZeroMQ with NodeJS (20)

ZeroMQ - Sockets on steroids!
ZeroMQ - Sockets on steroids!ZeroMQ - Sockets on steroids!
ZeroMQ - Sockets on steroids!
 
Mirage: ML kernels in the cloud (ML Workshop 2010)
Mirage: ML kernels in the cloud (ML Workshop 2010)Mirage: ML kernels in the cloud (ML Workshop 2010)
Mirage: ML kernels in the cloud (ML Workshop 2010)
 
MQTT enabling the smallest things
MQTT enabling the smallest thingsMQTT enabling the smallest things
MQTT enabling the smallest things
 
Python Ireland 2012 - Message brokers and Python by Fernando Ciciliati
Python Ireland 2012 - Message brokers and Python by Fernando Ciciliati Python Ireland 2012 - Message brokers and Python by Fernando Ciciliati
Python Ireland 2012 - Message brokers and Python by Fernando Ciciliati
 
ZeroMQ
ZeroMQZeroMQ
ZeroMQ
 
CurveZMQ, ZMTP and other Dubious Characters
CurveZMQ, ZMTP and other Dubious CharactersCurveZMQ, ZMTP and other Dubious Characters
CurveZMQ, ZMTP and other Dubious Characters
 
Building a QT based solution on a i.MX7 processor running Linux and FreeRTOS
Building a QT based solution on a i.MX7 processor running Linux and FreeRTOSBuilding a QT based solution on a i.MX7 processor running Linux and FreeRTOS
Building a QT based solution on a i.MX7 processor running Linux and FreeRTOS
 
Where is My Message
Where is My MessageWhere is My Message
Where is My Message
 
Zmq in context of openstack
Zmq in context of openstackZmq in context of openstack
Zmq in context of openstack
 
NUSE (Network Stack in Userspace) at #osio
NUSE (Network Stack in Userspace) at #osioNUSE (Network Stack in Userspace) at #osio
NUSE (Network Stack in Userspace) at #osio
 
mTCP使ってみた
mTCP使ってみたmTCP使ってみた
mTCP使ってみた
 
Tcpdump
TcpdumpTcpdump
Tcpdump
 
DCCN 2016 - Tutorial 2 - 4G for SmartGrid ecosystem
DCCN 2016 - Tutorial 2 - 4G for SmartGrid ecosystemDCCN 2016 - Tutorial 2 - 4G for SmartGrid ecosystem
DCCN 2016 - Tutorial 2 - 4G for SmartGrid ecosystem
 
Exploiting Network Protocols To Exhaust Bandwidth Links 2008 Final
Exploiting Network Protocols To Exhaust Bandwidth Links 2008 FinalExploiting Network Protocols To Exhaust Bandwidth Links 2008 Final
Exploiting Network Protocols To Exhaust Bandwidth Links 2008 Final
 
Attacks and their mitigations
Attacks and their mitigationsAttacks and their mitigations
Attacks and their mitigations
 
Cotopaxi - IoT testing toolkit (Black Hat Asia 2019 Arsenal)
Cotopaxi - IoT testing toolkit (Black Hat Asia 2019 Arsenal)Cotopaxi - IoT testing toolkit (Black Hat Asia 2019 Arsenal)
Cotopaxi - IoT testing toolkit (Black Hat Asia 2019 Arsenal)
 
Bar-BoF session about Simplemux at IETF93, Prague
Bar-BoF session about Simplemux at IETF93, PragueBar-BoF session about Simplemux at IETF93, Prague
Bar-BoF session about Simplemux at IETF93, Prague
 
Mom those things v1
Mom those things v1 Mom those things v1
Mom those things v1
 
Where is my MQ message on z/OS?
Where is my MQ message on z/OS?Where is my MQ message on z/OS?
Where is my MQ message on z/OS?
 
øMQ Vortrag
øMQ VortragøMQ Vortrag
øMQ Vortrag
 

Último

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 

Último (20)

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 

ZeroMQ with NodeJS

  • 1. ØMQ @ NodeJS ØMQ: Small Pieces for Scalable Software Fernando D. Alonso
  • 2. 1. Facts about ØMQ [ ]
  • 3. Facts about ØMQ Low level messaging library ○ It is written in C++. ○ A thin layer between application and transport layers. ○ Message-passing using in-memory queues. ○ Concise API which talks over the ZMTP protocol. ○ Works on top of TCP, IPC, in-memory, and PGM/EPGM communication protocols.
  • 4. ○ Philosophy: horizontal scalability to reduce points of failure. ○ Network topology aware. Point to point communication reduce latencies. ○ Communication is reduced to a few patterns, which combined are powerful. ○ No need to have a multitenant service. Facts about ØMQ A broker is not mandatory
  • 5. Facts about ØMQ Messaged oriented communication ○ Messages as first-class citizen. No need to fight with framing or buffering. ○ You can send multipart messages. ○ Messages are atomic. ○ Asynchronous messaging. A single background I/O thread does the job for ØMQ sockets. "A ØMQ message is a discrete unit of data passed between applications or components of the same application. ØMQ messages have no internal structure and from the point of view of ØMQ itself they are considered to be opaque binary data."
  • 6. Facts about ØMQ Fast for development ○ Interchangeable transports: e.g, scaling from one IPC server to a bunch of TCP. ○ Automatic reconnections. ○ Multicore made easy. ○ Provides zmq_poll to read BSD sockets.
  • 7. ○ It doesn't provide message persistence. ○ It doesn't provide data serialization. ○ It doesn't provide data compression. ○ It doesn't provide message encryption. ○ It doesn't provide security mechanisms. Not in the next version of the ZMTP protocol ! (*) ZTMP 3.0 draft protocol: http://hintjens.com/blog:39 Facts about ØMQ Aims for simplicity
  • 8. Facts about ØMQ Platforms & Languages ○ Bindings for 30+ languages including NodeJS, Ruby, Python, Java, C, C++, Scala, Erlang, Perl, PHP, .NET. ○ Linux & Windows. ○ Raspberry PI. ○ Android OS.
  • 10. Install On Linux from source sudo apt-get install build-essential libtool autoconf automake uuid-dev wget http://download.zeromq.org/zeromq-3.2.3.tar.gz tar xvzf zeromq-3.2.3.tar.gz ./configure make sudo make install sudo ldconfig NOTES: (*) Check http://download.zeromq.org/ for more versions. (**) Avoid 3.0.x, 3.1.x, 3.2.0, 3.2.1 versions. They lack backwards compatibility. (***) Check ./configure --help for more options on build. (****) ./configure --with-pgm
  • 11. Install On Linux using packages Libzmq 3.2: ● Debian Sid: sudo apt-get install libzmq3-dev Libzmq 2.2: ● Debian Wheezy, Jessie, Sid: sudo apt-get install libzmq-dev ● Debian Squeeze backport: http://packages.debian.org/squeeze- backports/libzmq1
  • 13. Install NodeJS bindings NPM Packages: ● zmq (https://github.com/JustinTulloss/zeromq.node) [RECOMMENDED] ● zmq-stream (https://github.com/Schoonology/zmq-stream) npm install zmq node > var zmq = require('zmq');
  • 14. Install Bindings in other languages Ruby: https://github.com/chuckremes/ffi-rzmq [RECOMMENDED] Python: https://github.com/zeromq/pyzmq Erlang: https://github.com/zeromq/erlzmq2 Java JZMQ (uses JNI): https://github.com/zeromq/jzmq Java JeroMQ: https://github.com/zeromq/jeromq Scala ZeroMQ: https://github.com/mDialog/scala-zeromq Scala ZeroMQ (official): https://github.com/valotrading/zeromq-scala-binding ...
  • 16. Sockets Creation (*) http://api.zeromq.org/3-2:zmq-socket ØMQ C API NodeJS ZMQ req ZMQ_REQ rep ZMQ_REP dealer ZMQ_DEALER router ZMQ_ROUTER push ZMQ_PUSH pull ZMQ_PULL ØMQ C APINodeJS ZMQ pub ZMQ_PUB sub ZMQ_SUB xsub ZMQ_XSUB xpub ZMQ_XPUB var sock = zmq.socket ("<SOCKET_TYPE>"); zmq_socket(context, <SOCKET_TYPE>); Request Reply Dealer (async Request) Router (async Reply) Push Pull Publisher Subscriber XSubscriber XPublisher
  • 17. Sockets Bind & Connect sock.bind("tcp://10.0.0.1:5555", function(err) { .. }); sock.connect("tcp://10.0.0.1:5555"); sock.close(); (*) http://api.zeromq.org/3-2:zmq-bind (**) http://api.zeromq.org/3-2:zmq-connect (***) http://api.zeromq.org/3-2:zmq-close ØMQ C API zmq_bind(socket, "tcp://10.0.0.1:5555"); zmq_connect(socket, "tcp://10.0.0.1: 5555"); zmq_close(socket); NodeJS ZMQ Bind Connect Close
  • 18. Sockets Bind & Connect sock.bindSync("tcp://10.0.0.1:5555"); // This line gets executed once the socket // is binded, but it breaks on error. NodeJS ZMQ BindSync
  • 19. Sockets Transports TCP ● usage: tcp://<address>:<port> sock.bind("tcp://192.168.1.100:5555"); sock.bind("tcp://eth0:5555"); // binds to the first eth0 interface sock.bind("tcp://*:5555"); // binds to all interfaces (*) http://api.zeromq.org/3-2:zmq-tcp ØMQ C API zmq_bind(socket, "tcp://192.168.1.100: 5555"); zmq_bind(socket, "tcp://eth0:5555"); zmq_bind(socket, "tcp://*:5555"); NodeJS ZMQ
  • 20. Sockets Transports Inter-Process Communication (IPC) ● usage: ipc://<address> ● Requires RW permissions on the specified path. (*) http://api.zeromq.org/3-2:zmq-ipc sock.bind("ipc:///tmp/mysocket"); ØMQ C API zmq_bind(socket, "ipc:///tmp/mysocket"); NodeJS ZMQ
  • 21. Sockets Transports In-process Communication (in-memory) ● usage: inproc://<address> ● Requires to bind before connect. ● Max. address name length is 256. (*) http://api.zeromq.org/3-2:zmq-inproc (**) Buggy on node-zmq package. sock.bind("inproc://queue"); ØMQ C API zmq_bind(socket, "ipc://queue"); NodeJS ZMQ
  • 22. Sockets Transports PGM (multicast) ● usage: pgm://<address>;<multicast_address>:<port> ● Requires sudo privileges to access raw IP sockets. ● Needs ØMQ built with PGM extension (./configure --with-pgm). (*) http://api.zeromq.org/3-2:zmq-pgm sock.bind( "pgm://192.168.1.100;239.192.1.1:3055" ); ØMQ C API zmq_bind(socket, "pgm://192.168.1.100; 239.192.1.1:3055"); NodeJS ZMQ
  • 23. Sockets Transports Encapsulated PGM (multicast) ● usage: epgm://<address>;<multicast_address>:<port> ● Needs ØMQ built with PGM extension (./configure --with-pgm). (*) http://api.zeromq.org/3-2:zmq-pgm sock.bind( "epgm://192.168.1.100;239.192.1.1:3055" ); ØMQ C API zmq_bind(socket, "epgm://192.168.1.100; 239.192.1.1:3055"); NodeJS ZMQ
  • 24. Sockets Send & Receive Send sock.send("My message"); sock.on("message", function(msg) { console.log(msg.toString()); }); (*) http://api.zeromq.org/3-2:zmq-send (**) http://api.zeromq.org/3-2:zmq-recv Receive sock.on("message", function(msg) { console.log("Received " + msg); }); // <msg> is a Buffer object.
  • 25. Sockets Multipart messages ØMQ Queue zmq_send(socket, "Como", 4, ZMQ_SNDMORE); Messages are atomic A ØMQ message is composed of 1 or more message parts. zmq_send(socket, "andas", 5, 0); 4 ComoPart 1 5 andasPart 2 ØMQ ensures that peers receive either all message parts of a message or none at all. The total number of message parts is unlimited except by available memory.
  • 26. Sockets Multipart messages sock.send("First part", zmq.ZMQ_SNDMORE); sock.send("Second part"); sock.send(["First part", "Second part"]); Send var r = sock.send("Como", zmq. ZMQ_SNDMORE); console.log(r); Check the outgoing buffer and socket state: running this will output -> > { type: 'req', _zmq: { state: 0, onReady: [Function] }, _outgoing: [ [ <Buffer 43 6f 6d 6f>, 2 ] ], _shouldFlush: true, _events: { message: [Function] } }
  • 27. Sockets Multipart messages sock.on("message", function(first_part, second_part) { console.log(first_part.toString()); console.log(second_part.toString()); }); sock.on("message", function() { for(var key in arguments) { console.log("Part " + key + ": " + arguments[key]); }; }); Receive sock.on("message", function() { var messages = Array.prototype.slice.call(arguments); messages.forEach(function(msg) { console.log("Part:" + msg); }); });
  • 28. Sockets Batched messaging ØMQ Queue 3 Msg "ØMQ batches messages in opportunistic manner. It sends all the messages available at the moment in one go. Latency of subsequent messages will be improved because sending single batch to the card is faster then sending lot of small messages." sock.send("Part A", zmq.ZMQ_SNDMORE); sock.send("Msg"); sock.send("Part B"); 6 Part A 6 Part B ØMQ Socket send send send <write busy> <write ready> Client Thread ØMQ I/O Thread send batch <write busy>
  • 29. Patterns Plugging multiple transports Example var zmq = require('zmq'), pub = zmq.socket('pub'); pub.bindSync('tcp://127.0.0.1:5555'); pub.bindSync('ipc:///tmp/zmq.sock'); setInterval(function() { pub.send("I am polyglot!"); }, 1000); sub = zmq.socket('sub'); sub.connect('ipc:///tmp/zmq.sock'); sub.subscribe(''); sub.on('message', function(msg) { console.log("Received: " + msg); }); var zmq = require('zmq'), sub = zmq.socket(sub'); sub.connect('tcp://127.0.0.1:5555'); sub.subscribe(''); sub.on('message', function(msg) { console.log(Received: ' + msg); });
  • 30. Sockets Setting Socket Options (*) http://api.zeromq.org/3-2:zmq-setsockopt Setsockopt ● usage (NodeJS ZMQ API): sock.setsockopt(<option>, <value>); or sock.<option> = <value>; sock.identity = 'monitor-1'; sock.setsockopt('identity', 'monitor-1'); Identity: // value can be any string up to 255 length. // identity is required on sockets // connecting to a Router.
  • 31. Sockets Setting Socket Options Setsockopt subscriber.subscribe('MUSIC'); subscriber.setsockopt('subscribe', 'MUSIC'); Subscribe: // sets a message filter for subscriber sockets. subscriber.unsubscribe('MUSIC'); susbscriber.setsockopt('subscribe', 'POP'); Unsubscribe: // sets off a message filter for subscriber sockets.
  • 33. Patterns Request / Reply Synchronous task distribution Ø REP #1 Ø REP # 2 Ø REQ < round robin > ... < synchronous > Used when each message needs to be matched with a response. Handles only one message at time. Strict send-recv cycle.
  • 34. Patterns Request / Reply Ø REP #1 Ø REP # 2Ø REQ send recv (wait response) send recv (dont wait response) recv (dont wait response)
  • 35. Patterns Request / Reply Ø REP #1 Ø REP # 2Ø REQ send recv recv send send -> REP #1 is down FAILURE REQ #1 will not recover !
  • 36. Patterns Request / Reply Basic Request / Reply var zmq = require('zmq'); reply = zmq.socket('rep'); reply.bind('tcp://127.0.0.1:5555', function(err) { if (err) throw err; } ); reply.on('message', function(msg) { console.log('Received: ' + msg); reply.send('Pong!'); }); var zmq = require('zmq'); request = zmq.socket('req'); request.connect('tcp://127.0.0.1:5555'); request.send('Ping'); request.on('message', function(msg) { console.log('Response: ' + msg); });
  • 37. Patterns Request / Reply Dealer socket message delivery Messages have to be multipart, consisting on: an empty delimiter header, followed by the content body parts. sock.send("Body"); Outgoing Queue 0 6 Body sock.send(new Buffer([]), zmq. ZMQ_SNDMORE); send send
  • 38. Patterns Request / Reply Dealer socket message delivery Outgoing messages are round-robined among all connected peers. However, sending depends on the availability of the receiver. sock.send( ["", "Msg"]); Outgoing Queue 3 Msg 6 Part A Peer Socket A Peer Socket B sock.send( ["", "Bla"); sock.send( ["", "Msg2"]); send send send To A To B To A send <write ready> <write busy> <write ready> 0 0 4 Msg2 0
  • 39. Patterns Request / Reply Dealer socket message delivery Reconnections are handled automatically: messages are asynchronously delivered. Response time does not block sending more messages. Outgoing Queue Peer Socket A Peer Socket B send -> Up again sock.send( ["", "Msg"]); 3 Msg sock.send( ["", "Msg2"]); send send To A To A 0 4 Msg2 0
  • 40. Patterns Request / Reply Ø REP #1 Ø REP # 2Ø DEALER enqueue < Msg A > send < Msg B > -> REP #1 is down enqueue < Msg C > send < Msg A, Msg C > send < Msg D > Dealer socket handles peer reconnection automatically. It will send messages that queued for that peer once it has established connection.
  • 41. Patterns Request / Reply > Response from: 5001 > Response from: 5001 > Response from: 5002 > Response from: 5001 > Response from: 5001 > Response from: 5002 > ... Dealer example var dealer = zmq.socket('dealer'); dealer.connect('tcp://127.0.0.1:5001'); dealer.connect('tcp://127.0.0.1:5002'); setInterval(function() { dealer.send(["", "Msg"]); }, 1000); dealer.on('message', function(h, msg) { console.log('Response from: ' + msg); }); running this 'might' output ->
  • 42. Patterns Request / Reply Router socket messaging Messages have to be multipart, consisting on: an identity frame, an empty delimiter frame, followed by the content body parts. This applies to both incoming and outgoing messages. sock.send("Body"); Outgoing Queue 0 6 Body sock.send("", zmq. ZMQ_SNDMORE); send send sock.send( "worker-1", zmq. ZMQ_SNDMORE); 8 worker-1 send
  • 43. Patterns Request / Reply Router is asynchronous Incoming messages are fair-queued among all connected and available peers. Peer Socket A Peer Socket B ØMQ Router Incoming Queue Socketsend send send
  • 44. Patterns Request / Reply Router is asynchronous Receiving depends on the availability of the sender. Peer Socket A Peer Socket B ØMQ Router Incoming Queue Socketsend send
  • 45. Patterns Push / Pull Unidirectional data distribution The Push / Pull pattern fits well on pipelined communication, i.e., when no response is required for a given message. Ø Ø ... ØØ
  • 46. Patterns Push / Pull Binding the Push socket Outgoing messages are round-robined among all connected and available peers. push.send("Msg"); push.send("Part B"); Outgoing Queue Peer Socket A Peer Socket B push.send("Part A", zmq.ZMQ_SNDMORE); push.send("Msg2"); 3 Msg 6 Part A 6 Part B 4 Msg2 send send send send
  • 47. Patterns Push / Pull Binding the Push socket Outgoing messages are round-robined among all connected and available peers. Outgoing Queue Peer Socket A Peer Socket B -> Down3 Msg 6 Part A 6 Part B 4 Msg2 send send send push.send("Msg"); push.send("Part B"); push.send("Part A", zmq.ZMQ_SNDMORE); push.send("Msg2"); send send send send
  • 48. Patterns Push / Pull Binding the Push socket Disconnections and reconnections are handled automatically. Outgoing Queue Peer Socket A Peer Socket B 4 More 6 Part 1 6 Part 2 5 Other send send send push.send("More"); send push.send("Part 2"); push.send("Part 1", zmq.ZMQ_SNDMORE); send send push.send("Other"); send
  • 49. Patterns Push / Pull Parallel task distribution Ø PULL #1 Ø PULL # 2 Ø PUSH < round robin > ...
  • 50. Patterns Push / Pull Passive agents / Monitor Ø PULLØ PUSH ... Ø PUSH
  • 51. Patterns Push / Pull Binding the Pull socket Push's outgoing messages are round-robined among all connected peers. push.send("Msg"); push.send("Part B"); Outgoing Queue Peer Socket A Peer Socket B push.send("Part A", zmq.ZMQ_SNDMORE); push.send("Msg2"); send send send send 3 Msg 6 Part A 6 Part B 4 Msg2 To A To B To A
  • 52. Patterns Push / Pull Binding the Pull socket Push's outgoing messages are round-robined among all connected peers. push.send("Msg"); push.send("Part B"); Outgoing Queue Peer Socket A Peer Socket B push.send("Part A", zmq.ZMQ_SNDMORE); push.send("Msg2"); send send send send send send send 3 Msg 6 Part A 6 Part B 4 Msg2 To A To B To A
  • 53. Patterns Push / Pull Binding the Pull socket Disconnections and reconnections are handled automatically. Outgoing Queue Peer Socket A Peer Socket B send send -> Down4 More 6 Part 1 6 Part 2 5 Other To A To A To B push.send("More"); send push.send("Part 2"); push.send("Part 1", zmq.ZMQ_SNDMORE); send send push.send("Other"); send
  • 54. Patterns Push / Pull Binding the Pull socket Sending is asynchronous, it depends on the availability of the receiver. Outgoing Queue Peer Socket A Peer Socket B send -> Up again 5 OtherTo B push.send("More"); send push.send("Part 2"); push.send("Part 1", zmq.ZMQ_SNDMORE); send send push.send("Other"); send
  • 55. Patterns Push / Pull Ø PULLØ PUSH #1 ... Ø PUSH #2 Active agents / collector pattern
  • 56. Patterns Publish / Subscribe Broadcast data distribution Ø SUB #1 Ø PUB #1 ... Ø SUB #2 Ø SUB #2
  • 57. Message distribution Patterns Publish / Subscribe sock.send("Msg"); Outgoing Queue 3 Msg Subscriber A Subscriber B send send Outgoing messages are send to each connected and available peers. Subscriber C
  • 58. Message distribution Patterns Publish / Subscribe sock.send("Msg"); Outgoing Queue 3 Msg Subscriber A Subscriber B send send Outgoing messages are send to each connected and available peers. Subscriber C 5 Othersock.send("Other"); send
  • 59. Subscribers can register to a specific topic. Data filtering Patterns Publish / Subscribe ØMQ Publisher Subscriber A Subscriber B Subscriber C Outgoing Queue subscribe AR subscribe VE Socket subscribe VE
  • 60. Subscribers can register to a specific topic. Data filtering Patterns Publish / Subscribe ØMQ Publisher Subscriber A Subscriber B Subscriber C Outgoing Queue subscribe AR subscribe VE Socket subscribe VE sock.send("AR news"); send 7 AR news send
  • 61. Subscribers can register to a specific topic. Data filtering Patterns Publish / Subscribe ØMQ Publisher Subscriber A Subscriber B Subscriber C Outgoing Queue subscribe AR subscribe VE Socket subscribe VE sock.send("VE news"); send 7 VE news sendsend
  • 62. Patterns Publish / Subscribe Data filtering example pub = zmq.socket('pub'); pub.bindSync("tcp://10.0.0.12:3055"); count = 0 setInterval(function() { pub.send("TEST " + count++); }, 1000); sub = zmq.socket('sub'); sub.connect("tcp://10.0.0.12:3055"); sub.subscribe("TEST"); sub.on("message", function(msg) { console.log("Received: " + msg); }); // older messages won't be // received > TEST 6 > TEST 7 > TEST 8 > TEST 9 > TEST 10 running this 'might' output ->
  • 63. Patterns Publish / Subscribe Multicast example var zmq = require('zmq'), pub = zmq.socket('pub'); pub.bind( "epgm://10.0.0.12;239.192.1.1:3055", function(err) { if(err) throw err; } ) setInterval(function() { pub.send("From pid: " + process.pid); }, 1000); var zmq = require('zmq'), sub = zmq.socket('sub'); sub.connect( "epgm://10.0.0.13;239.192.1.1:3055" ); sub.subscribe(""); sub.on('message', function(msg) { console.log("Received " + msg); }); (*) See running demo at http://youtu.be/NQrH0SATPk0
  • 64. "XSUB and XPUB are exactly like SUB and PUB except they expose subscriptions as special messages." Data distribution proxy Patterns XSUB / XPUB XSUB/XPUB Proxy Subscriber A Subscriber B Subscriber C XPUB Socket XSUB Socket Publisher A Publisher B Publisher C subscribe PY forward subscription
  • 65. Messages are forwarded by the proxy to the registered subscribers. Data distribution proxy Patterns XSUB / XPUB XSUB/XPUB Proxy Subscriber A Subscriber B Subscriber C XPUB Socket XSUB Socket Publisher A Publisher B Publisher C forward message send "PY<msg>" send
  • 69. Useful Links Pieter Hintjens personal blog http://hintjens.com/