Top Banner
Distributed Messaging The Administrative Aspect Martin Sústrik www.250bpm.com [email protected]
38

Distributed Messaging The Administrative Aspect · 2019-12-18 · require 'rubygems' require 'ffi-rzmq' context = ZMQ::Context.new socket = context.socket(ZMQ::REP) socket.bind("tcp://*:5559")

Jul 07, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Distributed Messaging The Administrative Aspect · 2019-12-18 · require 'rubygems' require 'ffi-rzmq' context = ZMQ::Context.new socket = context.socket(ZMQ::REP) socket.bind("tcp://*:5559")

Distributed MessagingThe Administrative Aspect

Martin Sústrikwww.250bpm.com

[email protected]

Page 2: Distributed Messaging The Administrative Aspect · 2019-12-18 · require 'rubygems' require 'ffi-rzmq' context = ZMQ::Context.new socket = context.socket(ZMQ::REP) socket.bind("tcp://*:5559")

Distributed Messaging

Page 3: Distributed Messaging The Administrative Aspect · 2019-12-18 · require 'rubygems' require 'ffi-rzmq' context = ZMQ::Context.new socket = context.socket(ZMQ::REP) socket.bind("tcp://*:5559")

Centralised Messaging

Page 4: Distributed Messaging The Administrative Aspect · 2019-12-18 · require 'rubygems' require 'ffi-rzmq' context = ZMQ::Context.new socket = context.socket(ZMQ::REP) socket.bind("tcp://*:5559")

Centralised Messaging

Page 5: Distributed Messaging The Administrative Aspect · 2019-12-18 · require 'rubygems' require 'ffi-rzmq' context = ZMQ::Context.new socket = context.socket(ZMQ::REP) socket.bind("tcp://*:5559")

Distributed Messaging

Page 6: Distributed Messaging The Administrative Aspect · 2019-12-18 · require 'rubygems' require 'ffi-rzmq' context = ZMQ::Context.new socket = context.socket(ZMQ::REP) socket.bind("tcp://*:5559")

Distributed Messaging

Page 7: Distributed Messaging The Administrative Aspect · 2019-12-18 · require 'rubygems' require 'ffi-rzmq' context = ZMQ::Context.new socket = context.socket(ZMQ::REP) socket.bind("tcp://*:5559")

Distributed Messaging Implementationwww.zeromq.org

Page 8: Distributed Messaging The Administrative Aspect · 2019-12-18 · require 'rubygems' require 'ffi-rzmq' context = ZMQ::Context.new socket = context.socket(ZMQ::REP) socket.bind("tcp://*:5559")
Page 9: Distributed Messaging The Administrative Aspect · 2019-12-18 · require 'rubygems' require 'ffi-rzmq' context = ZMQ::Context.new socket = context.socket(ZMQ::REP) socket.bind("tcp://*:5559")

require 'rubygems'require 'ffi-rzmq'

context = ZMQ::Context.newsocket = context.socket(ZMQ::REQ)socket.connect('tcp://localhost:5559')

socket.send_string("Hello")puts socket.recv_string ('')

Page 10: Distributed Messaging The Administrative Aspect · 2019-12-18 · require 'rubygems' require 'ffi-rzmq' context = ZMQ::Context.new socket = context.socket(ZMQ::REP) socket.bind("tcp://*:5559")

require 'rubygems'require 'ffi-rzmq'

context = ZMQ::Context.newsocket = context.socket(ZMQ::REP)socket.bind("tcp://*:5559")

while true do request = socket.recv_string ('') socket.send_string("World")end

Page 11: Distributed Messaging The Administrative Aspect · 2019-12-18 · require 'rubygems' require 'ffi-rzmq' context = ZMQ::Context.new socket = context.socket(ZMQ::REP) socket.bind("tcp://*:5559")
Page 12: Distributed Messaging The Administrative Aspect · 2019-12-18 · require 'rubygems' require 'ffi-rzmq' context = ZMQ::Context.new socket = context.socket(ZMQ::REP) socket.bind("tcp://*:5559")
Page 13: Distributed Messaging The Administrative Aspect · 2019-12-18 · require 'rubygems' require 'ffi-rzmq' context = ZMQ::Context.new socket = context.socket(ZMQ::REP) socket.bind("tcp://*:5559")

require 'rubygems'require 'ffi-rzmq'

context = ZMQ::Context.newsocket = context.socket(ZMQ::REQ)socket.connect('tcp://192.168.0.1:5559')socket.connect('tcp://192.168.0.2:5559')socket.connect('tcp://192.168.0.3:5559')

while true do socket.send_string("Hello") puts socket.recv_string ('')end

Page 14: Distributed Messaging The Administrative Aspect · 2019-12-18 · require 'rubygems' require 'ffi-rzmq' context = ZMQ::Context.new socket = context.socket(ZMQ::REP) socket.bind("tcp://*:5559")
Page 15: Distributed Messaging The Administrative Aspect · 2019-12-18 · require 'rubygems' require 'ffi-rzmq' context = ZMQ::Context.new socket = context.socket(ZMQ::REP) socket.bind("tcp://*:5559")

require 'rubygems'require 'ffi-rzmq'

context = ZMQ::Context.newsocket = context.socket(ZMQ::PUB)socket.bind("tcp://*:5559")

while true socket.send_string("Hello") sleep (1)end

Page 16: Distributed Messaging The Administrative Aspect · 2019-12-18 · require 'rubygems' require 'ffi-rzmq' context = ZMQ::Context.new socket = context.socket(ZMQ::REP) socket.bind("tcp://*:5559")

require 'rubygems'require 'ffi-rzmq'

context = ZMQ::Context.newsocket = context.socket(ZMQ::SUB)socket.connect("tcp://srv.example.org:5559")

socket.setsockopt(ZMQ::SUBSCRIBE, "")

while true do puts socket.recv_string ('')end

Page 17: Distributed Messaging The Administrative Aspect · 2019-12-18 · require 'rubygems' require 'ffi-rzmq' context = ZMQ::Context.new socket = context.socket(ZMQ::REP) socket.bind("tcp://*:5559")
Page 18: Distributed Messaging The Administrative Aspect · 2019-12-18 · require 'rubygems' require 'ffi-rzmq' context = ZMQ::Context.new socket = context.socket(ZMQ::REP) socket.bind("tcp://*:5559")

ExampleMultiplayer Game

Page 19: Distributed Messaging The Administrative Aspect · 2019-12-18 · require 'rubygems' require 'ffi-rzmq' context = ZMQ::Context.new socket = context.socket(ZMQ::REP) socket.bind("tcp://*:5559")
Page 20: Distributed Messaging The Administrative Aspect · 2019-12-18 · require 'rubygems' require 'ffi-rzmq' context = ZMQ::Context.new socket = context.socket(ZMQ::REP) socket.bind("tcp://*:5559")
Page 21: Distributed Messaging The Administrative Aspect · 2019-12-18 · require 'rubygems' require 'ffi-rzmq' context = ZMQ::Context.new socket = context.socket(ZMQ::REP) socket.bind("tcp://*:5559")
Page 22: Distributed Messaging The Administrative Aspect · 2019-12-18 · require 'rubygems' require 'ffi-rzmq' context = ZMQ::Context.new socket = context.socket(ZMQ::REP) socket.bind("tcp://*:5559")
Page 23: Distributed Messaging The Administrative Aspect · 2019-12-18 · require 'rubygems' require 'ffi-rzmq' context = ZMQ::Context.new socket = context.socket(ZMQ::REP) socket.bind("tcp://*:5559")

The Administrative Aspect

Page 24: Distributed Messaging The Administrative Aspect · 2019-12-18 · require 'rubygems' require 'ffi-rzmq' context = ZMQ::Context.new socket = context.socket(ZMQ::REP) socket.bind("tcp://*:5559")

Message Feeds and Topologies

Page 25: Distributed Messaging The Administrative Aspect · 2019-12-18 · require 'rubygems' require 'ffi-rzmq' context = ZMQ::Context.new socket = context.socket(ZMQ::REP) socket.bind("tcp://*:5559")

Example: Stock Exchange

- Stock Quotes- Trades- Orders & Order Confirmations- Clearing- Statistics- Management- Heartbeats

Page 26: Distributed Messaging The Administrative Aspect · 2019-12-18 · require 'rubygems' require 'ffi-rzmq' context = ZMQ::Context.new socket = context.socket(ZMQ::REP) socket.bind("tcp://*:5559")

Centralised Messaging

Page 27: Distributed Messaging The Administrative Aspect · 2019-12-18 · require 'rubygems' require 'ffi-rzmq' context = ZMQ::Context.new socket = context.socket(ZMQ::REP) socket.bind("tcp://*:5559")

Distributed Messaging

Page 28: Distributed Messaging The Administrative Aspect · 2019-12-18 · require 'rubygems' require 'ffi-rzmq' context = ZMQ::Context.new socket = context.socket(ZMQ::REP) socket.bind("tcp://*:5559")

Monitoring

Page 29: Distributed Messaging The Administrative Aspect · 2019-12-18 · require 'rubygems' require 'ffi-rzmq' context = ZMQ::Context.new socket = context.socket(ZMQ::REP) socket.bind("tcp://*:5559")

Traffic Shaping

access-list 100 permit tcp any any eq 33333class-map match-any port33333 match access-group 100policy-map port33333 class port33333 bandwidth 5120interface Ethernet0 service-policy output port33333

5120 kb/sec

TCP port 33333, i.e. stock quotes

Page 30: Distributed Messaging The Administrative Aspect · 2019-12-18 · require 'rubygems' require 'ffi-rzmq' context = ZMQ::Context.new socket = context.socket(ZMQ::REP) socket.bind("tcp://*:5559")
Page 31: Distributed Messaging The Administrative Aspect · 2019-12-18 · require 'rubygems' require 'ffi-rzmq' context = ZMQ::Context.new socket = context.socket(ZMQ::REP) socket.bind("tcp://*:5559")
Page 32: Distributed Messaging The Administrative Aspect · 2019-12-18 · require 'rubygems' require 'ffi-rzmq' context = ZMQ::Context.new socket = context.socket(ZMQ::REP) socket.bind("tcp://*:5559")

What's next?

Page 33: Distributed Messaging The Administrative Aspect · 2019-12-18 · require 'rubygems' require 'ffi-rzmq' context = ZMQ::Context.new socket = context.socket(ZMQ::REP) socket.bind("tcp://*:5559")

Monitoring?

Page 34: Distributed Messaging The Administrative Aspect · 2019-12-18 · require 'rubygems' require 'ffi-rzmq' context = ZMQ::Context.new socket = context.socket(ZMQ::REP) socket.bind("tcp://*:5559")

Monitoring?

Page 35: Distributed Messaging The Administrative Aspect · 2019-12-18 · require 'rubygems' require 'ffi-rzmq' context = ZMQ::Context.new socket = context.socket(ZMQ::REP) socket.bind("tcp://*:5559")

Hardware?

Page 36: Distributed Messaging The Administrative Aspect · 2019-12-18 · require 'rubygems' require 'ffi-rzmq' context = ZMQ::Context.new socket = context.socket(ZMQ::REP) socket.bind("tcp://*:5559")
Page 37: Distributed Messaging The Administrative Aspect · 2019-12-18 · require 'rubygems' require 'ffi-rzmq' context = ZMQ::Context.new socket = context.socket(ZMQ::REP) socket.bind("tcp://*:5559")

Distibuted Debugger?

Page 38: Distributed Messaging The Administrative Aspect · 2019-12-18 · require 'rubygems' require 'ffi-rzmq' context = ZMQ::Context.new socket = context.socket(ZMQ::REP) socket.bind("tcp://*:5559")

Martin Sústrikwww.250bpm.com

[email protected]

Questions?