1 / 54

Exploring Java Message Standard: SonicMQ Implementation

Dive into SonicMQ's implementation of the JMS Specification, framework classes, and messaging models. Learn the core concepts and see practical applications.

emartines
Download Presentation

Exploring Java Message Standard: SonicMQ Implementation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CERN September 25, 2000 Inside SonicMQProgress SonicMQ and the Java Message Standard Mitchell Horowitz Technical Product Manager, SonicMQ

  2. Objectives • To explore the JMS Specification. • Discuss the 2 JMS Messaging Models. • Discuss the 7 core framework classes. • Describe how SonicMQ implemented the JMS specification. • Highlight what differentiates SonicMQ. • Show how easy it is to code JMS applications.

  3. Agenda • The JMS spec • What the API looks like • SonicMQ’s implementation of the JMS spec

  4. The Java Message Service • Specification for the implementation of Java messaging • A common set of Java interfaces and semantics • Part of the Java 2 Enterprise Edition specification • Developed and Maintained by JavaSoft • Not just an intersection but the fast lane to the information super highway.

  5. The Java Messaging Service • Service allowing Java-based applications to communicate. • SonicMQ has added C/C++ and ActiveX applications. • Two models: • Publish and Subscribe • 0 or more recipients • Messages passed between publishers and subscribers via topics • Message can be published in a persistent manner • Message can be subscribed to in a durable manner • Message are consumed at least once. • Point-to-Point • One recipient only • Messages passed between senders and receivers via queues • Messages are consumed at most once and only once

  6. Producer - Destination - Consumer Producer Destination Consumer Receives messages on a destination Subject of communication Available to registered participants Posts messages to a destination

  7. Publish & Subscribe Publisher Topic Subscriber Receives messages on the topic Subject of communication Available to registered participants Posts messages to the topic

  8. Publish & SubscribeSupply Chain Management Topic Subscriber New Flavor Price Increase Publisher

  9. Point to Point Sender Queue Receiver Receives messages on the queue Subject of communication Available to registered participants Posts messages to the queue

  10. Point-to-PointOrder and Fulfillment Sender Queue Receiver Need Supplies Goods Shipped

  11. Publish and Subscribe Stock ticker Pricing changes / catalog updates Data replication Point-to-Point* Ordering and fulfillment Publish & Subscribe vs. Point-to-Point * Point-to-Point is a specialized version of Publish and Subscribe

  12. The JMS spec and what it means • A common way for Java applications to interact with an enterprise messaging system. • Design to leverage existing messaging systems as well as create new ones. • Describes portable efficient standards for powerful and extensible messaging service • A common set of Java interfaces and semantics

  13. The JMS spec and what it means • Defines an Architecture that includes: • JMS Provider • JMS Interface • JMS Application • Administration • Two Messaging Styles • Message Delivery Capabilities

  14. Hub & Spoke Topology JMS Client JMS Client JMS Client JMS Client JMS Client JMS Client JMS Client JMS Client Message Broker

  15. Peer-to-Peer Topology JMS Client JMS Client JMS Client JMS Client JMS Client JMS Client JMS Client JMS Client

  16. The JMS spec and what it means • JMS/API Framework that includes: • ConnectionFactories, • Connections . • Sessions . • Destinations . • Message Producers . • Message Consumers . • Messages .

  17. Message Interfaces Send messages to Topic TopicPublisher TopicConnectionFactory TopicSession MessageProducer TopicConnection Send messages to Queue Creates QueueSender Each Session type creates one or more Producers and/or Consumers Creates one or more Sessions ConnectionFactory Connection Session Receive messages from Topic TopicSubscriber Creates QueueConnectionFactory QueueConnection QueueSession MessageConsumer Receive messages from Queue QueueReceiver Sessions Create Message Instances ObjectMessage Topic MapMessage Messages are sent to Destinations (Topic/Queue) and routed to MessageConsumers Destination Message StreamMessage TextMessage XMLMessage Queue BytesMessage Inheritance (Extends) LEGEND Creation Incoming/Outgoing Messages

  18. Message Interfaces TopicConnectionFactory TopicConnection Creates Creates one or more Sessions ConnectionFactory Connection Session Creates QueueConnectionFactory QueueConnection LEGEND Inheritance (Extends) Creation Incoming/Outgoing Messages

  19. ConnectionFactories • Provides access to a specific messaging service implementation TopicConnectionFactory QueueConnectionFactory

  20. Connections • Interface representing a client connection to the underlying messaging provider • ConnectionFactory returns a Connection implementation • Protocol and connection information contained in this object TopicConnection QueueConnection

  21. Destination Interfaces Topic Messages are sent to Destinations (Topic/Queue) and routed to MessageConsumers Destination Queue LEGEND Inheritance (Extends) Creation Incoming/Outgoing Messages

  22. Destinations • Targets for a producer’s messages • Sources for a consumer’s messages • JMS administered objects • Can be temporary • Out-of-band discussions • Request / reply Topic Queue

  23. JMS Administered Objects • Can be modified without requiring changes to the application

  24. Message Interfaces Send messages to Topic TopicPublisher Send messages to Queue TopicSession MessageProducer QueueSender Each Session type creates one or more Producers and/or Consumers Session Receive messages from Topic TopicSubscriber Receive messages from Queue QueueSession MessageConsumer QueueReceiver LEGEND Inheritance (Extends) Creation Incoming/Outgoing Messages

  25. Sessions • Enforces ordering for production and consumption of messages • Defines acknowledgement semantics • Defines JMS transactions • One or more sessions can be created by a Connection TopicSession QueueSession

  26. Message Producers • Used to send or publish messages to a destination • Created by a Session instance • Can define message delivery semantics • Time-to-live • Persistence • Priority TopicPublisher QueueSender

  27. Message Consumers • Used to handle messages sent to a destination • Created by a Session instance • Can be durable beyond a physical connection TopicSubscriber QueueReceiver

  28. Message Interfaces Session ObjectMessage Sessions Create Message Instances MapMessage Message StreamMessage TextMessage XMLMessage BytesMessage LEGEND Inheritance (Extends) Creation Incoming/Outgoing Messages

  29. Messages Message Used to identify and route the message Header Properties Support application-specific values passed with the message Body The actual “payload” of the message (five different types, plus XML for SonicMQ)

  30. Message Headers • JMSReplyTo • JMSCorrelationID • JMSExpiration • JMSPriority • JMSDeliveryMode • JMSMessageID Full list available in the JMS spec

  31. Message Properties • Optional fields and values associated with a message. • Allows filtering of messages by the consumer • Can be used to carry the data, or selected parts of the data to do content-based filtering • e.g. where region= “Northeast”

  32. Message Body Message BytesMessage MapMessage ObjectMessage StreamMessage TextMessage XMLMessage

  33. Agenda • The JMS spec • What the API looks like • SonicMQ’s implementation of the JMS spec

  34. What the Java/API looks like // Create a connection factory TopicConnectionFactory factory; factory = (new progress.message.jclient.TopicConnectionFactory (broker)); // Create a connection connect = factory.createTopicConnection (username, password); // Create a session session = connect.createTopicSession(true, Session.AUTO_ACKNOWLEDGE); // Create a topics. Topic topic = session.createTopic (“jms.progress.chat”); // Create Subscriber to application topics. TopicSubscriber subscriber = session.createSubscriber(topic); // Initialize the onMessage() message handler. subscriber.setMessageListener(this); // Create a publisher publsher = session.createPublisher(null); // Topic will be set for each reply // Now setup is complete, start the Connection connect.start();

  35. Agenda • The JMS spec • What the API looks like • SonicMQ’s implementation of the JMS spec

  36. However there are…Limitations of the JMS Standard SonicMQ Does SonicMQ Does It Does Not Require • Support for Both Messaging Models • Transaction Support • Server Clusters • 100% Java It Does Not Address • Security • Load Balancing • Fault Tolerance • Error Notification • Administration • Repositories • XML Support • Wire Protocols Commercial Implementations Vary in Scope

  37. Hub & Spoke Topology JMS Client JMS Client JMS Client JMS Client JMS Client JMS Client JMS Client JMS Client Message Broker

  38. Peer-to-Peer Topology JMS Client JMS Client JMS Client JMS Client JMS Client JMS Client JMS Client JMS Client

  39. SonicMQ Architecture Cluster Broker Broker Queue Topic Broker Admin Client C Client Broker JMS Client Topic ActiveX Client JMS Client JMS Client JMS Client

  40. SonicMQ Features Java Clients • MESSAGE BROKER • Transaction Support • Security • Message Persistence • QoS Delivery • Asynch Delivery • Abstraction of • Communications • TOPIC/QUEUE • PTP & Pub/Sub • XML Messages • Durable Subscribers • Hierarchical Name • Spaces • Push to Client • Subject-based • Addressing • Interbroker Support ActiveX Clients C Clients Future Clients • ADMINISTRATION CLIENT • Command Line & GUI • Remote access

  41. SonicMQ’s JMS Implementation • Administration • Security • Performance and Scalability • Internet / Protocol Support • ActiveX/COM Clients • C/C++ Clients • XML Support • Usability

  42. Administration Tools • Java-based GUI tool • Command-line tool for script-based automation of administrative tasks • Support of managing users, groups, destination QoP, destination ACLs, clusters • Allows monitoring of broker performance metrics and broker events • Provides tools for prototyping and testing • Remote monitoring capability • JNDI support

  43. SonicMQ Explorer

  44. Security • Access Control Lists (by topic and queue) • Secure authentication • PKI support / Digital certificates • SSL support • Payload encryption • User and group administration • Available at the cluster-level

  45. Performance and Scalability • Thousands of clients • 10,000’s messages per second • Publish and subscribe • Broker Clusters • Cluster-level administration • In-house Long Duration Test • 42 days: 100 million test cycles • 200 million 10K messages served • That's 2 Terabytes through the broker!

  46. SonicMQ Performance 256-Byte Message Size Quad CPU Machine Out of Box (No tuning) Throughput (messages/ second) Concurrent Clients * Durable, persistent

  47. Internet / Protocol Support • SSL • TCP • HTTP tunneling • Full support for firewalls and proxies • Applet support • Interbroker communication over Internet protocols • XML message support

  48. JMS over HTTP for Firewall Support* No changes required by the firewall administrator.Allows for multi-company networks. Plus SSL support with 40 bit and 128 bit encryption. Any Application JMS Server JMS API Firewall(s) JMS Client M HTTP TCP/IP Stack HTTP TCP/IP Stack M * Beyond the JMS specificaion

  49. ActiveX/COM client • Provides access to SonicMQ from non-Java development environments • MS Visual Basic • MS Visual C++ • Delphi • VBA-enabled applications • Progress 4GL • Java events are presented as native ActiveX control events, allowing for asynchronous listeners • Exception listeners provide support for JMS exception handling

  50. C/C++ Clients • Publish and Subscribe • Point- to- Point • TextMessage and BinaryMessage formats • Native client implementation • No JVM required • Supported on Windows NT and Solaris

More Related