Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

ActiveMQ 5.9.x new features

8,525 views

Published on

Presented at the Phoenix JUG (Java User's Group)

Published in: Technology

ActiveMQ 5.9.x new features

  1. 1. 11 Apache ActiveMQ 5.9.x and Apache Apollo Christian Posta Senior Consultant and Architect 09/11/13
  2. 2. 2 • Apache ActiveMQ • New features! • Demos • Apache ActiveMQ Apollo Agenda for the night
  3. 3. 3 Your speaker Christian Posta Blog: http://christianposta.com/blog Email: ceposta@apache.org Twitter: @christianposta • Senior Consultant and Architect at Red Hat (formerly FuseSource) • Committer at Apache Software Foundation: ActiveMQ, Apollo • PMC at ActiveMQ • Author: Essential Camel Components DZone Refcard • Contributor to Apache Camel
  4. 4. 44 Apache ActiveMQ
  5. 5. 5 • 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
  6. 6. 6 • High performance • High availability • Light-weight • Multi-protocol • JMS compliant • Backed by Red Hat! ActiveMQ Features
  7. 7. 7 • TCP, NIO • UDP • SSL, SSL+NIO • VM • HTTP • WebSockets Breadth of connectivity
  8. 8. 8 • OpenWire • STOMP 1.0, 1.1, 1.2 • MQTT 3.1 • AMQP 1.0 Breadth of connectivity
  9. 9. 9 • Asynchronous architectures • Reliable message passing • Loose coupling • Heterogeneous integration • Real-time data When to use ActiveMQ
  10. 10. 10 10 ActiveMQ 5.9.0
  11. 11. 11 • AMQP 1.0 protocol • REST management with Jolokia • Pure master slave deprecated and removed • Java 7 support • Split up client libs, modularize core packages Quick recap of 5.8.0 release
  12. 12. 12 • Fall 2013 • New, faster, default file-based store • Persistence store HA replication • New management console, HawtIO • New “broker:” Camel component • Other new features ActiveMQ 5.9 on its way!
  13. 13. 13 13 Default file-based store
  14. 14. 14 • LevelDB • Hardened • JNI (native) and Java versions • Java version packaged by default https://github.com/dain/leveldb • Can download http://code.google.com/p/leveldb/downloads/list Default in 5.9.0 – LevelDB
  15. 15. 15 • AMQ Message Store (deprecated!!!) Don’t use this one! • KahaDB • LevelDB File-based stores
  16. 16. 16 • Journal / TX Log • Indexes • Recovery Logs File-based stores Index Journal Redo Log X X X X
  17. 17. 17 • Homegrown • Optimized for messaging • TX log, WAL log, Indexes • B-Tree based indexes • Known bottlenecks KahaDB
  18. 18. 18 • Google NoSQL key-value DB http://code.google.com/p/leveldb/ • Based on BigTable • Chrome, Riak, IndexedDB • No relational model, queries, indexes • Store keys sorted LevelDB
  19. 19. 19 • Underlying data structures are optimized for sequential access and lots of writes http://en.wikipedia.org/wiki/Log-structured_merge-tree • Concurrent reads • Pause-less log cleanup • Built-in compression • JMX LevelDB cont’d
  20. 20. 20 LevelDB vs KahaDB
  21. 21. 21 • Makes for very fast store index! • Fewer entries in index • Composite sends only store message once • HDFS support! • Replication!?... LevelDB Store
  22. 22. 22 22 LevelDB Replication
  23. 23. 23 • What is HA!? • JDBC master-slave • Shared file-system master-slave • Pure master-slave (deprecated! don’t use!) Recap – ActiveMQ HA
  24. 24. 24 • LevelDB non-shared distributed replication! • What is it? New in 5.9.0 – ActiveMQ HA
  25. 25. 25 • Failover • failover(tcp://host1:61616,tcp://host2:61616) • Supported in Openwire clients • Java, C#, C++ • Static vs Dynamic discovery Client side HA ActiveMQ Cluster ActiveMQ Client
  26. 26. 26 ActiveMQ – High Availability Broker Slave Client Larry’sRemovals Broker Slave
  27. 27. 27 JDBC Master-Slave Broker Slave Broker Master Client Broker Slave Database
  28. 28. 28 • Extreme reliability – but not as fast • Recommended if already using an enterprise database • No restriction on number of slaves • Simple configuration JDBC Master-Slave
  29. 29. 29 Broker Slave Broker Master Client Broker Slave File System Larry’sRemovals Shared File System M/S
  30. 30. 30 • Recommended if you have a SAN, or DRBD • Ensure file locking works – and times out – NFSv4 good! https://issues.apache.org/jira/browse/AMQ-4378 • No restriction on number of slaves • Simple configuration • Best performance Shared File System M/S
  31. 31. 31 Local File System Local File SystemLocal File System Broker Slave Broker Master Broker Slave ZooKeeper Cluster Replicated LevelDB Master Slave – NEW!
  32. 32. 32 ZooKeeper Cluster Local File System Local File SystemLocal File System Broker Slave Broker Master Client Broker Slave Larry’sRemovals Replicated LevelDB Master Slave
  33. 33. 33 • Requires a HA ZooKeeper Cluster • No Single Point of Failure • Dynamic number of slaves • Sync Replication • Local Mem/Disk • Remote Mem/Disk • Quorum Mem/Disk Replicated LevelDB Master Slave
  34. 34. 34 <broker brokerName="broker" ... > <persistenceAdapter> <replicatedLevelDB directory="activemq-data" replicas="3" bind="tcp://0.0.0.0:0" zkAddress="zoo1.org:2181,zoo2.org:2181,zoo3.org:2181" zkPassword="password" zkPath="/activemq/leveldb-stores” /> </persistenceAdapter> </broker> Replicated LevelDB Config
  35. 35. 3535 Demo
  36. 36. 36 36 New Management Console
  37. 37. 37 Old Web Console
  38. 38. 38 • 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
  39. 39. 39 • Default ActiveMQ dashboard • 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
  40. 40. 40
  41. 41. 41 Demo time… Camel help <route> <from uri="timer://foo? fixedRate=true&amp;period=5000"/> <transform> <simple>The time is: ${date:now:HH:mm:ss}</simple> </transform> <to uri="activemq:example.A" /> <to uri="activemq:time.me.out?timeToLive=5000"/> </route>
  42. 42. 42 Demo time… Camel help <route> <description>Example Camel Route</description> <from uri="activemq:example.A"/> <to uri="activemq:example.B"/> </route>
  43. 43. 4343 Demo
  44. 44. 44 44 New Apache Camel Broker Component
  45. 45. 45 • Virtual Topics • Composite Destinations <compositeQueue name="MY.QUEUE"> <forwardTo> <queue physicalName="FOO" /> <topic physicalName="BAR" /> </forwardTo> </compositeQueue> • Broker Plugin Destination Interceptors
  46. 46. 46 • Use Apache Camel routes • Creates destination interceptor at runtime • Embed in camel.xml and deploy with ActiveMQ • More powerful than existing interceptors (use when needed) • http://rajdavies.blogspot.com/2013/09/apache-camel-broker-component-for.html? tw Broker component
  47. 47. 47 <route id="setPriority"> <from uri="broker:topic:test.broker”/> <setHeader headerName="JMSPriority"> <constant>9</constant> </setHeader> <to uri="broker:queue:test.broker.component.queue"/> </route> Broker component
  48. 48. 48 48 Other Changes
  49. 49. 49 • MQTT over WebSocket – https://issues.apache.org/jira/browse/AMQ-4617 • Slow consumer policy – https://issues.apache.org/jira/browse/AMQ-4621 • AMQP hardening – multiple jiras • Restart on lost lock – https://issues.apache.org/jira/browse/AMQ-4526 Other notes for 5.9.0 release
  50. 50. 50 • Checkout the ActiveMQ wiki: http://activemq.apache.org • Mailing list: users@activemq.apache.org • My Blog: http://christianposta.com/blog • Books: ActiveMQ in Action – Dejan Bosanac, Rob Davies Instant ActiveMQ Messaging Application Development – Tim Bish Wrap up ActiveMQ 5.9.0
  51. 51. 5151 Apache ActiveMQ Apollo
  52. 52. 5252 QuestionsQuestions andand DiscussionDiscussion

×