Next Generation Open Source Messaging with Apache...

56
1 Next Generation Open Source Messaging with Apache Apollo Hiram Chirino Red Hat Engineer Blog: http://hiramchirino.com/blog/ Twitter: @hiramchirino GitHub: https://github.com/chirino Tuesday, February 26, 13

Transcript of Next Generation Open Source Messaging with Apache...

Page 1: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

1

Next Generation Open Source Messaging with

Apache Apollo

Hiram ChirinoRed Hat EngineerBlog: http://hiramchirino.com/blog/Twitter: @hiramchirinoGitHub: https://github.com/chirino

Tuesday, February 26, 13

Page 2: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

2

About me

Hiram ChirinoBlog: http://hiramchirino.com/blog/Twitter: @hiramchirinoGitHub: https://github.com/chirino

Engineer at Red Hat Apache Committer on: ActiveMQ, Camel,

Karaf, ServiceMix, Geronimo, Felix, and Aries Apache Member and ActiveMQ PMC Chair Co-Founder of many other OS projects:

• HawtDispatch, Scalate, LevelDBJNI, Jansi, And many more!

Tuesday, February 26, 13

Page 3: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

3

Outline

What is Apache Apollo?

What makes it different?

What’s the trajectory?

Tuesday, February 26, 13

Page 4: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

4

What is Apache Apollo?

Messaging Server:•Queues •Topics•Transactions•Reliable Messaging

Tuesday, February 26, 13

Page 5: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

5

Queues: Point-to-Point

Tuesday, February 26, 13

Page 6: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

5

Queues: Point-to-Point

Tuesday, February 26, 13

Page 7: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

5

Queues: Point-to-Point

Tuesday, February 26, 13

Page 8: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

5

Queues: Point-to-Point

Tuesday, February 26, 13

Page 9: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

6

Topics: Publish/Subscribe

Tuesday, February 26, 13

Page 10: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

6

Topics: Publish/Subscribe

Tuesday, February 26, 13

Page 11: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

6

Topics: Publish/Subscribe

Tuesday, February 26, 13

Page 12: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

6

Topics: Publish/Subscribe

Tuesday, February 26, 13

Page 13: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

7

But your happy /w ActiveMQ?

ActiveMQ will be supported for many more years to come!

It will be a long time before Apollo: Supplies all of ActiveMQ’s featuresProvides migration tools

Apollo bits are being back ported

Yay! Stick with it!

Tuesday, February 26, 13

Page 14: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

8

Why use Apollo?

Lower CPU overheadA reduced memory footprintRuntime configuration reloadingREST based management APISimpler Configuration Options

Do you want:

Tuesday, February 26, 13

Page 15: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

9

Plugin Architecture

Apollo Broker

LevelDB

HawtDispatch

AMQP

Protocols

TransportsTCP/SSL

WebSocket/WSS

BDB

Openwire

MQTT

Storage

STOMP

Tuesday, February 26, 13

Page 16: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

10

Transports

•TCP•SSL •WebSockets•Secure WebSockets•UDP

Tuesday, February 26, 13

Page 17: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

11

Protocols

•STOMP 1.0/1.1/1.2•MQTT v3.1•AMQP 1.0•Openwire

Tuesday, February 26, 13

Page 18: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

12

Protocol: STOMP

http://stomp.github.com/Simple Text Orientated Messaging Protocol

Uses Text Headers like HTTPMany Clients APIs in Java, C#, C,

Ruby, Python, JS, PHP, etc.Interoperates with ActiveMQ,

RabbitMQ, HornetQ, …

Tuesday, February 26, 13

Page 19: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

13

Protocol: MQTTGet at https://github.com/fusesource/fuse-

extra/Focused on:

Pub/SubUnreliable, low bandwidth networksSmall footprint / Embedded Devices

Interoperates with WebsphereMQ, Mosquitto, …

Tuesday, February 26, 13

Page 20: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

14

Protocol: AMQP 1.0AMQP is a binary wire protocol which was

designed for interoperability between different vendors.

Supports Queue and Topic semantics.Many native client libraries are available.

Interoperates with ActiveMQ, Qpid, SwitfMQ...

Tuesday, February 26, 13

Page 21: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

15

Protocol: OpenwireOpenwire is the native binary

protocol implemented by ActiveMQ

API options: JMS 1.1 Client of ActiveMQ 5.xNMS Client for C# AppsCMS Client for C++ Apps

Not Yet SupportedXA Transactions (distributed transactions)

Tuesday, February 26, 13

Page 22: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

16

Message StoresAre PluginsShips with 2 Options

•LevelDB Store•BDB Store

Used to store•persistent messages•non-persistent messages that needs to

be swapped out of memory

Also used to swap out non-persistent messages.

Tuesday, February 26, 13

Page 23: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

17

LevelDB Store

A Journal + LevelDB based indexThe pure ASL 2.0 licensed optionUses a JNI implementation on Linux and OS X

Fastest Store availableOn all other platforms a pure Java

implementation is usedNot used as much as the JNI version

LevelDB indexes are awesome for sequential r/w access patterns

Tuesday, February 26, 13

Page 24: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

18

BDB Store

Not ASL 2.0! You have to Agree to the BDB license & download from Oracle.

Pure Java implementationVery robust.

Tuesday, February 26, 13

Page 25: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

19

What makes Apollo Different?

Tuesday, February 26, 13

Page 26: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

20

HawtDispatch

•Event Processing System•Multithreaded Reactor Model•Fixed size Thread Pool /w NIO

event support

Tuesday, February 26, 13

Page 27: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

21

Dispatch Queues

Global Dispatch QueueConcurrently executes Runnable objectsOnly 1 in the system

Serial Dispatch QueueSerially executes Runnable objects Use CAS operations

Thread

Thread

Global Queue:

Serial Queue:

Tuesday, February 26, 13

Page 28: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

22

Serial Dispatch Queues

= Client Connection

Tuesday, February 26, 13

Page 29: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

23

Low Thread Contention...

1 -> 1 -> 1 5 -> 1 -> 5 10 -> 1 -> 10

Tuesday, February 26, 13

Page 30: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

24

Low Memory Overhead... 1000 Producer Connections 1000 Topics 5000 Consumer

Connections

Tuesday, February 26, 13

Page 31: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

25

Why is Apollo using Scala?Java API example:

Same thing in the Scala API:

Terse closures FTW!

queue.execute(new Runnable(){ public void run() { System.out.println("Hi!"); }});

queue { System.out.println("Hi!");}

Tuesday, February 26, 13

Page 32: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

26

Per Consumer Store Prefetch

Tuesday, February 26, 13

Page 33: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

27

Per Consumer Store Prefetch

Tuesday, February 26, 13

Page 34: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

28

Source:http://hiramchirino.com/stomp-benchmark/ubuntu-2600k/index.html

Per Consumer Store Prefetch

Tuesday, February 26, 13

Page 35: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

29

Message Store: Store and Dispatch

Queue

Disk

Producer Consumer

Message Store

Tuesday, February 26, 13

Page 36: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

29

Message Store: Store and Dispatch

Queue

Disk

Producer Consumer

Message Store

Tuesday, February 26, 13

Page 37: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

29

Message Store: Store and Dispatch

Queue

Disk

Producer Consumer

Message Store

Tuesday, February 26, 13

Page 38: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

30

Message Store: Store with No Delay

Queue

Disk

Producer Consumer

Message Store

Tuesday, February 26, 13

Page 39: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

30

Message Store: Store with No Delay

Queue

Disk

Producer Consumer

Message Store

ACK

Tuesday, February 26, 13

Page 40: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

30

Message Store: Store with No Delay

Queue

Disk

Producer Consumer

Message Store

ACK

Tuesday, February 26, 13

Page 41: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

30

Message Store: Store with No Delay

Queue

Disk

Producer Consumer

Message Store

ACK ACK

Tuesday, February 26, 13

Page 42: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

30

Message Store: Store with No Delay

Queue

Disk

Producer Consumer

Message Store

ACK

REMOVE

Tuesday, February 26, 13

Page 43: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

30

Message Store: Store with No Delay

Queue

Disk

Producer Consumer

Message Store

ACK

Tuesday, February 26, 13

Page 44: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

31

Message Store: Store with Delay

Queue

Disk

Producer Consumer

Message Store

Tuesday, February 26, 13

Page 45: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

31

Message Store: Store with Delay

Queue

Disk

Producer Consumer

Message Store

Tuesday, February 26, 13

Page 46: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

31

Message Store: Store with Delay

Queue

Disk

Producer Consumer

Message Store

ACK

Tuesday, February 26, 13

Page 47: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

31

Message Store: Store with Delay

Queue

Disk

Producer Consumer

Message Store

ACK

REMOVE

Tuesday, February 26, 13

Page 48: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

31

Message Store: Store with Delay

Queue

Disk

Producer Consumer

Message Store

ACK

Tuesday, February 26, 13

Page 49: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

31

Message Store: Store with Delay

Queue

Disk

Producer Consumer

Message Store

ACK

Tuesday, February 26, 13

Page 50: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

32

Forget Virtual Destinations!

•Durable subscriptions are implemented with queues.

•Used a mirrored queue to send a copy to the topic with the same name.

Tuesday, February 26, 13

Page 51: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

33 Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. A Progress Software Company

FuseSource Confidential

29

Apollo’s Trajectory

Tuesday, February 26, 13

Page 52: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

34

Features! Features! Features!Back PortedApollo FeaturesLevelDB StoreMQTT ProtocolSTOMP 1.1 Support

Road MapFeatures

Networks of BrokersPriority SupportMessage SchedulingXA TransactionsJMX Management API

Pending Back PortStore Delays

Tuesday, February 26, 13

Page 53: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

35

Release Velocity

1.0 Beta 104/11

1.0 Beta 205/11

1.0 Beta 306/11

1.0 Beta 406/11

1.0 Beta 509/11

1.0 Beta 612/11

1.0 2/12

1.1 3/12

1.2 4/12

03/11 01/12 05/12

1.3 5/12

1.49/12

1.5 11/12

1.6 02/13

01/13

Tuesday, February 26, 13

Page 54: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

36

DEMO

Tuesday, February 26, 13

Page 55: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

37 Copyright © 2011 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. A Progress Software Company

FuseSource Confidential

32

Questions?

Tuesday, February 26, 13

Page 56: Next Generation Open Source Messaging with Apache Apolloarchive.apachecon.com/na2013/presentations/26...Apache Committer on: ActiveMQ, Camel, Karaf, ServiceMix, Geronimo, Felix, and

38

The Link BonanzaApache Apollo

http://activemq.apache.org/apollo/STOMP Benchmarks

http://hiramchirino.com/stomp-benchmark/MQTT Protocol Plugin for Apollo

https://github.com/fusesource/fuse-extraHawtDispatch

http://hawtdispatch.fusesource.org/StompJMS

https://github.com/fusesource/stompjms

Tuesday, February 26, 13