ActiveMQ 5.9.x new features

52
1 1 Apache ActiveMQ 5.9.x and Apache Apollo Christian Posta Senior Consultant and Architect 09/11/13

description

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

Transcript of ActiveMQ 5.9.x new features

Page 1: ActiveMQ 5.9.x new features

11

Apache ActiveMQ 5.9.x and

Apache Apollo

Christian PostaSenior Consultant and Architect

09/11/13

Page 2: ActiveMQ 5.9.x new features

2

• Apache ActiveMQ

• New features!

• Demos

• Apache ActiveMQ Apollo

Agenda for the night

Page 3: ActiveMQ 5.9.x new features

3

Your speaker

Christian Posta

Blog: http://christianposta.com/blog

Email: [email protected]

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

Page 4: ActiveMQ 5.9.x new features

44

Apache ActiveMQ

Page 5: ActiveMQ 5.9.x new features

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

Page 6: ActiveMQ 5.9.x new features

6

• High performance

• High availability

• Light-weight

• Multi-protocol

• JMS compliant

• Backed by Red Hat!

ActiveMQ Features

Page 7: ActiveMQ 5.9.x new features

7

• TCP, NIO

• UDP

• SSL, SSL+NIO

• VM

• HTTP

• WebSockets

Breadth of connectivity

Page 8: ActiveMQ 5.9.x new features

8

• OpenWire

• STOMP 1.0, 1.1, 1.2

• MQTT 3.1

• AMQP 1.0

Breadth of connectivity

Page 9: ActiveMQ 5.9.x new features

9

• Asynchronous architectures

• Reliable message passing

• Loose coupling

• Heterogeneous integration

• Real-time data

When to use ActiveMQ

Page 10: ActiveMQ 5.9.x new features

1010

ActiveMQ 5.9.0

Page 11: ActiveMQ 5.9.x new features

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

Page 12: ActiveMQ 5.9.x new features

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!

Page 13: ActiveMQ 5.9.x new features

1313

Default file-based store

Page 14: ActiveMQ 5.9.x new features

14

• LevelDB

• Hardened

• JNI (native) and Java versions

• Java version packaged by defaulthttps://github.com/dain/leveldb

• Can download http://code.google.com/p/leveldb/downloads/list

Default in 5.9.0 – LevelDB

Page 15: ActiveMQ 5.9.x new features

15

• AMQ Message Store (deprecated!!!)

Don’t use this one!

• KahaDB

• LevelDB

File-based stores

Page 16: ActiveMQ 5.9.x new features

16

• Journal / TX Log

• Indexes

• Recovery Logs

File-based stores

Page 17: ActiveMQ 5.9.x new features

17

• Homegrown

• Optimized for messaging

• TX log, WAL log, Indexes

• B-Tree based indexes

• Known bottlenecks

KahaDB

Page 18: ActiveMQ 5.9.x new features

18

• Google NoSQL key-value DBhttp://code.google.com/p/leveldb/

• Based on BigTable

• Chrome, Riak, IndexedDB

• No relational model, queries, indexes

• Store keys sorted

LevelDB

Page 19: ActiveMQ 5.9.x new features

19

• Underlying data structures are optimized for sequential

access and lots of writeshttp://en.wikipedia.org/wiki/Log-structured_merge-tree

• Concurrent reads

• Pause-less log cleanup

• Built-in compression

• JMX

LevelDB cont’d

Page 20: ActiveMQ 5.9.x new features

20

LevelDB vs KahaDB

Page 21: ActiveMQ 5.9.x new features

21

• Makes for very fast store index!

• Fewer entries in index

• Composite sends only store message once

• HDFS support!

• Replication!?...

LevelDB Store

Page 22: ActiveMQ 5.9.x new features

2222

LevelDB Replication

Page 23: ActiveMQ 5.9.x new features

23

• What is HA!?

• JDBC master-slave

• Shared file-system master-slave

• Pure master-slave (deprecated! don’t use!)

Recap – ActiveMQ HA

Page 24: ActiveMQ 5.9.x new features

24

• LevelDB non-shared distributed replication!

• What is it?

New in 5.9.0 – ActiveMQ HA

Page 25: ActiveMQ 5.9.x new features

25

• Failover• failover(tcp://host1:61616,tcp://host2:61616)

• Supported in Openwire clients• Java, C#, C++

• Static vs Dynamic discovery

Client side HA

Page 26: ActiveMQ 5.9.x new features

26

ActiveMQ – High Availability

BrokerSlave

Client

Larry’s Removals

BrokerSlave

Page 27: ActiveMQ 5.9.x new features

27

JDBC Master-Slave

BrokerSlave

BrokerMaster

Client

BrokerSlave

Database

Page 28: ActiveMQ 5.9.x new features

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

Page 29: ActiveMQ 5.9.x new features

29

BrokerSlave

BrokerMaster

Client

BrokerSlave

File System

Larry’s Removals

Shared File System M/S

Page 30: ActiveMQ 5.9.x new features

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

Page 31: ActiveMQ 5.9.x new features

31

Local File System Local File SystemLocal File System

BrokerSlave

BrokerMaster

BrokerSlave

ZooKeeperCluster

Replicated LevelDBMaster Slave – NEW!

Page 32: ActiveMQ 5.9.x new features

32

ZooKeeperCluster

Local File System Local File SystemLocal File System

BrokerSlave

BrokerMaster

Client

BrokerSlave

Larry’s Removals

Replicated LevelDBMaster Slave

Page 33: ActiveMQ 5.9.x new features

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 LevelDBMaster Slave

Page 34: ActiveMQ 5.9.x new features

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 LevelDBConfig

Page 35: ActiveMQ 5.9.x new features

3535

Demo

Page 36: ActiveMQ 5.9.x new features

3636

New Management Console

Page 37: ActiveMQ 5.9.x new features

37

Old Web Console

Page 38: ActiveMQ 5.9.x new features

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

Page 39: ActiveMQ 5.9.x new features

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

Page 40: ActiveMQ 5.9.x new features

40

Page 41: ActiveMQ 5.9.x new features

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>

Page 42: ActiveMQ 5.9.x new features

42

Demo time… Camel help

<route>

<description>Example Camel Route</description>

<from uri="activemq:example.A"/>

<to uri="activemq:example.B"/>

</route>

Page 43: ActiveMQ 5.9.x new features

4343

Demo

Page 44: ActiveMQ 5.9.x new features

4444

New Apache Camel Broker Component

Page 45: ActiveMQ 5.9.x new features

45

• Virtual Topics

• Composite Destinations <compositeQueue name="MY.QUEUE">

            <forwardTo>

              <queue physicalName="FOO" />

              <topic physicalName="BAR" />

            </forwardTo>

          </compositeQueue>

• Broker Plugin

Destination Interceptors

Page 46: ActiveMQ 5.9.x new features

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?spref=

tw

Broker component

Page 47: ActiveMQ 5.9.x new features

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

Page 48: ActiveMQ 5.9.x new features

4848

Other Changes

Page 49: ActiveMQ 5.9.x new features

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

Page 50: ActiveMQ 5.9.x new features

50

• 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 ActiveMQ 5.9.0

Page 51: ActiveMQ 5.9.x new features

5151

Apache ActiveMQ Apollo

Page 52: ActiveMQ 5.9.x new features

5252

QuestionsQuestionsand and DiscussionDiscussion