Enterprise Messaging With Apache Activemq: James Strachan
Enterprise Messaging With Apache Activemq: James Strachan
Apache ActiveMQ
James Strachan
http://macstrac.blogspot.com/
http://open.iona.com/
What is messaging?
Messaging 101
Topics
Queues
What is Apache ActiveMQ?
What is Apache ActiveMQ
http://activemq.apache.org/
Clients
C Java Pike
•Products.Books.Computing.EIP
•Products.Books.Computing.*
•Products.>
Broker Architecture
Message Persistence
Security
Transports
URIs
<protocol>://<host>:<port>?<transport-options>
Examples
tcp://localhost:61616
vm://localhost?broker.persistent=false
Failover
failover:(tcp://host1:61616,tcp://host2:61616)?initialReconnectDelay=100
Wire Formats
•OpenWire
•STOMP
•HTTP / REST
Wire Formats: OpenWire
•binary
CONNECT
login:<username>
passcode:<passcode>
^@
Stomp : Sending
SEND
destination:/queue/orders.books
reply-to:/temporaryQueue/James
correlation-id:4324234
amazonSecurityToken:abc234
amazonCustomerRating:gold
SUBSCRIBE
destination:/queue/orders.books
^@
Stomp : Receive messages
MESSAGE
destination:/queue/orders.books
Message-id:abc123
reply-to:/temporaryQueue/james134
•Pure
•Shared Database
Cool Stuff!
Monitoring
Easy Unit Testing of JMS code
ConnectionFactory factory =
new ActiveMQConnectionFactory(“vm://localhost?broker.persistent=false”);
Visualisation
Prefetch
new ActiveMQQueue("TEST.QUEUE?consumer.prefetchSize=10");
Exclusive Consumers
Message Groups
Total Ordering
Consumer Priority
new ActiveMQQueue("TEST.QUEUE?consumer.priority=10");
Virtual Destinations
Mirrored Queues
Enterprise Integration Patterns via Camel
http://activemq.apache.org/camel/
Bridge to other protocols
http://activemq.apache.org/camel/components.html
<camelContext xmlns="http://activemq.apache.org/camel/schema/spring">
<route>
<from uri="file://quotes"/>
<filter>
<xpath>/quote/product = ‘widget’</xpath>
<to uri="activemq:WidgetQuotes"/>
</filter>
</route>
</camelContext>
Where do I get more info?
http://activemq.apache.org/
Questions?
James Strachan
blog
http://macstrac.blogspot.com/