Your SlideShare is downloading. ×
0
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
201101 HornetQ
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

201101 HornetQ

1,826

Published on

Jeff Mesnil nous présente comment HornetQ exploite les technologies du Web.

Jeff Mesnil nous présente comment HornetQ exploite les technologies du Web.

Published in: Technology
1 Comment
4 Likes
Statistics
Notes
No Downloads
Views
Total Views
1,826
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
1
Likes
4
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Transcript

    • 1. LyonJUG 2011/01/18 Soirée MessagingLyonJUG 2011/01/18
    • 2. HornetQ & The Web How HornetQ Embraces the Web and Its Different Forms Jeff MesnilLyonJUG 2011/01/18
    • 3. Who?LyonJUG 2011/01/18
    • 4. Who? • Jeff Mesnil • Software Developer • former Red Hatter • jmesnil@gmail.com • http://jmesnil.net/ • twitter: @jmesnilLyonJUG 2011/01/18
    • 5. What?LyonJUG 2011/01/18
    • 6. What? • What is HornetQ?LyonJUG 2011/01/18
    • 7. What? • What is HornetQ? • HornetQ & The WebLyonJUG 2011/01/18
    • 8. What? • What is HornetQ? • HornetQ & The Web • HornetQ & RESTLyonJUG 2011/01/18
    • 9. What? • What is HornetQ? • HornetQ & The Web • HornetQ & REST • HornetQ & HTML5 WebSocketLyonJUG 2011/01/18
    • 10. What? • What is HornetQ? • HornetQ & The Web • HornetQ & REST • HornetQ & HTML5 WebSocket • Pros & ConsLyonJUG 2011/01/18
    • 11. What? • What is HornetQ? • HornetQ & The Web • HornetQ & REST • HornetQ & HTML5 WebSocket • Pros & Cons • Questions?LyonJUG 2011/01/18
    • 12. LyonJUG 2011/01/18
    • 13. • http://jboss.org/hornetq/LyonJUG 2011/01/18
    • 14. • http://jboss.org/hornetq/ • JBoss community projectLyonJUG 2011/01/18
    • 15. • http://jboss.org/hornetq/ • JBoss community project • Open Source (Apache License 2.0)LyonJUG 2011/01/18
    • 16. • http://jboss.org/hornetq/ • JBoss community project • Open Source (Apache License 2.0) • Multi-protocol asynchronous messaging systemLyonJUG 2011/01/18
    • 17. • http://jboss.org/hornetq/ • JBoss community project • Open Source (Apache License 2.0) • Multi-protocol asynchronous messaging system • Designed for performanceLyonJUG 2011/01/18
    • 18. • http://jboss.org/hornetq/ • JBoss community project • Open Source (Apache License 2.0) • Multi-protocol asynchronous messaging system • Designed for performance • Designed with usability in mindLyonJUG 2011/01/18
    • 19. UsabilityLyonJUG 2011/01/18
    • 20. Usability • Ease of use (configuration, deployment)LyonJUG 2011/01/18
    • 21. Usability • Ease of use (configuration, deployment) • Simple APILyonJUG 2011/01/18
    • 22. Usability • Ease of use (configuration, deployment) • Simple API • DocumentationLyonJUG 2011/01/18
    • 23. Usability • Ease of use (configuration, deployment) • Simple API • Documentation • 90+ examplesLyonJUG 2011/01/18
    • 24. Usability • Ease of use (configuration, deployment) • Simple API • Documentation • 90+ examples • A feature without documentation and example is uselessLyonJUG 2011/01/18
    • 25. Usability • Ease of use (configuration, deployment) • Simple API • Documentation • 90+ examples • A feature without documentation and example is useless • Minimal third-party dependenciesLyonJUG 2011/01/18
    • 26. DeploymentLyonJUG 2011/01/18
    • 27. Deployment • Fully functional standalone messaging serverLyonJUG 2011/01/18
    • 28. Deployment • Fully functional standalone messaging server • Default messaging provider for JBoss AS 6LyonJUG 2011/01/18
    • 29. Deployment • Fully functional standalone messaging server • Default messaging provider for JBoss AS 6 • Integrated with any Java EE application server using its JCA adaptorLyonJUG 2011/01/18
    • 30. Deployment • Fully functional standalone messaging server • Default messaging provider for JBoss AS 6 • Integrated with any Java EE application server using its JCA adaptor • Use dependency-injection framework to embed it in your applicationLyonJUG 2011/01/18
    • 31. Generic Messaging ArchitectureLyonJUG 2011/01/18
    • 32. Generic Messaging Architecture • Simple set of POJOs (JMS-agnostic)LyonJUG 2011/01/18
    • 33. Generic Messaging Architecture • Simple set of POJOs (JMS-agnostic) • No hard dependencies on JMS, JNDI, JCALyonJUG 2011/01/18
    • 34. Generic Messaging Architecture • Simple set of POJOs (JMS-agnostic) • No hard dependencies on JMS, JNDI, JCA • JMS is 1 way to use HornetQLyonJUG 2011/01/18
    • 35. Generic Messaging Architecture • Simple set of POJOs (JMS-agnostic) • No hard dependencies on JMS, JNDI, JCA • JMS is 1 way to use HornetQ • 2 ways to use HornetQ on the WebLyonJUG 2011/01/18
    • 36. Generic Messaging Architecture • Simple set of POJOs (JMS-agnostic) • No hard dependencies on JMS, JNDI, JCA • JMS is 1 way to use HornetQ • 2 ways to use HornetQ on the Web • Different messaging APIs / protocols in a single consistent messaging systemLyonJUG 2011/01/18
    • 37. PerformanceLyonJUG 2011/01/18
    • 38. Performance • Very high performance journalLyonJUG 2011/01/18
    • 39. Performance • Very high performance journal • No relational databaseLyonJUG 2011/01/18
    • 40. Performance • Very high performance journal • No relational database • Java NIOLyonJUG 2011/01/18
    • 41. Performance • Very high performance journal • No relational database • Java NIO • JNI interface to Linux asynchronous IOLyonJUG 2011/01/18
    • 42. Performance • Very high performance journal • No relational database • Java NIO • JNI interface to Linux asynchronous IO • Very fast transport layerLyonJUG 2011/01/18
    • 43. Performance • Very high performance journal • No relational database • Java NIO • JNI interface to Linux asynchronous IO • Very fast transport layer • NettyLyonJUG 2011/01/18
    • 44. Performance • Very high performance journal • No relational database • Java NIO • JNI interface to Linux asynchronous IO • Very fast transport layer • Netty • Don’t take my word for it!LyonJUG 2011/01/18
    • 45. Performance • Very high performance journal • No relational database • Java NIO • JNI interface to Linux asynchronous IO • Very fast transport layer • Netty • Don’t take my word for it! • http://www.spec.org/jms2007/results/jms2007.htmlLyonJUG 2011/01/18
    • 46. Supported ProtocolsLyonJUG 2011/01/18
    • 47. Supported Protocols • Core • JMS • STOMP • RESTLyonJUG 2011/01/18
    • 48. HornetQ Core ProtocolLyonJUG 2011/01/18
    • 49. HornetQ Core Protocol • JavaLyonJUG 2011/01/18
    • 50. HornetQ Core Protocol • Java • OptimizedLyonJUG 2011/01/18
    • 51. HornetQ Core Protocol • Java • Optimized • Send messages to an addressLyonJUG 2011/01/18
    • 52. HornetQ Core Protocol • Java • Optimized • Send messages to an address • Consume messages from a queueLyonJUG 2011/01/18
    • 53. HornetQ Core Protocol • Java • Optimized • Send messages to an address • Consume messages from a queue • Bindings between addresses and queues and queues and consumers define the messaging modelLyonJUG 2011/01/18
    • 54. HornetQ Core APILyonJUG 2011/01/18
    • 55. HornetQ Core APILyonJUG 2011/01/18
    • 56. HornetQ Core API AddressLyonJUG 2011/01/18
    • 57. HornetQ Core API Producer AddressLyonJUG 2011/01/18
    • 58. HornetQ Core API message Producer Address sendsLyonJUG 2011/01/18
    • 59. HornetQ Core API message Producer Address sends ConsumerLyonJUG 2011/01/18
    • 60. HornetQ Core API message Producer Address sends Queue ConsumerLyonJUG 2011/01/18
    • 61. HornetQ Core API message Producer Address sends Queue ConsumerLyonJUG 2011/01/18
    • 62. HornetQ Core API message Producer Address sends message Queue ConsumerLyonJUG 2011/01/18
    • 63. HornetQ Core API message Producer Address sends ? message Queue ConsumerLyonJUG 2011/01/18
    • 64. JMS APILyonJUG 2011/01/18
    • 65. JMS API • Java / Java EELyonJUG 2011/01/18
    • 66. JMS API • Java / Java EE • Point-to-Point (queues) • 1 producer - 1 consumerLyonJUG 2011/01/18
    • 67. JMS API • Java / Java EE • Point-to-Point (queues) • 1 producer - 1 consumer • Publish/Subscribe (topics) • 1 producer - N consumersLyonJUG 2011/01/18
    • 68. JMS QueueLyonJUG 2011/01/18
    • 69. JMS Queue AddressLyonJUG 2011/01/18
    • 70. JMS Queue Address QueueLyonJUG 2011/01/18
    • 71. JMS Queue Address QueueLyonJUG 2011/01/18
    • 72. JMS Queue Address Queue Consumer 1 Consumer 2LyonJUG 2011/01/18
    • 73. JMS Queue Address Queue Consumer 1 Consumer 2LyonJUG 2011/01/18
    • 74. JMS Queue Producer Address Queue Consumer 1 Consumer 2LyonJUG 2011/01/18
    • 75. JMS Queue message Producer Address sends Queue Consumer 1 Consumer 2LyonJUG 2011/01/18
    • 76. JMS Queue message Producer Address sends message Queue Consumer 1 Consumer 2LyonJUG 2011/01/18
    • 77. JMS Queue message Producer Address sends Queue Consumer 1 Consumer 2LyonJUG 2011/01/18
    • 78. JMS Queue message Producer Address sends Queue Consumer 1 Consumer 2 messageLyonJUG 2011/01/18
    • 79. JMS TopicLyonJUG 2011/01/18
    • 80. JMS Topic ProducerLyonJUG 2011/01/18
    • 81. JMS Topic Producer Consumer 1 Consumer 2LyonJUG 2011/01/18
    • 82. JMS Topic Producer Address Consumer 1 Consumer 2LyonJUG 2011/01/18
    • 83. JMS Topic Producer Address Queue Consumer 1 Consumer 2LyonJUG 2011/01/18
    • 84. JMS Topic Producer Address Queue Consumer 1 Queue Consumer 2LyonJUG 2011/01/18
    • 85. JMS Topic Producer Address Queue Consumer 1 Queue Consumer 2LyonJUG 2011/01/18
    • 86. JMS Topic message Producer Address sends Queue Consumer 1 Queue Consumer 2LyonJUG 2011/01/18
    • 87. JMS Topic message Producer Address sends Queue Consumer 1 Queue Consumer 2LyonJUG 2011/01/18
    • 88. JMS Topic message Producer Address sends message Queue Consumer 1 Queue Consumer 2 messageLyonJUG 2011/01/18
    • 89. JMS ModelsLyonJUG 2011/01/18
    • 90. JMS Models • JMS Queue • 1 address - 1 queue binding • Many consumers for the queueLyonJUG 2011/01/18
    • 91. JMS Models • JMS Queue • 1 address - 1 queue binding • Many consumers for the queue • JMS Topic • 1 address - many queues binding • 1 single consumer per queueLyonJUG 2011/01/18
    • 92. STOMPLyonJUG 2011/01/18
    • 93. STOMP • http://stomp.codehaus.org/LyonJUG 2011/01/18
    • 94. STOMP • http://stomp.codehaus.org/ • Text-orientated messaging protocolLyonJUG 2011/01/18
    • 95. STOMP • http://stomp.codehaus.org/ • Text-orientated messaging protocol • InteroperabilityLyonJUG 2011/01/18
    • 96. STOMP • http://stomp.codehaus.org/ • Text-orientated messaging protocol • Interoperability • Clients for many languagesLyonJUG 2011/01/18
    • 97. STOMP • http://stomp.codehaus.org/ • Text-orientated messaging protocol • Interoperability • Clients for many languages • Simple and flexible (headers, ack, transactions)LyonJUG 2011/01/18
    • 98. STOMP $ telnet localhost 61613 CONNECT login: jmesnil passcode: mypassword ^@ SEND destination:/queue/myqueue this is my message body ^@LyonJUG 2011/01/18
    • 99. REST APILyonJUG 2011/01/18
    • 100. REST API • HTTP-Based RESTful API • More on that in a minute...LyonJUG 2011/01/18
    • 101. Many Other FeaturesLyonJUG 2011/01/18
    • 102. Many Other Features • Clustering, HA, FailoverLyonJUG 2011/01/18
    • 103. Many Other Features • Clustering, HA, Failover • Bridges and DivertsLyonJUG 2011/01/18
    • 104. Many Other Features • Clustering, HA, Failover • Bridges and Diverts • Management (JMX, JMS)LyonJUG 2011/01/18
    • 105. Many Other Features • Clustering, HA, Failover • Bridges and Diverts • Management (JMX, JMS) • Dead Letters, ExpirationLyonJUG 2011/01/18
    • 106. Many Other Features • Clustering, HA, Failover • Bridges and Diverts • Management (JMX, JMS) • Dead Letters, Expiration • ...LyonJUG 2011/01/18
    • 107. Many Other Features • Clustering, HA, Failover • Bridges and Diverts • Management (JMX, JMS) • Dead Letters, Expiration • ... • http://community.jboss.org/wiki/HornetQFeaturesLyonJUG 2011/01/18
    • 108. ButLyonJUG 2011/01/18
    • 109. But HornetQ & The WebLyonJUG 2011/01/18
    • 110. HornetQ & The WebLyonJUG 2011/01/18
    • 111. HornetQ & The Web • Web is everywhereLyonJUG 2011/01/18
    • 112. HornetQ & The Web • Web is everywhere • Cloud ComputingLyonJUG 2011/01/18
    • 113. HornetQ & The Web • Web is everywhere • Cloud Computing • Integration • Entreprise environment • Heterogenous platformsLyonJUG 2011/01/18
    • 114. HornetQ & The Web • Web is everywhere • Cloud Computing • Integration • Entreprise environment • Heterogenous platforms • End-user applications • Web Browsers • RIALyonJUG 2011/01/18
    • 115. HornetQ & The Web • Web is everywhere • Cloud Computing • Integration • Entreprise environment • Heterogenous platforms • End-user applications • Web Browsers • RIA • More and more web-based applications needs messagingLyonJUG 2011/01/18
    • 116. Messaging and the WebLyonJUG 2011/01/18
    • 117. Messaging and the Web • Asynchronous • Loosely-coupled • DistributedLyonJUG 2011/01/18
    • 118. HornetQ and the WebLyonJUG 2011/01/18
    • 119. HornetQ and the Web • HornetQ Core/JMS over HTTPLyonJUG 2011/01/18
    • 120. HornetQ and the Web • HornetQ Core/JMS over HTTP • REST API over HTTPLyonJUG 2011/01/18
    • 121. HornetQ and the Web • HornetQ Core/JMS over HTTP • REST API over HTTP • STOMP over HTML5 WebSocketLyonJUG 2011/01/18
    • 122. HornetQ Over HTTPLyonJUG 2011/01/18
    • 123. HornetQ Over HTTP • Use HTTP instead of TCP as the transport layer • Work around firewalls • Not Web-friendly • Requires HornetQ Java client library • HornetQ Core wireformat encodedLyonJUG 2011/01/18
    • 124. LyonJUG 2011/01/18
    • 125. HornetQ REST APILyonJUG 2011/01/18
    • 126. HornetQ REST API • RESTful API to do messaging over HTTPLyonJUG 2011/01/18
    • 127. HornetQ REST API • RESTful API to do messaging over HTTP • http://en.wikipedia.org/wiki/Representational_State_TransferLyonJUG 2011/01/18
    • 128. HornetQ REST API • RESTful API to do messaging over HTTP • http://en.wikipedia.org/wiki/Representational_State_Transfer • Based on RESTEasyLyonJUG 2011/01/18
    • 129. RESTEasyLyonJUG 2011/01/18
    • 130. RESTEasy • http://www.jboss.org/resteasy/ • JBoss community project • Open Source (Apache license 2.0) • Fully certified JAX-RS implementation • Portable to any application server/web container • Rich set of providers (XML, JSON, YAML, Atom, etc.) • JAXB marshalling into XML, JSON, etc. • Wrappers for maps, arrays, lists, and sets of JAXB Objects. • GZIP content-encoding • Rich interceptor model • EJB, Seam, Guice, Spring, and Spring MVC integrationLyonJUG 2011/01/18
    • 131. DemoLyonJUG 2011/01/18
    • 132. Demo • Application to track the location of usersLyonJUG 2011/01/18
    • 133. Demo • Application to track the location of users • Users will use their mobile phones to broadcast their position (REST API)LyonJUG 2011/01/18
    • 134. Demo • Application to track the location of users • Users will use their mobile phones to broadcast their position (REST API) • Web application to monitor the users’ positions (STOMP over HTML5 WebSocket)LyonJUG 2011/01/18
    • 135. Demo • Application to track the location of users • Users will use their mobile phones to broadcast their position (REST API) • Web application to monitor the users’ positions (STOMP over HTML5 WebSocket) • Application to keep a log of everybody’s moves (JMS)LyonJUG 2011/01/18
    • 136. JMS Topic JMS Monitoring ApplicationLyonJUG 2011/01/18
    • 137. HornetQ Server Configuration hornetq-jms.xml <configuration> <topic name="trackers"> <entry name="/topic/trackers" /> </topic> </configuration> hornetq-configuration.xml <acceptor name="jms"> <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</ factory-class> </acceptor> <acceptor name="websockets"> <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</ factory-class> <param key="protocol" value="stomp_ws" /> <param key="port" value="61614" /> </acceptor>LyonJUG 2011/01/18
    • 138. RESTEasy Configuration WEB-INF/web.xml <listener> <listener- class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener- class> </listener> <listener> <listener-class>org.hornetq.rest.integration.HornetqBootstrapListener</ listener-class> </listener> <listener> <listener-class>org.hornetq.rest.integration.RestMessagingBootstrapListener</ listener-class> </listener> ... <context-param> <param-name>rest.messaging.config.file</param-name> <param-value>rest-config.xml</param-value> </context-param>LyonJUG 2011/01/18
    • 139. RESTEasy Configuration rest-config.xml <rest-messaging> <server-in-vm-id>0</server-in-vm-id> <use-link-headers>false</use-link-headers> <default-durable-send>false</default-durable-send> <dups-ok>true</dups-ok> <topic-push-store-dir>topic-push-store</topic-push-store-dir> <queue-push-store-dir>queue-push-store</queue-push-store-dir> <producer-session-pool-size>10</producer-session-pool-size> <session-timeout-task-interval>1</session-timeout-task-interval> <consumer-session-timeout-seconds>300</consumer-session-timeout- seconds> <consumer-window-size>-1</consumer-window-size> </rest-messaging>LyonJUG 2011/01/18
    • 140. LyonJUG 2011/01/18
    • 141. DemoLyonJUG 2011/01/18
    • 142. HornetQ REST APILyonJUG 2011/01/18
    • 143. HornetQ REST API • RESTful messaging specification • http://www.jboss.org/reststar/specifications/messaging.htmlLyonJUG 2011/01/18
    • 144. HornetQ REST API • RESTful messaging specification • http://www.jboss.org/reststar/specifications/messaging.html • Simple REST/HTTP interface to access HornetQLyonJUG 2011/01/18
    • 145. HornetQ REST API • RESTful messaging specification • http://www.jboss.org/reststar/specifications/messaging.html • Simple REST/HTTP interface to access HornetQ • Usable by any programming language that has an HTTP client libraryLyonJUG 2011/01/18
    • 146. HornetQ REST API • RESTful messaging specification • http://www.jboss.org/reststar/specifications/messaging.html • Simple REST/HTTP interface to access HornetQ • Usable by any programming language that has an HTTP client library • Zero client footprint (no libraries to download, install and deploy)LyonJUG 2011/01/18
    • 147. HornetQ REST API • RESTful messaging specification • http://www.jboss.org/reststar/specifications/messaging.html • Simple REST/HTTP interface to access HornetQ • Usable by any programming language that has an HTTP client library • Zero client footprint (no libraries to download, install and deploy) • No envelope (à la SOAP) or feed (à la Atom) format requirements • the HTTP request/response is the messageLyonJUG 2011/01/18
    • 148. HornetQ REST API • RESTful messaging specification • http://www.jboss.org/reststar/specifications/messaging.html • Simple REST/HTTP interface to access HornetQ • Usable by any programming language that has an HTTP client library • Zero client footprint (no libraries to download, install and deploy) • No envelope (à la SOAP) or feed (à la Atom) format requirements • the HTTP request/response is the message • Ligthweight interoperabilityLyonJUG 2011/01/18
    • 149. HornetQ REST API • RESTful messaging specification • http://www.jboss.org/reststar/specifications/messaging.html • Simple REST/HTTP interface to access HornetQ • Usable by any programming language that has an HTTP client library • Zero client footprint (no libraries to download, install and deploy) • No envelope (à la SOAP) or feed (à la Atom) format requirements • the HTTP request/response is the message • Ligthweight interoperability • Pub/Sub (topics) and Point-to-point (queues)LyonJUG 2011/01/18
    • 150. HornetQ REST APILyonJUG 2011/01/18
    • 151. HornetQ REST API • Follow the headersLyonJUG 2011/01/18
    • 152. HornetQ REST API • Follow the headers • Duplicate DetectionLyonJUG 2011/01/18
    • 153. HornetQ REST API • Follow the headers • Duplicate Detection • Persistent messages ?durable=trueLyonJUG 2011/01/18
    • 154. Send a Message [1/2] => Query the resource URL HEAD /topics/jms.topic.trackers HTTP/1.1 Host: example.com --- Response --- HTTP/1.1 200 Ok msg-create: http://example.com/topics/jms.topic.trackers/create msg-create-with-id: http://example.com/topics/jms.topic.trackers/ create/{id}LyonJUG 2011/01/18
    • 155. Send a Message [2/2] POST /topics/jms.topic.trackers/create Host: example.com Content-Type: application/json { "alias": "jmesnil", "position": { "coords": { "longitude": 65.735344446666666, "latitude": 35.198200083333326 }, "timestamp": 1285943662645 } } --- Response --- HTTP/1.1 201 Created msg-create-next: http://example.com/topics/jms.topic.trackers/create/ 002LyonJUG 2011/01/18
    • 156. Receive a Message - Pull [1/4] => query the resource URL HEAD /topics/jms.topic.trackers HTTP/1.1 Host: example.com --- Response --- HTTP/1.1 200 Ok msg-create: http://example.com/topics/jms.topic.trackers/create msg-pull-subscriptions: http://example.com/topics/jms.topic.trackers/ pull-subscriptions msg-push-subscriptions: http://example.com/topics/jms.topic.trackers/ push-subscriptionsLyonJUG 2011/01/18
    • 157. Receive a Message - Pull [2/4] => create a subscription by doing an empty POST on the msg-pull-subscriptions URL POST /topics/jms.topic.trackers/pull-subscriptions HTTP/1.1 Host: example.com --- Response --- HTTP/1.1 201 Created Location: http://example.com/topics/jms.topic.trackers/pull- subscriptions/auto-ack/222 msg-consume-next: http://example.com/topics/jms.topic.trackers/pull- subscriptions/auto-ack/222/consume-next-1LyonJUG 2011/01/18
    • 158. Receive a Message - Pull [3/4] => consume the message by POSTing on the subscription POST /topics/jms.topic.trackers/pull-subscriptions/auto-ack/222/consume-next-1 Host: example.com --- Response --- HTTP/1.1 200 Ok Content-Type: application/json msg-consume-next: http://example.com/topics/jms.topic.trackers/pull- subscriptions/auto-ack/222/consume-next-2 { "alias": "jmesnil", "position": { "coords": { "longitude": 65.735344446666666, "latitude": 35.198200083333326, ... }, "timestamp": 1285943662645 } }LyonJUG 2011/01/18
    • 159. Receive a Message - Pull [4/4] => if there is no message to consume, will return 503 POST /queues/jms.queue.bar/pull-consumers/consume-next-2 Host: example.com --- Response --- Http/1.1 503 Service Unavailable Retry-After: 5 msg-consume-next: http://example.com/queues/jms.queue.bar/pull- consumers/333/consume-next-2LyonJUG 2011/01/18
    • 160. Receive a Message - Push[1/2] => query the Topic resource URL HEAD /topics/jms.topic.trackers HTTP/1.1 Host: example.com --- Response --- HTTP/1.1 200 Ok msg-create: http://example.com/topics/jms.topic.trackers/create msg-pull-subscriptions: http://example.com/topics/jms.topic.trackers/ pull-subscriptions msg-push-subscriptions: http://example.com/topics/jms.topic.trackers/ push-subscriptionsLyonJUG 2011/01/18
    • 161. Receive a Message - Push[2/2] => create a push subscription POST /topics/jms.topic.trackers/push-subscriptions Host: example.com Content-Type: application/xml <push-topic-registration> <link rel="template" href="http://somewhere.com/resources/{id}/ messages" method="POST"/> </push-topic registration> --- Response --- HTTP/1.1 201 Created Location: http://example.com/topics/jms.topic.trackers/push- subscriptions/1-333-1212 => new messages will be POSTed to http://somewhere.com/resources/ {id}/messages URLLyonJUG 2011/01/18
    • 162. Create a Destination POST /topics Host: example.com Content-Type: application/hornetq.jms.topic+xml <topic name="testTopic" /> --- Response --- HTTP/1.1 201 Created Location: http://example.com/topics/jms.topic.testTopicLyonJUG 2011/01/18
    • 163. HTML5LyonJUG 2011/01/18
    • 164. HTML5 • http://www.w3.org/TR/html5/LyonJUG 2011/01/18
    • 165. HTML5 • http://www.w3.org/TR/html5/ • Revision of HTML markup languageLyonJUG 2011/01/18
    • 166. HTML5 • http://www.w3.org/TR/html5/ • Revision of HTML markup language • JavaScript APIsLyonJUG 2011/01/18
    • 167. HTML5 • http://www.w3.org/TR/html5/ • Revision of HTML markup language • JavaScript APIs • canvas, geolocation, video, audio, etc.LyonJUG 2011/01/18
    • 168. HTML5 • http://www.w3.org/TR/html5/ • Revision of HTML markup language • JavaScript APIs • canvas, geolocation, video, audio, etc. • WebSocket!LyonJUG 2011/01/18
    • 169. HTML5 WebSocketLyonJUG 2011/01/18
    • 170. HTML5 WebSocket • «TCP for the Web»LyonJUG 2011/01/18
    • 171. HTML5 WebSocket • «TCP for the Web» • bidirectional communication between the browser and the web serverLyonJUG 2011/01/18
    • 172. HTML5 WebSocket • «TCP for the Web» • bidirectional communication between the browser and the web server • same-origin security modelLyonJUG 2011/01/18
    • 173. HTML5 WebSocket • «TCP for the Web» • bidirectional communication between the browser and the web server • same-origin security model • JavaScript API in the browserLyonJUG 2011/01/18
    • 174. HTML5 WebSocket • «TCP for the Web» • bidirectional communication between the browser and the web server • same-origin security model • JavaScript API in the browser • http://dev.w3.org/html5/websockets/LyonJUG 2011/01/18
    • 175. HTML5 WebSocket • «TCP for the Web» • bidirectional communication between the browser and the web server • same-origin security model • JavaScript API in the browser • http://dev.w3.org/html5/websockets/ • WebSocket protocol on the serverLyonJUG 2011/01/18
    • 176. HTML5 WebSocket • «TCP for the Web» • bidirectional communication between the browser and the web server • same-origin security model • JavaScript API in the browser • http://dev.w3.org/html5/websockets/ • WebSocket protocol on the server • http://tools.ietf.org/html/draft-hixie- thewebsocketprotocol-76LyonJUG 2011/01/18
    • 177. STOMP Over WebSocketLyonJUG 2011/01/18
    • 178. STOMP Over WebSocket • WebSocket instead of TCPLyonJUG 2011/01/18
    • 179. STOMP Over WebSocket • WebSocket instead of TCP • STOMP as the messaging protocolLyonJUG 2011/01/18
    • 180. STOMP Over WebSocket • WebSocket instead of TCP • STOMP as the messaging protocol • JavaScript libraries to send and receive STOMP messages • http://jmesnil.net/stomp-websocket/doc/ • http://github.com/krukow/stompleLyonJUG 2011/01/18
    • 181. STOMP Over WebSocket • WebSocket instead of TCP • STOMP as the messaging protocol • JavaScript libraries to send and receive STOMP messages • http://jmesnil.net/stomp-websocket/doc/ • http://github.com/krukow/stomple • ActiveMQ, RabbitMQ(?)LyonJUG 2011/01/18
    • 182. STOMP Over WebSocket • WebSocket instead of TCP • STOMP as the messaging protocol • JavaScript libraries to send and receive STOMP messages • http://jmesnil.net/stomp-websocket/doc/ • http://github.com/krukow/stomple • ActiveMQ, RabbitMQ(?) • Talks about adding it to STOMP 2.0 specificationLyonJUG 2011/01/18
    • 183. STOMP Over WebSocket • WebSocket instead of TCP • STOMP as the messaging protocol • JavaScript libraries to send and receive STOMP messages • http://jmesnil.net/stomp-websocket/doc/ • http://github.com/krukow/stomple • ActiveMQ, RabbitMQ(?) • Talks about adding it to STOMP 2.0 specification • Work with text only (no bytes)LyonJUG 2011/01/18
    • 184. STOMP Over WebSocket • WebSocket instead of TCP • STOMP as the messaging protocol • JavaScript libraries to send and receive STOMP messages • http://jmesnil.net/stomp-websocket/doc/ • http://github.com/krukow/stomple • ActiveMQ, RabbitMQ(?) • Talks about adding it to STOMP 2.0 specification • Work with text only (no bytes) • Receive message by push-onlyLyonJUG 2011/01/18
    • 185. LyonJUG 2011/01/18
    • 186. DemoLyonJUG 2011/01/18
    • 187. STOMP Over WebSocketLyonJUG 2011/01/18
    • 188. STOMP Over WebSocket • JavaScript-basedLyonJUG 2011/01/18
    • 189. STOMP Over WebSocket • JavaScript-based • Looks like other STOMP clientsLyonJUG 2011/01/18
    • 190. STOMP Over WebSocket • JavaScript-based • Looks like other STOMP clients • Send and receives text-only messagesLyonJUG 2011/01/18
    • 191. Create a Client // create a client var url = "ws://example.com:61614/stomp"; var client = Stomp.client(url); // connect to the STOMP server client.connect(login, passcode, function() { // called back after the client is connected // and authenticated to the Stomp server }); ... client.disconnect();LyonJUG 2011/01/18
    • 192. Send and Receive Messages // send a message var tracker = ...; // retrieved from Geolocation API client.send("jms.topic.trackers", {}, JSON.stringify(tracker)); // subscribe to a destination var sub_id = client.subscribe("jms.topic.trackers", function(message) { // called back everytime a message is sent to the destination var tracker = JSON.parse(message.body); ... }); // unsubscribe from a destination client.unsubscribe(sub_id);LyonJUG 2011/01/18
    • 193. REST or WebSocket?LyonJUG 2011/01/18
    • 194. REST or WebSocket? • Different usage and timelineLyonJUG 2011/01/18
    • 195. REST or WebSocket? • Different usage and timeline • WebSocketLyonJUG 2011/01/18
    • 196. REST or WebSocket? • Different usage and timeline • WebSocket • (+) TCP-likeLyonJUG 2011/01/18
    • 197. REST or WebSocket? • Different usage and timeline • WebSocket • (+) TCP-like • (+) push data from the server to the browserLyonJUG 2011/01/18
    • 198. REST or WebSocket? • Different usage and timeline • WebSocket • (+) TCP-like • (+) push data from the server to the browser • (-) limited support now, will likely expandLyonJUG 2011/01/18
    • 199. REST or WebSocket? • Different usage and timeline • WebSocket • (+) TCP-like • (+) push data from the server to the browser • (-) limited support now, will likely expand • (-) disabled in browsers, security issues!LyonJUG 2011/01/18
    • 200. REST or WebSocket? • Different usage and timeline • WebSocket • (+) TCP-like • (+) push data from the server to the browser • (-) limited support now, will likely expand • (-) disabled in browsers, security issues! • RESTLyonJUG 2011/01/18
    • 201. REST or WebSocket? • Different usage and timeline • WebSocket • (+) TCP-like • (+) push data from the server to the browser • (-) limited support now, will likely expand • (-) disabled in browsers, security issues! • REST • (+) works everywhere nowLyonJUG 2011/01/18
    • 202. REST or WebSocket? • Different usage and timeline • WebSocket • (+) TCP-like • (+) push data from the server to the browser • (-) limited support now, will likely expand • (-) disabled in browsers, security issues! • REST • (+) works everywhere now • (-) no push messages in the browserLyonJUG 2011/01/18
    • 203. Demo Source • http://github.com/jmesnil/hornetq/tree/lyonjugLyonJUG 2011/01/18
    • 204. ConclusionLyonJUG 2011/01/18
    • 205. Conclusion • Different ways to do messaging on the WebLyonJUG 2011/01/18
    • 206. Conclusion • Different ways to do messaging on the Web • Integrate with the whole Java / Java EE ecosystemLyonJUG 2011/01/18
    • 207. Conclusion • Different ways to do messaging on the Web • Integrate with the whole Java / Java EE ecosystem • Embraces REST principlesLyonJUG 2011/01/18
    • 208. Conclusion • Different ways to do messaging on the Web • Integrate with the whole Java / Java EE ecosystem • Embraces REST principles • Integration & interoperabilityLyonJUG 2011/01/18
    • 209. Conclusion • Different ways to do messaging on the Web • Integrate with the whole Java / Java EE ecosystem • Embraces REST principles • Integration & interoperability • ... Performance(?)LyonJUG 2011/01/18
    • 210. Questions?LyonJUG 2011/01/18
    • 211. LyonJUG 2011/01/18
    • 212. Merci!LyonJUG 2011/01/18

    ×