Enterprise Messaging with Apache ActiveMQ

3,152
-1

Published on

Published in: Technology
0 Comments
6 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
3,152
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
167
Comments
0
Likes
6
Embeds 0
No embeds

No notes for slide

Enterprise Messaging with Apache ActiveMQ

  1. 1. Enterprise Messaging with Apache ActiveMQ James Strachan http://macstrac.blogspot.com/ http://open.iona.com/
  2. 2. What is messaging?
  3. 3. Messaging 101
  4. 4. Topics
  5. 5. Queues
  6. 6. What is Apache ActiveMQ?
  7. 7. What is Apache ActiveMQ http://activemq.apache.org/
  8. 8. Clients C Java Pike C++ JavaScript Python C#/.NET Perl Ruby Flash PHP Smalltalk
  9. 9. Selectors • Provide content based filtering on messages using SQL 92 syntax • Customer = ‘gold’ and product in (1, 2, 3) and JMSPriority > 5 • Supports XPath on the message body for XML messages
  10. 10. Wildcards •Products.Books.Computing.EIP •Products.Books.Computing.* •Products.>
  11. 11. Broker Architecture
  12. 12. Message Persistence
  13. 13. Security
  14. 14. Transports
  15. 15. URIs <protocol>://<host>:<port>?<transport-options> Examples tcp://localhost:61616 vm://localhost?broker.persistent=false
  16. 16. Failover failover:(tcp://host1:61616,tcp://host2:61616)?initialReconnectDelay=100
  17. 17. Wire Formats •OpenWire •STOMP •HTTP / REST
  18. 18. Wire Formats: OpenWire •binary •small and fast •code generated marshalling in C, C++, C# and Java •a fair amount of work to port to other languages
  19. 19. Wire Formats: STOMP • text based for the headers like HTTP • very easy to create a client in any language • tons of clients in most popular programming languages
  20. 20. Stomp : Connecting CONNECT login:<username> passcode:<passcode> ^@
  21. 21. Stomp : Sending SEND destination:/queue/orders.books reply-to:/temporaryQueue/James correlation-id:4324234 amazonSecurityToken:abc234 amazonCustomerRating:gold <order id=“123” customer=“jstrachan”> <book isin=“1234”/> <book isin=“456”/> </order> ^@
  22. 22. Stomp: Subscribe SUBSCRIBE destination:/queue/orders.books ^@
  23. 23. Stomp : Receive messages MESSAGE destination:/queue/orders.books Message-id:abc123 reply-to:/temporaryQueue/james134 This is the message ^@
  24. 24. Broker Architecture
  25. 25. Types of connectors
  26. 26. Kinds of topology
  27. 27. Kinds of topology
  28. 28. Kinds of topology
  29. 29. Clustering with Master / Slave •Pure •Shared File System •Shared Database
  30. 30. Cool Stuff!
  31. 31. Monitoring
  32. 32. Easy Unit Testing of JMS code ConnectionFactory factory = new ActiveMQConnectionFactory(“vm://localhost?broker.persistent=false”);
  33. 33. Visualisation
  34. 34. Prefetch new ActiveMQQueue("TEST.QUEUE?consumer.prefetchSize=10");
  35. 35. Exclusive Consumers
  36. 36. Message Groups
  37. 37. Total Ordering
  38. 38. Consumer Priority new ActiveMQQueue("TEST.QUEUE?consumer.priority=10");
  39. 39. Virtual Destinations
  40. 40. Mirrored Queues
  41. 41. Enterprise Integration Patterns via Camel http://activemq.apache.org/camel/
  42. 42. Bridge to other protocols http://activemq.apache.org/camel/components.html activemq ibatis mail rmi udp activemq.journal imap mina rnc validation bean irc mock rng velocity cxf jdbc msv seda vm direct jetty multicast sftp xmpp event jbi pojo smtp xquery file jms pop string-template xslt ftp jpa quartz timer webdav http log queue tcp
  43. 43. Example <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>
  44. 44. Where do I get more info? http://activemq.apache.org/
  45. 45. Questions?
  46. 46. James Strachan blog http://macstrac.blogspot.com/

×