building a reliable messaging infrastructure with apache activemq · 2008-09-17 · apache...

46
Building a Reliable Messaging Infrastructure with Apache ActiveMQ Bruce Snyder IONA Technologies Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 1

Upload: others

Post on 03-Jun-2020

8 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

Building a Reliable Messaging Infrastructure with Apache ActiveMQBruce SnyderIONA Technologies

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 1

Page 2: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

Do You JMS?

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 2

Page 3: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

A Crash Course in Messaging

Loosely coupled vs. tightly coupled - The loosely coupled exchange of messages - Producers and consumers are not aware of one another - Communication is indirect via destinations- Synchronous or asynchronous message delivery - Optional features-- Durability -- Persistence -- Transactionality - Understanding message domains is important

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 3

Page 4: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

Point-to-Point Messaging

Analogy: person-to-person email - One-to-one - One consumer per message - Based on queues- Once and only once delivery- Queues retain messages until consumed or expired - Good for load balancing messages - Queue browsing- Partial outages OK

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 4

Page 5: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

Publish-Subscribe Messaging Domain

Analogy: Mailing lists - Based on topics- Publishers and subscribers- Publisher had no knowledge of subscribers - Messages are delivered to all subscribers- Business events, i.e., EDA

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 5

Page 6: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

First Principle of Messaging

There is no absolute comparison to distinguish

Message Oriented Middleware

- All situations are unique in some way - Too many use cases

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 6

Page 7: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

What Are Your Performance Objectives?

- Will you use synchronous or asynchronous messaging? -- Is performance more critical than QOS?- Can your app handle duplicate messages? - Can your app handle missing messages? - Do you need messages to be received in order? - Do you have any slow consumer situations? - Do you know your message requirements? -- What is the average message size? -- How consistent is this size? -- How much can it vary? -- Are there attachments on the messages? -- Are the messages binary or text? -- Will your messages need compression? -- Do all messages need compression?

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 7

Page 8: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

What Trade-Offs Can You Accept?

- Trade-offs are a given -- Speed and reliability are mutually exclusive -- Each comes at a price

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 8

Page 9: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

Common Trade-Offs

Synchronous vs. AsynchronousMessaging

- Synchronous vs. asychronous - Durability and persistence - Transactionality - Message consumption

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 9

Page 10: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

Common Trade-Offs

Durability vs. Persistence

- Durability -- When subscriber goes offline messages are held - Persistence -- Messages held in a persistent data store

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 10

Page 11: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

Common Trade-Offs

Transactions

-- Using them in batches can actually speed up some operations

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 11

Page 12: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

Second Principle of Messaging

Messaging is focused on reliability

more than performance

- Bottlenecks are in the speed bumps, not message destinations

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 12

Page 13: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

Messaging Use Cases Are Still Expanding...

- Integration -- Decoupling --- Level of indirection using messaging as the mediator - Enterprise Service Buses -- High amount of message variability-- Intelligent routing -- Itinerary-based routing -- Content-based routing-- Orchestration (e.g., BPEL) -- Workflow/BPM and BAM-- Complex Event Processing

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 13

Page 14: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

What Is Apache ActiveMQ?

Too many notes on this slide!

- JMS 1.1 compliant - Integration with:-- Geronimo, Spring, Tomcat, JBoss and any J2EE 1.4 container (e.g., WebLogic or WebSphere) - Supported transports -- TCP, UDP, multicast, SSL, HTTP, Jabber (XMPP), JXTA, etc. - Pluggable persistence and security - Wildcards, selectors, composite destinations - Fast and highly scalable - Topologies supported: -- Clustering, peer-to-peer, federated network support- Multi-language clienets:-- Java, C/C++, .NET, Ruby, Perl, PHP, Python

- Minimal configuration

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 14

Page 15: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

Examples Demo

Easily send and receive messages using the

default examples

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 15

Page 16: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

Configuration

(conf/activemq.xml)

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 16

Page 17: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

ActiveMQ Uses URIs

<protocol>://<host>:<port>?<transport-options>

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 17

Page 18: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

Example URIs

vm://localhost?broker.persistent=false

tcp://localhost:61616?jms.useAsyncSend=true

stomp://localhost:61613

failover:(tcp://host1:61616,tcp://host2:61616)?initialReconnectDelay=100

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 18

Page 19: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

ActiveMQ Transports

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 19

Page 20: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

Two Types of Transports

- Client to broker communication-- The <transportConnector> element - Broker to broker communication -- The <networkConnector> element

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 20

Page 21: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

Message Persistence

- High performance journal- JDBC provider- Kaha provider

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 21

Page 22: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

STOMP Client Demo

Demonstrate using ActiveMQ with the

Ruby STOMP client library

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 22

Page 23: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

A network of brokers provides many choices

Federated network of brokers- Many brokers acting as a single, logical broker - Use network connectors between each other - Store and forward strategy - Brokers use static or discovery based routing- Clients can also use static or discovery based routing

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 23

Page 24: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

Topology Example

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 24

Page 25: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

Topology Example

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 25

Page 26: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

Topology Example

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 26

Page 27: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

Topology Example

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 27

Page 28: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

Topology Example

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 28

Page 29: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

Master/Slave Broker Configurations

- Pure Master/Slave-- Shared nothing, fully replicated topology--- Does not depend on shared filesystem or database-- Slave broker consumes all message states from the Master broker (messages, acks, tx states) -- Slave does not start any networking or transport connectors -- Master broker will only respond to client when a message exchange has been successfully passed to the slave broker- Shared Filesystem-- Uses directory on shared filesystem (SAN)- JDBC Master/Slave-- Uses a shared database

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 29

Page 30: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

Message Prefetch

queue = new ActiveMQQueue("TEST.QUEUE?consumer.prefetchSize=10");

consumer = session.createConsumer(queue);

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 30

Page 31: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

Asynch Dispatch

queue = new ActiveMQQueue("FOO.QUEUE?consumer.dispatchAsync=true");

consumer = session.createConsumer(queue);

- Asynchronous message delivery - Configurable on ConnectionFactory, Connection and Consumer - Mostly used for slow consumers

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 31

Page 32: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

Wildcards on Subscriptions

Price.>Price.Stock.>Price.Stock.NASDAQ.*Price.Stock.*.IBM

. separates names in a path * matches any name in the path > matches recursively downward in the path

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 32

Page 33: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

Virtual Destinations

- Logical destinations that map onto one or more physical destinations- Works around the issue of JMS durable subscribers-- Only one thread can be active per clientID and subscriber name -- This works around that by using queue semantics on topics -- http://activemq.apache.org/virtual-destinations.html

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 33

Page 34: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

Exclusive Consumers

queue = new ActiveMQQueue("TEST.QUEUE?consumer.exclusive=true");

consumer = session.createConsumer(queue);

- Anytime more than one consumer consuming from a queue, message order is lost - This feature allows a single consumer to consume all messages on a queue to maintain message ordering

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 34

Page 35: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

Message Groups

- Uses the JMSXGroupID property to define which message group a message belongs - Provides: -- Guarantees ordered processing of related messages across a single queue -- Load balancing of message processing across multiple consumers -- HA/failover if consumer goes down

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 35

Page 36: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

Total Ordering

- Ensures that each consumer will see the same total order of messages on a topic -- This feature is *per broker*

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 36

Page 37: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

Consumer Priority

queue = new ActiveMQQueue("TEST.QUEUE?consumer.priority=10");

consumer = session.createConsumer(queue);

- Just like it sounds -- Gives consumer priority for message delivery- Allows for the weighting of consumers to optimize network traversal for message delivery

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 37

Page 38: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

Retroactive Consumer

queue = new ActiveMQQueue("TEST.QUEUE?consumer.retroactive=true");

consumer = session.createConsumer(queue);

- Normal JMS Consumer with a kicker- Message replay at start of a subscription-- At the start of every subscription, send any old messages that the consumer may have missed - Configurable via timed or fixed size recoveryhttp://activemq.apache.org/retroactive-consumer.html

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 38

Page 39: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

Mirrored Queues

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 39

Page 40: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

Monitoring Brokers and Messages

- jconsole - Hyperic - IONA Fuse HQ - ActiveMQ web console

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 40

Page 41: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

Visualization

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 41

Page 42: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

What is Apache Camel?

- Lightweight implementation of EIP-- http://enterpriseintegrationpatterns.com/

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 42

Page 43: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

What is EIP?

- The bible of integration patterns

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 43

Page 44: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

Example Pattern: Content Based Router

RouteBuilder builder = new RouteBuilder() { public void configure() { from("seda:a").choice().when(header("foo").isEqualTo("bar")).to("seda:b") .when(header("foo").isEqualTo("cheese")).to("seda:c").otherwise().to("seda:d"); }};

- The Java version of the Camel CBR

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 44

Page 45: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

Example Pattern: Content Based Router<camelContext id="buildSimpleRouteWithChoice" xmlns="http://activemq.apache.org/camel/schema/spring"> <route> <from uri="seda:a"/> <choice> <when> <predicate> <header name="foo"/> <isEqualTo value="bar"/> </predicate> <to uri="seda:b"/> </when> <when> <predicate> <header name="foo"/> <isEqualTo value="cheese"/> </predicate> <to uri="seda:c"/> </when> <otherwise><to uri="seda:d"/></otherwise> </choice> </route></camelContext>

- The XML version of the CBR

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 45

Page 46: Building a Reliable Messaging Infrastructure with Apache ActiveMQ · 2008-09-17 · Apache ActiveMQ? Too many notes on this slide! - JMS 1.1 compliant - Integration with:-- Geronimo,

Thank You for Attending

Please fill out your surveys

Colorado Software Summit: October 21 – 26, 2007 © Copyright 2007, IONA Technologies

Bruce Synder — Building a Reliable Messaging Infrastructure with Apache ActiveMQ Slide 46