DDS for JMS Programmers
Upcoming SlideShare
Loading in...5
×
 

DDS for JMS Programmers

on

  • 3,769 views

This presentations provides an introduction to DDS for JMS programmers

This presentations provides an introduction to DDS for JMS programmers

Statistics

Views

Total Views
3,769
Views on SlideShare
3,449
Embed Views
320

Actions

Likes
2
Downloads
116
Comments
0

5 Embeds 320

http://www.prismtech.com 310
http://prismtech.localhost 5
http://www.icorsaro.net 2
http://prismtech-new.orangebusdev.co.uk 2
http://www.linkedin.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

DDS for JMS Programmers DDS for JMS Programmers Presentation Transcript

  • Angelo Corsaro, Ph.D.Chief Technology Officer!OMG DDS Sig Co-ChairPrismTechangelo.corsaro@prismtech.com!
  • Standards Scopes
  • Standards Compared Copyright  2010,  PrismTech  –    All  Rights  Reserved.  DDS Standard v1.2 2004 JMS Standard v1.1 2001¨  Programming Language ¨  Java Messaging API (Pub/ Independent API for Data- Sub + PTP) portable across Centric Pub/Sub messaging implementations¨  Interoperable Wire- Protocol (DDSI/RTPS)
  • Standards Compared DDS ensures portability and JMS focuses only on application Copyright  2010,  PrismTech  –    All  Rights  Reserved.  ¨  ¨  interoperability across portability across implementation of the standard implementation of the standard Application Application DDS API JMS API Standard Standard DDSI JMS Provider
  • Standards ComparedDDS Standard Copyright  2010,  PrismTech  –    All  Rights  Reserved.   JMS Standard¨  Promotes Fully Distributed ¨  Promotes Hub and Spoke Architectures Architectures¨  Provides mechanisms for ¨  Fully distributed transparently using Brokers/ architectures are possible Routers but complicated by some use cases
  • Standardization " Activity
  • JMS Copyright  2010,  PrismTech  –    All  Rights  Reserved.  ¨  The JMS standard has not been evolving after the v1.1 released in 2002
  • DDS Standard Evolution Copyright  2010,  PrismTech  –    All  Rights  Reserved.   App Standard API 2004 DDS §  Standard API for Data- Centric Real-Time Pub/Sub §  Automatic fail-over §  Persistence §  Dynamic Discovery §  Content Filtering / Queries
  • DDS Standard Evolution Copyright  2010,  PrismTech  –    All  Rights  Reserved.   App App Standard API 2004 2004 DDS DDS 2006 2006 DDSI/RTPS network DDSI/RTPS Interoperable Wire Protocol §  High Performance §  Interoperable Wire Protocol
  • DDS Standard Evolution 2008 2008 UML4DDS §  UML-Based Modeling of UML4DDS Copyright  2010,  PrismTech  –    All  Rights  Reserved.   DDS applications App App Standard API 2004 2004 DDS DDS 2006 2006 DDSI/RTPS network DDSI/RTPS Interoperable Wire Protocol
  • DDS Standard Evolution 2008 2008 UML4DDS UML4DDS Copyright  2010,  PrismTech  –    All  Rights  Reserved.   App App Standard API 2004 20042010 2010 DDS DDS X-Types X-Types 2006 2006 DDSI/RTPS network DDSI/RTPS §  Extensible/Evolvable Type Interoperable System Wire Protocol §  Dynamic Topic Types, Data Readers & Writers §  Encoding Negotiation
  • DDS Standard Evolution 2008 §  ISO C++ DDS PSM 2008 §  Simple, Safe, Efficient, UML4DDS UML4DDS Copyright  2010,  PrismTech  –    All  Rights  Reserved.   Elegant and Ergonomic API App App Standard API 2004 2010 2004 ISO-C++ PSM2010 2010 DDS DDS X-Types X-Types 2006 2006 DDSI/RTPS network DDSI/RTPS Interoperable Wire Protocol
  • DDS Standard Evolution 2008 §  Java 5 DDS PSM 2008 §  Simple, Safe, Efficient, UML4DDS UML4DDS Copyright  2010,  PrismTech  –    All  Rights  Reserved.   Elegant and Ergonomic API App App Standard API 2004 2010 2010 2004 ISO-C++ PSM Java5 PSM2010 2010 DDS DDS X-Types X-Types 2006 2006 DDSI/RTPS network DDSI/RTPS Interoperable Wire Protocol
  • DDS Standard Evolution 2008 2008 UML4DDS UML4DDS Copyright  2010,  PrismTech  –    All  Rights  Reserved.   App App Standard API 2004 2010 2010 2004 2011 2011 Web-DDS Web-DDS ISO-C++ PSM Java5 PSM2010 2010 DDS DDS X-Types X-Types 2006 2006 DDSI/RTPS network DDSI/RTPS Interoperable §  Standardized way of Wire Protocol accessing DDS from Web Technologies §  REST, W3C WS-*, RSS, etc.
  • DDS Standard Evolution 2008 2008 UML4DDS UML4DDS Copyright  2010,  PrismTech  –    All  Rights  Reserved.   App App Standard API 2004 2010 2010 2004 2011 2011 Web-DDS Web-DDS ISO-C++ PSM Java5 PSM2010 2010 DDS DDS X-Types X-Types 2011 2011 ULS-DDSI network ULS-DDSI §  Ultra-Large Scale Extensions Interoperable to the DDSI/RTPS wire- Wire Protocol protocol §  New Discovery §  Support for TCP, etc.
  • DDS Standard Evolution 2008 2008 UML4DDS UML4DDS Copyright  2010,  PrismTech  –    All  Rights  Reserved.   App App Standard API 2004 2010 2010 2004 2012 2011 2011 2012 Web-DDS Web-DDS ISO-C++ PSM Java5 PSM Security Security2010 2010 DDS DDS X-Types X-Types 2011 2011 ULS-DDSI network ULS-DDSI Interoperable §  Interoperable Security Wire Protocol Architecture §  Pluggable Policy / Labeling and Tagging
  • DDS Standard Evolution 2008 2008 UML4DDS §  Remote Method UML4DDS Invocations over DDS Copyright  2010,  PrismTech  –    All  Rights  Reserved.   §  Synchronous, Asynchronous App and one ways RMI App 2012 2012 Standard API DDS-RMI DDS-RMI 2004 2010 2010 2004 2012 2011 2011 2012 Web-DDS Web-DDS ISO-C++ PSM Java5 PSM Security Security2010 2010 DDS DDS X-Types X-Types 2011 2011 ULS-DDSI network ULS-DDSI Interoperable Wire Protocol
  • Mapping JMS to DDS
  • JMS DDSConnection Connection Domain Participant Copyright  2010,  PrismTech  –    All  Rights  Reserved.  Session Session Publisher Subscriber Establishes connection with Gives access to a the Broker DDS DomainPub/Sub Producer Destination Consumer DataWriter Topic DataReader
  • JMS DDSConnection Connection Domain Participant Copyright  2010,  PrismTech  –    All  Rights  Reserved.  Session Session Publisher SubscriberPub/Sub Producer Destination Consumer DataWriter Manage publishers Topic DataReader Establishes a JMS and subscribers Session sessions
  • JMS DDSConnection Connection Domain Participant Copyright  2010,  PrismTech  –    All  Rights  Reserved.  Session Session Publisher SubscriberPub/Sub Producer Destination Consumer DataWriter Topic DataReader Reader/Writer for Messaging Abstractions. application A Destination can be a defined Topic Topic or a Queue Types
  • Note: Topics are the kind ofJMS Destination associatedwith the Pub/Sub Domain Pub/Sub & Topics
  • JMS Topics¨  A Topic defines the subject of Copyright  2010,  PrismTech  –    All  Rights  Reserved.   publications and subscriptions¨  The topic name has a weakly defined semantics w.r.t. the subscription matching¨  Topics are Administered Objects and should preferably be defined outside the application. API for local definition also exist
  • DDS Topics [1/2] “com.myco.VPos”¨  A Topic defines the subject of Copyright  2010,  PrismTech  –    All  Rights  Reserved.   publications and subscriptions¨  A Topic has associated a user defined extensible type and QoS¨  The Topic name, type and QoS have a well defined role in matching subscriptions¨  Topics can be discovered or locally defined struct VehiclePosition{! string plate; @Key! DURABILITY, DEADLINE, long x;! PRIORITY, longy;! }! …
  • DDS Topics [2/2] “com.myco.VPos” Copyright  2010,  PrismTech  –    All  Rights  Reserved.  ¨  DDS Topic types can have associated keys¨  Each unique key-value identify a Topic Instance – a specific stream of values struct VehiclePosition{! DURABILITY, string plate; @Key! DEADLINE, long x;! PRIORITY, longy;! }! …
  • Plugging into JMS/DDS
  • JMSConnection // Get connectionFactory from JNDI! Connection Connection c = ! connectionFactory.createConnection();! Copyright  2010,  PrismTech  –    All  Rights  Reserved.  Session Session Domain Establishes Participant connection with the BrokerPub/Sub Producer Topic Consumer Publisher Topic SubscriberReader/Writers DataWrter DataReaderUser Defined for Types
  • JMSConnection // Get connectionFactory from JNDI! Connection Connection c = ! connectionFactory.createConnection();! Copyright  2010,  PrismTech  –    All  Rights  Reserved.  Session Session s = ! Session c.createSession(false, ! Session.AUTO_ACKNOWLDEGE);!Pub/Sub Producer Topic Consumer Establishes a JMS SessionReader/WritersUser Defined for Types
  • JMSConnection // Get connectionFactory from JNDI! Connection Connection c = ! connectionFactory.createConnection();! Copyright  2010,  PrismTech  –    All  Rights  Reserved.  Session Session s = ! Session c.createSession(false, ! Session.AUTO_ACKNOWLDEGE);!Pub/Sub // Look-up destination from JNDI! Destination d = ! Producer Destination Consumer (Destination )jndi.lookup(destName);! ! // Create a Producer! MessageProducer mp = s.createProducer(d);! ! // Create a Consumer!Reader/Writers MessageConsumer mc = s.createConsumer(d);! Messaging Abstractions.User Defined for Types be a A Destination can Topic or a Queue
  • DDSConnection Domain DomainParticipant dp = ! theDomainParticipantFactory().create_participant(0);! Participant Copyright  2010,  PrismTech  –    All  Rights  Reserved.  Session Publisher Subscriber Gives access to a DDS DomainPub/Sub DataWriter Topic DataReader
  • DDSConnection Domain DomainParticipant dp = ! theDomainParticipantFactory().create_participant(0);! Participant Copyright  2010,  PrismTech  –    All  Rights  Reserved.  Session // Create a Publisher / Subscriber! Publisher p = dp.create_publisher();! Subscriber s = dp.create_subscriber();! Publisher Subscriber // Create a Topic! Topic<Foo> t = dp.create_topic<Foo>(name)!Pub/Sub DataWriter Manage publishers Topic DataReader and subscribers sessions
  • DDSConnection Domain DomainParticipant dp = ! theDomainParticipantFactory().create_participant(0);! Participant Copyright  2010,  PrismTech  –    All  Rights  Reserved.  Session // Create a Publisher / Subscriber! Publisher p = dp.create_publisher();! Subscriber s = dp.create_subscriber();! Publisher Subscriber // Create a Topic! Topic<Foo> t = dp.create_topic<Foo>(name)!Pub/Sub // Create a DataWriter/DataWriter! DataWriter<Foo> dw = pub.create_datawriter(t);! DataWriter Topic DataReader DataReader<Foo> dr = sub.create_datareader(t);! Reader/Writer for application defined Topic Types
  • ¨  JMS allows to distribute Messages¨  DDS allows to share Data¨  Both DDS and JMS provide a Topic-Based Pub/Sub abstraction to match interests Messages & Data
  • JMS Message Text Map Object JMS Messages are Copyright  2010,  PrismTech  –    All  Rights  Reserved.  ¨  composed by ¨  Header – Used for routing Stream Body Byte Body ¨  Property – Filtering, etc. ¨  Body – Data 5 Different Body types Message¨  are supported Header Properties
  • Topic Types struct VehiclePosition{! string plate; //@Key!¨  Topic types can be defined long x;! in IDL, UML, XML, Java Copyright  2010,  PrismTech  –    All  Rights  Reserved.   long y;! }!¨  Topics types are extensible and evolvable¨  Rich set of annotations to Topic TrakCo.VehiclePosition deal with fields that might be optional, shared, etc. Topic Type VehiclePosition Topic Key plate x y¨  Each unique key value identifies a Topic Instance “A123” 101 202 Topic Instances “B456” 303 202¨  Topic Instance, can be Created, Read, Updated, “C789” 101 606 and Disposed (CRUD)
  • In Summary Copyright  2010,  PrismTech  –    All  Rights  Reserved.  DDS JMS¨  Topics have associated ¨  Topics represent a kind user defined Types of Destination for Messages¨  These user defined types ¨  User-Types have to be are used to read/write mapped into one of the topic instances 5 message bodies defined by JMS
  • Sending/Receiving Messages
  • Sending Message Copyright  2010,  PrismTech  –    All  Rights  Reserved.  ¨  JMS provides 5 // Create a Text Message! TextMessage tm = s.createTextMessage(“Hello”);! message body types // Send the Text Message! mp.send(tm);! !¨  Messages are sent through the Producer
  • Sending Message class VehiclePosition ! implements java.io.Serializable {! private String plate;! private long x;! private long y;! ! // Ctors / Setters / Getters! }! Copyright  2010,  PrismTech  –    All  Rights  Reserved.  ¨  JMS provides 5 ! VehiclePosition vp = ! message body types ! new VehiclePosition(“Hello”, 10, 20);! // Create an Object Message! ObjectMessage om = s.createObjectMessage(vp);!¨  Messages are sent // Send the Object Message! mp.send(om);! through the Producer !
  • Receiving Messages¨  JMS Application receive generic Message and Copyright  2010,  PrismTech  –    All  Rights  Reserved.   have to understand what the type is (usually // Receive Message…! TextMessage tm = (TextMessage)ms.receive();! via down-casts) String str = tm.getText();! !¨  Messages can be read proactively or listener can be registered¨  Messages are retrieved one at the time
  • Receiving Messages¨  JMS Application receive generic Message and Copyright  2010,  PrismTech  –    All  Rights  Reserved.   have to understand what the type is (usually ! ObjectMessage om = (ObjectMessage)ms.receive();! via down-casts) VehiclePosition vp = (VehiclePosition)om.getObject();! ! // Notice that any of the casts above could fail !¨  Messages can be read // at runtime…! proactively or listener can be registered¨  Messages are retrieved one at the time
  • Reading/Writing " Data
  • class VehiclePosition {!Writing Data public:! const std::string& plate() const;! void plate(const std::string& s);! int32_t x() const;! void x(int32_t i);! int32_t y() const;! void y(int32_t i);!¨  DDS allows // Encapsulated State Representation! };! Copyright  2010,  PrismTech  –    All  Rights  Reserved.   applications to define their own data types VehiclePosition vp(“Hello”, 10, 20);! dw << vp;! and associate them ! // Alternative Syntax! with Topics dw.write(vp);! ! !¨  Topic updates are written through the DataWriter
  • Reading Data¨  DDS provide a strongly Copyright  2010,  PrismTech  –    All  Rights  Reserved.   typed API for reading data that relies on DataReaders // Read Data! !¨  Messages can be read std::vector<VehiclePosition> data(size);! proactively or listener can std::vector<SampleInfo> info(size);! ! be registered dr.read(data.begin(), info.begin(), size);!¨  DDS provides A very flexible selection mechanism for topic samples
  • DDS vs. JMS ¨  DDS provides an end-to- ¨  JMS requires user to “guess Copyright  2010,  PrismTech  –    All  Rights  Reserved.   end type-safe abstraction types” this introduce for distributing publications potential for runtime errors of user defined topic types // Receive Message…! TextMessage tm = (TextMessage)ms.receive();! String str = tm.getText();!// Read Data! !! // =============================================!std::vector<VehiclePosition> data(size);! !std::vector<SampleInfo> info(size);! ObjectMessage om = (ObjectMessage)ms.receive();!! VehiclePosition vp = (VehiclePosition)om.getObject();!dr.read(data.begin(), info.begin(), size);! ! // Notice that any of the casts above could fail ! // at runtime…!
  • DDS. What Else?
  • Instance/History Management¨  An Instance per unique key value Copyright  2010,  PrismTech  –    All  Rights  Reserved.  ¨  An update for a Topic Instance is called Sample¨  DDS can maintain a configurable history of samples per Topic Instance
  • com.myco.VPoscom.myco.VPos DDS JMS Topic Instances vs. Messages Copyright  2010,  PrismTech  –    All  Rights  Reserved.  
  • Topic Instances vs. Messages DDS New Copyright  2010,  PrismTech  –    All  Rights  Reserved.   “A01” 100 200 com.myco.VPos JMS “A01” 100 200 com.myco.VPos
  • Topic Instances vs. Messages DDS New Copyright  2010,  PrismTech  –    All  Rights  Reserved.   “A01” 100 200 New “B41” 57 31 com.myco.VPos JMS “B41” 57 31 “A01” 100 200 com.myco.VPos
  • Topic Instances vs. Messages DDS New Copyright  2010,  PrismTech  –    All  Rights  Reserved.   “A01” 110 210 “A01” 100 200 New “B41” 57 31 com.myco.VPos JMS “A01” 110 210 “B41” 57 31 “A01” 100 200 com.myco.VPos
  • Topic Instances vs. Messages DDS New Copyright  2010,  PrismTech  –    All  Rights  Reserved.   “A01” 120 220 “A01” 110 210 “A01” 100 200 New “B41” 57 31 com.myco.VPos JMS “A01” 120 220 “A01” 110 210 “B41” 57 31 “A01” 100 200 com.myco.VPos
  • Topic Instances vs. Messages DDS New Copyright  2010,  PrismTech  –    All  Rights  Reserved.   “A01” 120 220 “A01” 110 210 “A01” 100 200 New “B41” 47 19 “B41” 57 31 com.myco.VPos JMS “B41” 47 19 “A01” 120 220 “A01” 110 210 “B41” 57 31 “A01” 100 200 com.myco.VPos
  • Topic Instances vs. Messages DDS New Copyright  2010,  PrismTech  –    All  Rights  Reserved.   “A01” 120 220 “A01” 110 210 “A01” 100 200 New “B41” Dis- osed p - “B41” 47 19 “B41” 57 31 com.myco.VPos JMS “B41” 47 19 “A01” 120 220 “A01” 110 210 “B41” 57 31 “A01” 100 200 com.myco.VPos
  • Dynamic Discovery Copyright  2010,  PrismTech  –    All  Rights  Reserved.  ¨  DDS dynamically discovers publishers, subscribers as well as Topics¨  Dynamic Discovery has a key role in subscriptions matching¨  No global configuration is required
  • QoS Framework¨  DDS provides a mechanism for Copyright  2010,  PrismTech  –    All  Rights  Reserved.   Type Matching end-to-end QoS QoS matching matching QoS QoS QoS QoS QoS QoS QoS Topic Name Publisher Subscriber Communication is ... DataWriter writes Type reads DataReader ...¨  ... established iff the DomainParticipant DataWriter writes Type reads DataReader DomainParticipant QoS offered by the Name Topic publisher QoS QoS QoS matches/exceeds that requested by the subscriber
  • QoS PoliciesQoS Policy Applicability RxO ModifiableDURABILITY T, DR, DW Y NDURABILITY T, DW N N Copyright  2010,  PrismTech  –    All  Rights  Reserved.  SERVICE Data AvailabilityLIFESPAN T, DW N/A Y QoS Policy Applicability RxO ModifiableHISTORY T, DR, DW N N TIME BASED DR N/A YPRESENTATION P, S Y N FILTER Resources RESOURCE T, DR, DW N NRELIABILITY T, DR, DW Y N LIMITSPARTITION P, S N Y ENTITY Data FACTORYDESTINATION T, DR, DW Y N Delivery USER DATA DP, DR, DW N YORDER T N Y ConfigurationOWNERSHIP T, DR, DW Y N TOPIC DATAOWNERSHIP DW N/A Y GROUP DATA P, S N YSTRENGTH LIVELINESS T, DR, DW Y NDEADLINE T, DR, DW Y Y WRITER DATA DW N/A YLATENCY T, DR, DW Y Y LIFECYCLE Data LifecycleBUDGET READER DATA DR N/A Y TimelinessTRANSPORT T, DW N/A Y LIFECYCLEPRIORITY
  • Content Awareness¨  DDS make it possible struct VehiclePosition{! string plate; @Key! Copyright  2010,  PrismTech  –    All  Rights  Reserved.   express filters and long x;! long y;! queries on the whole }! content of a topic type¨  Filters can be used to Filter Examples: establish content filtered subscriptions “x < %0 AND y < %1” “y BETWEEN (10 AND 20)”¨  Queries can be used to create local views of available data
  • High Performance Copyright  2010,  PrismTech  –    All  Rights  Reserved.  ¨  OpenSplice DDS is 2.5x-3x faster than high performance JMS implementations
  • High Performance Copyright  2010,  PrismTech  –    All  Rights  Reserved.  ¨  OpenSplice DDS delivers very low and predictable latencies Latency (usec)¨  No other Pub/Sub technology can approach similar level of performance! Size (bytes)
  • JMS Legacy?
  • Integrating JMS with DDS OpenSplice DDS Connector Existing JMS systems can be Copyright  2010,  PrismTech  –    All  Rights  Reserved.  ¨  Custom Connectors easily integrated with DDS today using Apache Camel OpenSplice DDS Custom ULS DDSI High Performance, High BLEND-Box WS-*¨  Availability Integration of DDSI REST JMS DDS with JMS will also available through the Blend- Box (available later this year) DDS Connectors Web Connectors compliant with the Web-Enabled DDS Specificaiton
  • DDS in Action
  • Summing Up
  • Concluding Remarks¨  DDS is a powerful lively standard for publish/ Copyright  2010,  PrismTech  –    All  Rights  Reserved.   subscribe¨  DDS provides some very useful abstractions not available in JMS, such as user-defined types, instances, history, etc.¨  DDS can be as simple to use as JMS, but when required provides far more knobs for tuning scalability, performance and QoS
  • OpenSplice DDSDelivering Performance, Openness, and Freedom http://www.opensplice.com/ http://www.opensplice.org/ http://www.slideshare.net/angelo.corsaro emailto:opensplicedds@prismtech.com Copyright  2010,  PrismTech  –    All  Rights  Reserved.   http://bit.ly/1Sreg http://twitter.com/acorsaro/ http://www.youtube.com/OpenSpliceTube http://opensplice.blogspot.com