• 1. JMS & ActiveMQKimmKing (禹皇) kimmking@163.com 2011-05-18
  • 2. ContentsOverview JMS ActiveMQ Demo Discussion
  • 3. OverviewMessage/Messaging Approach File Socket Database RPC(dcom/corba/rmi/.net remoting/werbservice /soap/hessian/potocol buffer/thrift…)fileDBServerClientRPC
  • 4. OverviewDEFABCRPC
  • 5. OverviewTarget Standard format Cross platform Syn & Asyn Loose coupling High Available Reliable …
  • 6. MOMOverviewDEFABCMOM
  • 7. JMSInterface
  • 8. JMSMessage Header Properties Body HeadersJMSDestination JMSDeliveryModeJMSExpiration JMSPriority JMSMessageID JMSTimestamp JMSCorrelationID JMSReplyToJMSType JMSRedelivered
  • 9. JMSMessage Types TextMessage MapMessage StreamMessage BytesMessage ObjectMessage
  • 10. JMSMessage Selector A subset of SQL92 Literals Identifiers Expressions Operators NULL
  • 11. JMSMessaging Patterns Point-To-Point Queue/TemporaryQueue QueueBrower Pub/Sub Topic/TemporaryTopic DurableSubscriber
  • 12. JMSAcknowledgement Transaction Non-Transaction AUTO_ACKNOWLEDGEMENT CLIENT_ACKNOWLEDGEMENT DUPS_OK_ACKNOWLEDGEMENT
  • 13. JMSOthers QueueRequestor/TopicRequestor Combine Request and Response MessageListener On Session On Consumer XA Transaction Optional interface Strong encouraged to use transactional support by jms client
  • 14. JMS ClientProducerConsumerProducerJMS ServerActiveMQ Jboss MQ Open MQ RabbitMQ zeroMQ ……JMS specification
  • 15. ActiveMQApache ActiveMQ ActiveMQ is the most popular and powerful open source messaging and Integration Patterns provider. Tools Web Admin Console http://localhost:8161 JMX Console service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
  • 16. ActiveMQFeatures Broker Transport Openwire Persistence Others
  • 17. ActiveMQBroker Failover Network Master-slave Pure master-slave JDBC master-slave Shared file system master-slave
  • 18. ActiveMQTransport TCP VM SSL HTTP/HTTPS UDP NIO Peer Multicast Discovery/Zoreconf
  • 19. ActiveMQOpenwire Command Wire Protocolcommandcommandcommand
  • 20. ActiveMQPersistence MemoryPersistenceAdapter AmqPersistenceAdapter KahaPersistenceAdapter KahaDBPersistenceAdapter JDBCPersistenceAdapter Locker!
  • 21. ActiveMQMessage Cursor Store-based File VM Enough memory?cursorYesStore-basedEnough memory?cursorYesFileNoNo
  • 22. ActiveMQTips Auto-create queue Composite Destinations Flow-control Fast/slow comsumer Xpath selector Wildcard ……
  • 23. ActiveMQPerformance Test Direct ActiveMQ perf-plugin √ HermesJMS and SoapUI LoadRunner-java Indirect JSP/Servlet—(LR/ab…) √ Webservice—(SoapUI) Configs http://fusesource.com/docs/broker/5.4/tuning/index.html
  • 24. OthersIntegration with Spring Xbean-spring Spring-JMS Integration with Camel Transports Routers
  • 25. OthersOther support Rest(camel) Ajax(camel) Axis/CXF(camel) JMS UnitTest(memory broker) Osgi(Activator) Plugin(Interceptor)
  • 26. RefersJMS Specification(JSR914) http://jcp.org/en/jsr/detail?id=914 http://www.oracle.com/technetwork/java/jms/index.html ActiveMQ http://activemq.apache.org/ Books ActiveMQ in Action Apache ActiveMQ Reference Guide Enterprise Integration Pattern
  • 27. for more…DiscussionConfig server NoSQL persistence ActiveMQ-Store-MongoDB http://code.google.com/p/activemq-store-mongodb/ Governor/Management Master-Slave
  • 28. Thanks!