Polyglot Messaging with Apache ActiveMQ
-
Upload
ceposta -
Category
Technology
-
view
1.162 -
download
5
description
Transcript of Polyglot Messaging with Apache ActiveMQ
![Page 1: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/1.jpg)
1 1
Polyglot messaging with
Apache ActiveMQ
Christian Posta Principal Consultant and Architect 11/09/13
![Page 2: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/2.jpg)
2
• Polyglot messaging
• Changing landscapes
• Apache ActiveMQ • STOMP
• MQTT
• Network of Brokers
• Large-scale management
• Questions?
Agenda
![Page 3: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/3.jpg)
3
Your speaker Christian Posta Blog: http://christianposta.com/blog
Twitter: @christianposta
Email: [email protected]
• Principal Consultant and Architect at Red Hat (FuseSource)
• Based in Phoenix, AZ
• Committer on Apache Camel, ActiveMQ, Apollo
• PMC on ActiveMQ
• Author: Essential Camel Components DZone Refcard
![Page 4: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/4.jpg)
4 4
Polyglot messaging
![Page 5: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/5.jpg)
5
Polyglot Messaging?!
adjective: “knowing or using several languages”
![Page 6: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/6.jpg)
6
Messaging
P
C
Broker C
C
Message
Message
![Page 7: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/7.jpg)
7
Integration?
![Page 8: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/8.jpg)
8
• Off the shelf? Home Grown? Acquisition? • Platforms • Protocols / Data Formats • Data Formats • Timing • Organizational mismatch
Why is integration hard?
![Page 9: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/9.jpg)
9
• Batch file transfers • Shared Database • RPC • Messaging
Integration Options
![Page 10: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/10.jpg)
10
• Asynchronous architectures
• Reliable message passing
• Loose coupling
• Heterogeneous integration
• Real-time data
Why messaging?
![Page 11: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/11.jpg)
11 11
Changing landscapes
![Page 12: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/12.jpg)
12
Head Office
Example of Distributed Application Integration
STORE
STORE
outlet
shop
24 houra
STORE
shop
Broker Clusters
![Page 13: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/13.jpg)
13
Ingestion for BigData Architecture
Broker Cluster
Broker Cluster
Web Servers
Web Servers
Web Servers
Web Servers
Camel HTTP Log
Reader
Camel HTTP Log
Reader
Camel HTTP Log
Reader
Camel HTTP Log
Reader
ESB
ESB
Camel HBase/HDFS
Camel Hbase/HDFS
HDFS
![Page 14: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/14.jpg)
14
M2M Deployments
Connecting Things
• mobile devices • meters • industrial controls • smart buildings • asset tracking • traffic control • monitors • sensors • actuators
Broker Clusters
Arrival Airport 1
![Page 15: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/15.jpg)
15 15
Apache ActiveMQ
![Page 16: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/16.jpg)
16
• The most widely used open-source
messaging broker
• Highly configurable
• Friendly license (no license fees!)
• Vibrant community (TLP)
• Backbone of top enterprises in retail, e-retail,
financial services, shipping, many others!
Apache ActiveMQ
![Page 17: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/17.jpg)
17
Broker Architecture
![Page 18: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/18.jpg)
18
Broker Architecture
![Page 19: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/19.jpg)
19
• TCP, NIO
• UDP
• SSL, SSL+NIO
• VM
• HTTP
• WebSockets
Connectivity: Transports
![Page 20: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/20.jpg)
20
• OpenWire
• STOMP 1.0, 1.1, 1.2
• MQTT 3.1
• AMQP 1.0
Connectivity: Protocols
![Page 21: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/21.jpg)
21 21
STOMP
![Page 22: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/22.jpg)
STOMP – what it is?
• http://stomp.github.com • Simple Text Orientated Messaging Protocol • HTTP for the messaging realm
![Page 23: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/23.jpg)
STOMP
• “Simple!” • A lot of “polyglot” APIs
• Ruby - https://rubygems.org/gems/stomp • Python - https://pypi.python.org/pypi/stompy • PHP - http://pecl.php.net/package/stomp • JavaScript - http://jmesnil.net/stomp-websocket/doc/ • Perl - http://search.cpan.org/dist/Net-STOMP-Client/
• Implemented • ActiveMQ • Apollo • HornetQ • RabbitMQ
![Page 24: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/24.jpg)
STOMP Connect
CONNECT!
login: ceposta!
passcode: ActiveMQRocks!
!
^@!
![Page 25: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/25.jpg)
STOMP Sending
SEND!destination: /queue/order.books!reply-to: /tempQueue/Christian!correlation-id: 900145!amazonSecurityToken: 1bc2345!amazonCustomerRating: gold!!<order id=“123” customer=“ceposta”>! <book isbn=“1234” />! <book isbn=“4567” />!</order>!^@!
![Page 26: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/26.jpg)
STOMP Subscribe
SUBSCRIBE!
destination: /queue/order.books!
!
^@!
![Page 27: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/27.jpg)
Stomp + ActiveMQ
• Available transports • NIO implementation for better scalability • SSL for secure communication
<transportConnectors> <transportConnector name=”stomp" uri=”stomp://0.0.0.0:61613"/> <transportConnector name=”stomp+nio" uri=”stomp+nio://0.0.0.0:61614"/> <transportConnector name=”stomp+ssl" uri=”stomp+ssl://0.0.0.0:61615"/> <transportConnector name=”stomp+nio+ssl"
uri=”stomp+nio+ssl://0.0.0.0:61615"/></transportConnectors>
![Page 28: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/28.jpg)
28 28
MQTT
![Page 29: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/29.jpg)
MQTT • http://mqtt.org/ - MQ Telemetry Transport • Developed by IBM for embedded devices telemetry • IoT (Internet of Things) protocol • Efficient binary protocol
29
![Page 30: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/30.jpg)
MQTT Features • Low bandwidth
• Smallest frame 2 bytes • Unreliable networks • Small footprint • Example frames
• CONNECT • PUBLISH • SUBSCRIBE • PINGREQ/PINGRESP • DISCONNECT
30
![Page 31: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/31.jpg)
MQTT • Publish/subscribe protocol – “topics” “subjects” • 3 QoS Options:
• At Most Once – message loss might occur • At Least Once – duplicates might occur • Exactly Once – guaranteed delivery
31
![Page 32: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/32.jpg)
MQTT + ActiveMQ • Available transports • NIO implementation for better scalability • SSL for secure communication
<transportConnectors> <transportConnector name=”mqtt" uri=”mqtt://0.0.0.0:1883"/> <transportConnector name=”mqtt+nio" uri=”mqtt+nio://0.0.0.0:1884"/> <transportConnector name=”mqtt+ssl" uri=”mqtt+ssl://0.0.0.0:1885"/> <transportConnector name=”mqtt+nio+ssl"
uri=”mqtt+nio+ssl://0.0.0.0:1886"/></transportConnectors>
32
![Page 33: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/33.jpg)
33 33
Network of brokers
![Page 34: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/34.jpg)
34
Local Broker Remote Broker
Store and Forward
![Page 35: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/35.jpg)
35
Store and Forward
![Page 36: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/36.jpg)
36
Store and Forward
![Page 37: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/37.jpg)
37
Head Office
Example retail topology
STORE
STORE
outlet
shop
24 houra
STORE
shop
Broker Clusters
![Page 38: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/38.jpg)
38 38
Large-scale management
![Page 39: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/39.jpg)
39 39
Fuse Fabric
![Page 40: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/40.jpg)
40
Fuse Fabric
![Page 41: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/41.jpg)
41
Fuse Fabric
![Page 42: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/42.jpg)
42 42
HawtIO
![Page 43: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/43.jpg)
43
Old Web Console
![Page 44: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/44.jpg)
44
• Manage integration infrastructure from one dashboard • Customizable • Plugins • Camel • ActiveMQ • Fabric • Infinispan • Tomcat • Many others!
• Visualizations • One dashboard to rule them all
HawtIO – http://hawt.io
![Page 45: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/45.jpg)
45
• Visualization of health
• Access to operations to make changes
• Move messages from DLQ to original destinations
• Visualize Camel routes deployed along with broker
• Send messages
• Real-time metrics
HawtIO – http://hawt.io
![Page 46: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/46.jpg)
46
![Page 47: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/47.jpg)
47
![Page 48: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/48.jpg)
48
• Checkout the ActiveMQ wiki: http://activemq.apache.org
• Mailing list: [email protected]
• My Blog: http://christianposta.com/blog
• Books: ActiveMQ in Action – Dejan Bosanac, Rob Davies Instant ActiveMQ Messaging Application Development – Tim Bish
Wrap up
![Page 49: Polyglot Messaging with Apache ActiveMQ](https://reader035.fdocuments.us/reader035/viewer/2022081414/54bad2474a79596b2b8b4639/html5/thumbnails/49.jpg)
49 49
Questions?