Open Mq Intro
-
Upload
eduardo-pelegri-llopart -
Category
Technology
-
view
4.980 -
download
1
Transcript of Open Mq Intro
1
Message Queue Product UpdateEdward BrattSr. ManagerSun Microsystems, Inc.
1
Sun Confidential: Internal Only 2
Open MQ
• Premier Open Source, Community MOM platform> Also available with commercial support and license
• Provides enterprise level messaging> Publish Subscribe, Point to Point
• Complete range of resilience> In-memory pub-sub; distributed persistence store; distributed
in-flight data availability> Support for distributed disk clustering> HA support via Sun Cluster or JDBC HA Database
• JMX Admin. Interface (or stand-alone client Admin.)
Sun Confidential: Internal Only 3
Connectivity in MQ
• Rich API Support> JMS API> C API
– Now with XA support• Simple UMS API> POX, URL-Query-String
• Clients connect via TCP/TLS or SOAP / HTTP• JCA Resource Adapter> Supports JMSRA, JMSJCA,
GenericRA
Sun Confidential: Internal Only 4
What's new In MQ
• Version 4.2 added> Wild-card Topic Destinations
– Added *, **, >, syntax to Topic names> XML Validation
– XML messages can be rejected if they fail validation
• Version 4.3 adds> Universal Message Service (UMS)
– Provides simple API for any web-enabled client– Scriptable URI formed commands or XML documents
> Support updates– Windows 2008, Windows Vista, MySQL, MySQL Cluster Edition, AIX
(with c API and DB2 support on AIX)
Sun Confidential: Internal Only 5
Complete Platform Matrix• Sun Solaris 9, 10 – SPARC, x86 – 32 or 64 bit• Linux – Red Hat 4 & 5• Windows – XP, Vista, 2003 Server, 2008 Server• AIX – 6.1• Other Platforms> GlassFish Distributions include
– Ubuntu, Macintosh OSX
• JDBC Databases> MySQL (Community, Enterprise Cluster)> Oracle 10, 11> HADB (GlassFish Enterprise Server, HA Profile)> Java DB> Postgresql> DB2 (AIX Only)
• JDK 1.5, 1.6.0_10*
Sun Confidential: Internal Only 6
Performance, 4.3 Compared To 4.2
• Overall performance improved 8%• HADB performance is
improved by 3x!> Optimized queries> Reduced serialization
caused by HADB implementation
Topi
c N
P
Topi
c P
Topi
c A
ll
Que
ue N
P
Que
ue P
Que
ue A
ll
Ove
rall
0%1%2%3%4%5%6%7%8%9%
10%11%12%13%14%
% Improvement MQ 4.3 over MQ 4.2
% Im
prov
emen
t
Sun Confidential: Internal Only 7
MQ Connectivity
Java EE – e.g. GlassFish 2.1Web Container
UMS Servlet
MQ Broker (Cluster)
MQBroker
MQBroker
MQBroker
JMS Servlet
EJB Container
EJB / JMS
MDB Container
MDB
RA RA JMSJMS Client
C/C++Client
JMS
Sun Confidential: Internal Only 8
Community Information
• Open MQ Wiki> Community examples
– Samples for Spring integration– Samples for STOMP Connect
– Stream Oriented Messaging Protocol– jRuby example– Setup instructions for Hermes JMS
> FAQs– Many sections– Internal commands, JDBC, Private APIs, JMX, Etc
• Lots of info. In Users alias and Forum
Sun Confidential: Internal Only 9
Where to look further
• Open MQ project site – Community version> https://mq.dev.java.net> Don't forget to check the wiki at
– http://wiki.glassfish.java.net/Wiki.jsp?page=OpenMessageQueue
• Java MQ product – Commercial version> http://sun.com/software/products/message_queue
• JMQ Product Manuals> http://docs.sun.com/coll/1307.6
• Questions or other comments> Community Mailing List: mailto:[email protected]> User Forum: http://forum.java.sun.com/forum.jspa?forumID=711
10
Universal Message Service (UMS)
10
Sun Confidential: Internal Only 11
Universal Message Service
• UMS is a very simple API • It is implemented as a WebApp> Deployed to any web container (GlassFish, Tomcat, GF
v3Prelude)• Simple to configure
Sun Confidential: Internal Only 12
UMS – Simple Yet Powerful
• Simple API> Login (optional)> Send> Receive> Commit (optional)> Rollback (optional)> Close (optional)
• Supports HTTP or HTTPS• For stateless clients (i.e. No login/logout) limited only by
throughput requirements• Support many stateful clients per JMS connection > Default is 100 stateful clients per connection
Sun Confidential: Internal Only 13
UMS Interface Types
• Simple messaging with HTTP URL query string> Post /ums/simple?service=send&destination=myQueue
Hello, World!
• XML Document
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header> <ums:MessageHeader xmlns:ums="https://mq.dev.java.net/ums" ums:id="1.0" ums:version="1.0"> <ums:Service ums:service="send" ums:destination="myQueue" ums:domain="queue" ums:sid="7-LTgxMDczMTczNQ== "/> </ums:MessageHeader> </SOAP-ENV:Header><SOAP-ENV:Body><bodyvalue>Hello, World!</bodyvalue></SOAP-ENV:Body></SOAP-ENV:Envelope>
Sun Confidential: Internal Only 14
Universal Message Service
• Why mess with JMS?> JMS is a very rich and stable API> JMS is designed for back-end messaging
• Goal is to allow any web enabled client to easily access this back-end> Provide a simpler API> Scripting languages; Compiled languages> Lower deployment overhead
– Reduce or eliminate deployment issues with client runtime
• Ubiquity of XML and URI query
Sun Confidential: Internal Only 15
Demo. Setup
• If you want to follow along with the demo you'll need> MQ 4.3 – http://sun.com/software/products/message_queue/get.jsp> GlassFish v3 Prelude –
http://sun.com/software/products/glassfishv3_prelude/get.jsp> To run the Python sample, you'll need Python –
http://python.org/download/releases/2.5.2/> The C# example only works in Windows operating environment.
Sun Confidential: Internal Only 16
Demonstration• Start the MQ Broker> Imqbrokerd -tty
• Deploy UMS.war to your web container> Asadmin start-domain> Asadmin deploy ums.war ($mq-home/mq/lib/ums/imqums.war)
• Point your browser to> http://localhost:8080/ums/
• Select “Examples” link• Try the Ajax Send and Receive• Send w/Python; Receive w/C#> python SendSOAPMsg.py -s localhost:8080 -f <filename>> ReceiveSOAPMsg.exe -s localhost:8080
Sun Confidential: Internal Only 17
Demo
Sun Confidential: Internal Only 18
UMS Deployment
Web Container – ex. GlassFish v3 Prelude Web Container
UMS Servlet
PythonC# AJAX • • •
HTTP/S
MQ Broker (Cluster)
MQBroker
MQBroker
MQBroker
JMS
JRuby
JMS
Sun Confidential: Internal Only 19
UMS vs. JMS
• UMS is not a JMS replacement• Use UMS for low volume clients> Particularly useful with scripted applications> Suitable for many clients, each at relatively low volume
– Client messaging measured in messages per minute– Tens of Thousands of active clients, perhaps more
> No client runtime to distribute or manage• Use JMS (Java or C) for traditional settings> Highest throughput, supports (relatively) fewer clients
– Client messaging measured in hundreds to thousands per second– Hundreds to thousands of clients
> Much richer control> Runtime deployment must be managed
Sun Confidential: Internal Only 20
Where to look further
• Open MQ project site – Community version> https://mq.dev.java.net> Don't forget to check the wiki at
– http://wiki.glassfish.java.net/Wiki.jsp?page=OpenMessageQueue
• UMS details are in the WAR and online at> https://mq.dev.java.net/4.3-content/ums/umsMain.html
• JMQ Product Manuals> http://docs.sun.com/coll/1307.6
• Questions or other comments> Community Mailing List: mailto:[email protected]> User Forum: http://forum.java.sun.com/forum.jspa?forumID=711