ActiveMQ 5.9.x new features

Post on 27-Jan-2015

127 views 3 download

Tags:

description

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

Transcript of ActiveMQ 5.9.x new features

11

Apache ActiveMQ 5.9.x and

Apache Apollo

Christian PostaSenior Consultant and Architect

09/11/13

2

• Apache ActiveMQ

• New features!

• Demos

• Apache ActiveMQ Apollo

Agenda for the night

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

44

Apache ActiveMQ

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

• High performance

• High availability

• Light-weight

• Multi-protocol

• JMS compliant

• Backed by Red Hat!

ActiveMQ Features

7

• TCP, NIO

• UDP

• SSL, SSL+NIO

• VM

• HTTP

• WebSockets

Breadth of connectivity

8

• OpenWire

• STOMP 1.0, 1.1, 1.2

• MQTT 3.1

• AMQP 1.0

Breadth of connectivity

9

• Asynchronous architectures

• Reliable message passing

• Loose coupling

• Heterogeneous integration

• Real-time data

When to use ActiveMQ

1010

ActiveMQ 5.9.0

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

• 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!

1313

Default file-based store

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

15

• AMQ Message Store (deprecated!!!)

Don’t use this one!

• KahaDB

• LevelDB

File-based stores

16

• Journal / TX Log

• Indexes

• Recovery Logs

File-based stores

17

• Homegrown

• Optimized for messaging

• TX log, WAL log, Indexes

• B-Tree based indexes

• Known bottlenecks

KahaDB

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

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

20

LevelDB vs KahaDB

21

• Makes for very fast store index!

• Fewer entries in index

• Composite sends only store message once

• HDFS support!

• Replication!?...

LevelDB Store

2222

LevelDB Replication

23

• What is HA!?

• JDBC master-slave

• Shared file-system master-slave

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

Recap – ActiveMQ HA

24

• LevelDB non-shared distributed replication!

• What is it?

New in 5.9.0 – ActiveMQ HA

25

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

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

• Static vs Dynamic discovery

Client side HA

26

ActiveMQ – High Availability

BrokerSlave

Client

Larry’s Removals

BrokerSlave

27

JDBC Master-Slave

BrokerSlave

BrokerMaster

Client

BrokerSlave

Database

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

BrokerSlave

BrokerMaster

Client

BrokerSlave

File System

Larry’s Removals

Shared File System M/S

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

Local File System Local File SystemLocal File System

BrokerSlave

BrokerMaster

BrokerSlave

ZooKeeperCluster

Replicated LevelDBMaster Slave – NEW!

32

ZooKeeperCluster

Local File System Local File SystemLocal File System

BrokerSlave

BrokerMaster

Client

BrokerSlave

Larry’s Removals

Replicated LevelDBMaster Slave

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

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

3535

Demo

3636

New Management Console

37

Old Web Console

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

• 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

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

Demo time… Camel help

<route>

<description>Example Camel Route</description>

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

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

</route>

4343

Demo

4444

New Apache Camel Broker Component

45

• Virtual Topics

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

            <forwardTo>

              <queue physicalName="FOO" />

              <topic physicalName="BAR" />

            </forwardTo>

          </compositeQueue>

• Broker Plugin

Destination Interceptors

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

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

4848

Other Changes

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

• 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

5151

Apache ActiveMQ Apollo

5252

QuestionsQuestionsand and DiscussionDiscussion