SlideShare ist ein Scribd-Unternehmen logo
1 von 43
Downloaden Sie, um offline zu lesen
Using OpenMQ
           Linda Schneider
           Technical Lead
           Sun Microsystems,
           Inc.
What will be covered ?
An introduction to OpenMQ.
A Customer example.
Basic customer requirements.
Building part of the infrastructure.

Warnings:
No in depth coverage
Assumes basic JMS knowledge

                                                                   [2]
            Copyright Sun Microsystems Inc. All Rights Reserved.
What is OpenMQ ?



                                                        [3]
 Copyright Sun Microsystems Inc. All Rights Reserved.
Overview
Allows heterogenous applications to reliability and
asynchronously pass data between each other.
Open Source Java Message Service (JMS)
implementation (+ additions)
Default Messaging Provider for Glassfish
Useful on its own for standalone JMS applications
Enterprise level quality (>8 years in development)
Open Source since JavaOne 2006
Available as a supported product: Sun Java System
Message Queue (SJSMQ)
                                                                   [4]
            Copyright Sun Microsystems Inc. All Rights Reserved.
Tell Me More
Developer and User discussion forums
Stable builds with product releases
Early access, promoted builds available
New features, and fixes
Dual license support (GPL v2 and CDDL)
Open source version of Java MQ is available from
http://mq.dev.java.net



                                                                    [5]
             Copyright Sun Microsystems Inc. All Rights Reserved.
Using OpenMQ ?



                                                       [6]
Copyright Sun Microsystems Inc. All Rights Reserved.
An example
To mimic problems faced in designing applications, an
example:
Represents a complex system with loosely connected
applications
Utilizes various types of messaging
Is easy to understand
Is at least minimally interesting



                                                                  [7]
           Copyright Sun Microsystems Inc. All Rights Reserved.
Our Example: Santa Claus, Inc
Why, you ask ?

Even if you don't believe in Santa Claus, you must still
understand that delivering all those presents would be
a daunting task
And while its not Christmas which comes but once a
year, but requires year round planning and
preparation.
Just because Santa Claus lives at the North Pole,
doesn't imply he can't use technology
                                                                   [8]
            Copyright Sun Microsystems Inc. All Rights Reserved.
Overall System Requirements
Santa Claus, Inc. software applications need do the
following:
Handle gift selection and delivery
Manage resources e.g.
gifts
reindeer
Elves
Track general status information
how many days before Christmas
etc.
                                                                   [9]
            Copyright Sun Microsystems Inc. All Rights Reserved.
What are we doing:
Focusing on handling christmas gift processing
Steps to design it include:
Determining the high level operation
Coming up with the name and type of destinations
Determining models used for the messaging
Determining load characteristics
Looking at code for some components




                                                                    [10]
             Copyright Sun Microsystems Inc. All Rights Reserved.
Defining the High Level
Operation of the System


                                                           [11]
    Copyright Sun Microsystems Inc. All Rights Reserved.
What do we need to do ?




                                                              [12]
       Copyright Sun Microsystems Inc. All Rights Reserved.
What do we need to do ? (cont.)




                                                              [13]
       Copyright Sun Microsystems Inc. All Rights Reserved.
What are the destinations ?



                                                            [14]
     Copyright Sun Microsystems Inc. All Rights Reserved.
The Child Queue




                                                              [15]
       Copyright Sun Microsystems Inc. All Rights Reserved.
The Naughty/Nice Queues




                                                             [16]
      Copyright Sun Microsystems Inc. All Rights Reserved.
The Wrap Queue




                                                             [17]
      Copyright Sun Microsystems Inc. All Rights Reserved.
The Stuff to Pack Queue




                                                              [18]
       Copyright Sun Microsystems Inc. All Rights Reserved.
Select-a-gift Queues




                                                              [19]
       Copyright Sun Microsystems Inc. All Rights Reserved.
Topic LogChild




                                                              [20]
       Copyright Sun Microsystems Inc. All Rights Reserved.
A quick overview to design
         patterns


                                                            [21]
     Copyright Sun Microsystems Inc. All Rights Reserved.
Some basic design patterns:
Pattern                    Description
                           Message is sent to another application who 
Request/Reply              sends back a response
                           Messages go through several iterations, the 
                           message is persisted at key points where 
Step Operations            processing it again would be expensive
Broadcast                  One message goes to many consumers
                           Multiple consumers send messages to a single 
Conduit                    destination
Batch                      Messages are processed in a chunk
                           Messages must be processed within a short 
                           period of time (e.g. under an hour) and can not 
Time Critical/Sensitive    be lost




                                                                              [22]
                  Copyright Sun Microsystems Inc. All Rights Reserved.
More things to think about:
Use persistent messages if it can not afford to be lost
Use non-persistent messages for:
   non-critical step messages (when it can be repeated)
   Request/Reply
   Anytime a message can be lost on a server crash
Use durables for Topics when it may need to be
retrieved later
Use normal or XA transactions when multiple things
must process together:
   XA if it includes other resources like databases
                                                                    [23]
             Copyright Sun Microsystems Inc. All Rights Reserved.
Processing Queue Child
Conduit: many producers to one queue
Persistent: would be time consuming to lose message




                                                                  [24]
           Copyright Sun Microsystems Inc. All Rights Reserved.
Processing Naughty and Nice
Step Pattern: one step of it
Naughty Queue: Non-Persistent
   its OK if a child who is bad
      misses their coal
Nice Queue: Persistent.
   They must get their present.




                                                                     [25]
              Copyright Sun Microsystems Inc. All Rights Reserved.
Processing Nice
Step Pattern: more steps of it
Multiple resources so XA




                                                                   [26]
            Copyright Sun Microsystems Inc. All Rights Reserved.
Processing Nice (Select a gift)
Request/Reply Pattern
Non-persistent
Action repeated on failure




                                                                   [27]
            Copyright Sun Microsystems Inc. All Rights Reserved.
The Wrap Queue
Step operation
Persistent: end of an expensive set of steps that they
don't want to repeat




                                                                   [28]
            Copyright Sun Microsystems Inc. All Rights Reserved.
The Log Child Topic
Broadcast Pattern
Persistent because santa wants his database accurate




                                                                  [29]
           Copyright Sun Microsystems Inc. All Rights Reserved.
In this example:
The batch pattern was not used
   Santa does use It for processing HR updates for the elves
The time sensitive/critical data pattern was not used:
   Santa does use it during present delivery on christmas eve
     to track where he is
Because he has no time sensitive/critical data,
reliability is important however data availability isn't




                                                                    [30]
             Copyright Sun Microsystems Inc. All Rights Reserved.
Performance Requirements
22 billion kids
364 days for preparation (since christmas is taken)
   31,526,000 seconds
70 children/second must be processed
Assume 60% are “nice”
Assume 40% downtime to cover outages and normal
processing (so goal is approx 100 kids/second)



                                                                   [31]
            Copyright Sun Microsystems Inc. All Rights Reserved.
Performance Requirements (cont)
Naughty Kids use
  1 Persistent queue (child)
  1 Non-persistent queue (naughty)
  1 Persistent Topic (log child)
Nice Kids Use:
  Persistent Queue (child)
  Persistent Queue (nice)
  2 Non-Persistent Queues (Inventory request and reply
    queues)
  Non-persistent queue (Wrap)
  1 Persistent Topic (log child)
                                                                  [32]
           Copyright Sun Microsystems Inc. All Rights Reserved.
The cold hard requirements
Messages:
  Child: 100 msgs/second (persistent)
  Naughty: 40 msgs/second (non-persistent)
  Log Child: 100msgs/second (persistent)
  Nice: 60 msgs/second (persistent in XA transaction)
  Inventory request/reply: 60 msgs/second *2 (non-
    persistent)
  Wrap: 60 msgs/second (persistent)
TOTALS:
  Persistent: 380 msgs/second
  Non-persistent: 160 msgs/second
                                                                   [33]
            Copyright Sun Microsystems Inc. All Rights Reserved.
Some Sample Code



                                                        [34]
 Copyright Sun Microsystems Inc. All Rights Reserved.
Sending the “Child” message
public void doPost(HttpServletRequest request,
  HttpServletResponse response)       throws ServletException,
  IOException {

    // retrieve initial context (ic)
     QueueConnectionFactory qcf = (QueueConnectionFactory)
               ic.lookup(quot;MyConnectionFactoryquot;);
     Queue destQueue = (Queue)ic.lookup(quot;Childquot;);
     QueueConnection connection = qcf.createQueueConnection();
     try {
           QueueSession session = connection.createQueueSession(
                   False, Session.AUTO_ACKNOWLEDGE);
           QueueSender sender = session.createSender(destQueue);
           MapMessage msg = session.createMapMessage();
           // Set each item
           msg.setString(“firstname”,
                 request.getParameter(“firstname”));
             // … retrieve other properties … ;
             sender.send(msg);
      } finally {
            connection.close();
      }
}
                                                                    [35]
             Copyright Sun Microsystems Inc. All Rights Reserved.
Processing the “nice” queue
public void onMessage(Message inMessage) {
    TextMessage msg = null;
    try {
        //Message is of type text and has a unique child id
        msg = (TextMessage) inMessage;
        String id = msg.getText();
        String[] list = db.getList(id); // makes SQL call
        String item = null;
        if (list == null) { // no list, send request
            String item = getListItem(); //next slide
        } else {
            item = list[0];
        }
        //update inventory
        db.updateInventory(item, id);//makes SQL call
        // put on packing list
        pack(item, id);
    } catch (Exception e) { // things went wrong roll back
        mdc.setRollbackOnly();
    }
}


                                                                    [36]
             Copyright Sun Microsystems Inc. All Rights Reserved.
Processing the “nice” queue (step 2)
public String getListItem(String childid)
          throws Exception {
     QueueConnectionFactory factory =
          jndiContext.lookup(“MyQueueFactory”);
     QueueConnection qc = factory.createQueueConnection();
     qc.start();
     QueueSession session = qc.createSession(true,
                 Session.AUTO_ACKNOWLEDGED);
     Queue q = session.createQueue(“RandomPresent”);
     Queue reply = session.createTemporaryQueue();
     // get sender and receiver
     QueueSender sender = session.createSender(q);
     QueueReceiver receiver = session.createReceiver(q);
     //send message and wait
     TextMessage m = session.createTextMessage(childid);
     m.setJMSReplyTo(reply);
     //send the message
     sender.send(m);
     TextMessage back = (TextMessage)
          receiver.receive(60*1000); // wait a minute
     if (back == null) { didn't get anything
         throw new Exception(“Nothing”);
     return back.getText();
                                                                     [37]
}             Copyright Sun Microsystems Inc. All Rights Reserved.
Processing the “nice” queue (step 3)
public String pack(String item, String child_id)
    throws JMSException
{
    QueueConnectionFactory factory =
         jndiContext.lookup(“MyQueueFactory”);
    QueueConnection qc = factory.createQueueConnection();
    QueueSession session = qc.createSession(true,
             Session.AUTO_ACKNOWLEDGED););
    Queue q = session.createQueue(“Pack”);

    // get sender
    QueueSender sender = session.createSender(q);

    //send message
    MapMessage m = session.createMapMessage(childid);
    m.setString(“child_id”, child_id);
    m.setString(“present”, item);
    sender.send(m);
}


                                                                   [38]
            Copyright Sun Microsystems Inc. All Rights Reserved.
You'll need to fill in the rest



                                                             [39]
      Copyright Sun Microsystems Inc. All Rights Reserved.
More Information



                                                       [40]
Copyright Sun Microsystems Inc. All Rights Reserved.
OpenMQ -- More Information
Visit the product webpage
http://sun.com/software/products/message_queue
Join the Open Message Queue project
https://mq.dev.java.net
Browse the product documentation
http://docs.sun.com/app/docs/coll/1307.3
Take the free technical training
http://www.sun.com/training/catalog/courses/WMT-SMQ-1491.xml



                                                                     [41]
              Copyright Sun Microsystems Inc. All Rights Reserved.
Related Information
Java Composite Application Platform Suite
http://sun.com/software/javaenterprisesystem/javacaps/
Java System Identity Manager
http://sun.com/software/products/identity
Project GlassFish
https://glassfish.dev.java.net/
The Aquarium, A community forum
http://blogs.sun.com/theaquarium/


                                                                     [42]
              Copyright Sun Microsystems Inc. All Rights Reserved.
Thank You!


Using OpenMQ
Linda Schneider
linda.schneider@sun.com

Weitere ähnliche Inhalte

Ähnlich wie Building With Open MQ

Proactive Threat Detection and Safeguarding of Data for Enhanced Cyber resili...
Proactive Threat Detection and Safeguarding of Data for Enhanced Cyber resili...Proactive Threat Detection and Safeguarding of Data for Enhanced Cyber resili...
Proactive Threat Detection and Safeguarding of Data for Enhanced Cyber resili...Sandeep Patil
 
Wicsa2011 cloud tutorial
Wicsa2011 cloud tutorialWicsa2011 cloud tutorial
Wicsa2011 cloud tutorialAnna Liu
 
Cloud Security Engineer Interview Questions.pdf
Cloud Security Engineer Interview Questions.pdfCloud Security Engineer Interview Questions.pdf
Cloud Security Engineer Interview Questions.pdfInfosec Train
 
Cloud Security Engineer Interview Questions.pdf
Cloud Security Engineer Interview Questions.pdfCloud Security Engineer Interview Questions.pdf
Cloud Security Engineer Interview Questions.pdfinfosec train
 
Cloud security Presentation
Cloud security PresentationCloud security Presentation
Cloud security PresentationAjay p
 
Highway to heaven - Microservices Meetup Dublin
Highway to heaven - Microservices Meetup DublinHighway to heaven - Microservices Meetup Dublin
Highway to heaven - Microservices Meetup DublinChristian Deger
 
Microservices - when, why and how incontrodevops.it
Microservices  - when, why and how incontrodevops.itMicroservices  - when, why and how incontrodevops.it
Microservices - when, why and how incontrodevops.itGiuseppe Lavagetto
 
Node and Micro-Services at IBM
Node and Micro-Services at IBMNode and Micro-Services at IBM
Node and Micro-Services at IBMDejan Glozic
 
#VirtualDesignMaster 3 Challenge 2 - Abdullah Abdullah
#VirtualDesignMaster 3 Challenge 2 - Abdullah Abdullah#VirtualDesignMaster 3 Challenge 2 - Abdullah Abdullah
#VirtualDesignMaster 3 Challenge 2 - Abdullah Abdullahvdmchallenge
 
Muves3 Elastic Grid Java One2009 Final
Muves3 Elastic Grid Java One2009 FinalMuves3 Elastic Grid Java One2009 Final
Muves3 Elastic Grid Java One2009 FinalElastic Grid, LLC.
 
AWS Partner Presentation - Accenture Digital Supply Chain In The Cloud
AWS Partner Presentation - Accenture Digital Supply Chain In The CloudAWS Partner Presentation - Accenture Digital Supply Chain In The Cloud
AWS Partner Presentation - Accenture Digital Supply Chain In The CloudAmazon Web Services
 
Dcs cloud architecture-high-level-design
Dcs cloud architecture-high-level-designDcs cloud architecture-high-level-design
Dcs cloud architecture-high-level-designIsaac Chiang
 
Presentation copy
Presentation   copyPresentation   copy
Presentation copyAdel Zalok
 
Cloud and the Future of Networked Systems
Cloud and the Future of Networked SystemsCloud and the Future of Networked Systems
Cloud and the Future of Networked SystemsJames Urquhart
 
Building Cloud-Native Applications in MiCADO - MiCADO webinar No.2/4 - 09/2019
Building Cloud-Native Applications in MiCADO - MiCADO webinar No.2/4 - 09/2019Building Cloud-Native Applications in MiCADO - MiCADO webinar No.2/4 - 09/2019
Building Cloud-Native Applications in MiCADO - MiCADO webinar No.2/4 - 09/2019Project COLA
 
AWS 101 - Journey to the AWS Cloud Series
AWS 101 - Journey to the AWS Cloud SeriesAWS 101 - Journey to the AWS Cloud Series
AWS 101 - Journey to the AWS Cloud SeriesAmazon Web Services
 
Project SpaceLock - Architecture & Design
Project SpaceLock - Architecture & DesignProject SpaceLock - Architecture & Design
Project SpaceLock - Architecture & DesignAbhishek Mishra
 
Security threat issues and countermeasures in cloud computing
Security threat issues and countermeasures in cloud computingSecurity threat issues and countermeasures in cloud computing
Security threat issues and countermeasures in cloud computingJahangeer Qadiree
 

Ähnlich wie Building With Open MQ (20)

Proactive Threat Detection and Safeguarding of Data for Enhanced Cyber resili...
Proactive Threat Detection and Safeguarding of Data for Enhanced Cyber resili...Proactive Threat Detection and Safeguarding of Data for Enhanced Cyber resili...
Proactive Threat Detection and Safeguarding of Data for Enhanced Cyber resili...
 
Wicsa2011 cloud tutorial
Wicsa2011 cloud tutorialWicsa2011 cloud tutorial
Wicsa2011 cloud tutorial
 
Cloud Security Engineer Interview Questions.pdf
Cloud Security Engineer Interview Questions.pdfCloud Security Engineer Interview Questions.pdf
Cloud Security Engineer Interview Questions.pdf
 
Cloud Security Engineer Interview Questions.pdf
Cloud Security Engineer Interview Questions.pdfCloud Security Engineer Interview Questions.pdf
Cloud Security Engineer Interview Questions.pdf
 
Cloud security Presentation
Cloud security PresentationCloud security Presentation
Cloud security Presentation
 
Highway to heaven - Microservices Meetup Dublin
Highway to heaven - Microservices Meetup DublinHighway to heaven - Microservices Meetup Dublin
Highway to heaven - Microservices Meetup Dublin
 
Microservices - when, why and how incontrodevops.it
Microservices  - when, why and how incontrodevops.itMicroservices  - when, why and how incontrodevops.it
Microservices - when, why and how incontrodevops.it
 
Node and Micro-Services at IBM
Node and Micro-Services at IBMNode and Micro-Services at IBM
Node and Micro-Services at IBM
 
DR hosting & cloud
DR hosting & cloudDR hosting & cloud
DR hosting & cloud
 
#VirtualDesignMaster 3 Challenge 2 - Abdullah Abdullah
#VirtualDesignMaster 3 Challenge 2 - Abdullah Abdullah#VirtualDesignMaster 3 Challenge 2 - Abdullah Abdullah
#VirtualDesignMaster 3 Challenge 2 - Abdullah Abdullah
 
Muves3 Elastic Grid Java One2009 Final
Muves3 Elastic Grid Java One2009 FinalMuves3 Elastic Grid Java One2009 Final
Muves3 Elastic Grid Java One2009 Final
 
AWS Partner Presentation - Accenture Digital Supply Chain In The Cloud
AWS Partner Presentation - Accenture Digital Supply Chain In The CloudAWS Partner Presentation - Accenture Digital Supply Chain In The Cloud
AWS Partner Presentation - Accenture Digital Supply Chain In The Cloud
 
Dcs cloud architecture-high-level-design
Dcs cloud architecture-high-level-designDcs cloud architecture-high-level-design
Dcs cloud architecture-high-level-design
 
Presentation copy
Presentation   copyPresentation   copy
Presentation copy
 
cloud-computing-security.ppt
cloud-computing-security.pptcloud-computing-security.ppt
cloud-computing-security.ppt
 
Cloud and the Future of Networked Systems
Cloud and the Future of Networked SystemsCloud and the Future of Networked Systems
Cloud and the Future of Networked Systems
 
Building Cloud-Native Applications in MiCADO - MiCADO webinar No.2/4 - 09/2019
Building Cloud-Native Applications in MiCADO - MiCADO webinar No.2/4 - 09/2019Building Cloud-Native Applications in MiCADO - MiCADO webinar No.2/4 - 09/2019
Building Cloud-Native Applications in MiCADO - MiCADO webinar No.2/4 - 09/2019
 
AWS 101 - Journey to the AWS Cloud Series
AWS 101 - Journey to the AWS Cloud SeriesAWS 101 - Journey to the AWS Cloud Series
AWS 101 - Journey to the AWS Cloud Series
 
Project SpaceLock - Architecture & Design
Project SpaceLock - Architecture & DesignProject SpaceLock - Architecture & Design
Project SpaceLock - Architecture & Design
 
Security threat issues and countermeasures in cloud computing
Security threat issues and countermeasures in cloud computingSecurity threat issues and countermeasures in cloud computing
Security threat issues and countermeasures in cloud computing
 

Mehr von Eduardo Pelegri-Llopart

Pelegri Desarrollando en una nueva era de software
Pelegri   Desarrollando en una nueva era de software Pelegri   Desarrollando en una nueva era de software
Pelegri Desarrollando en una nueva era de software Eduardo Pelegri-Llopart
 
Market trends in IT - exchange cala - October 2015
Market trends in IT - exchange cala - October 2015Market trends in IT - exchange cala - October 2015
Market trends in IT - exchange cala - October 2015Eduardo Pelegri-Llopart
 
The impact of IOT - exchange cala - 2015
The impact of IOT - exchange cala - 2015The impact of IOT - exchange cala - 2015
The impact of IOT - exchange cala - 2015Eduardo Pelegri-Llopart
 
What is IoT and how Modulus and Pacific can Help - Featuring Node.js and Roll...
What is IoT and how Modulus and Pacific can Help - Featuring Node.js and Roll...What is IoT and how Modulus and Pacific can Help - Featuring Node.js and Roll...
What is IoT and how Modulus and Pacific can Help - Featuring Node.js and Roll...Eduardo Pelegri-Llopart
 
What is the Internet of Things and How it Impacts You
What is the Internet of Things and How it Impacts YouWhat is the Internet of Things and How it Impacts You
What is the Internet of Things and How it Impacts YouEduardo Pelegri-Llopart
 
Ehcache Architecture, Features And Usage Patterns
Ehcache Architecture, Features And Usage PatternsEhcache Architecture, Features And Usage Patterns
Ehcache Architecture, Features And Usage PatternsEduardo Pelegri-Llopart
 

Mehr von Eduardo Pelegri-Llopart (20)

Juggling at freenome
Juggling   at freenomeJuggling   at freenome
Juggling at freenome
 
Csumb capstone-fall2016
Csumb capstone-fall2016Csumb capstone-fall2016
Csumb capstone-fall2016
 
Digital activitymanagement
Digital activitymanagementDigital activitymanagement
Digital activitymanagement
 
Progress next iot_pelegri
Progress next iot_pelegriProgress next iot_pelegri
Progress next iot_pelegri
 
Pelegri Desarrollando en una nueva era de software
Pelegri   Desarrollando en una nueva era de software Pelegri   Desarrollando en una nueva era de software
Pelegri Desarrollando en una nueva era de software
 
Market trends in IT - exchange cala - October 2015
Market trends in IT - exchange cala - October 2015Market trends in IT - exchange cala - October 2015
Market trends in IT - exchange cala - October 2015
 
The impact of IOT - exchange cala - 2015
The impact of IOT - exchange cala - 2015The impact of IOT - exchange cala - 2015
The impact of IOT - exchange cala - 2015
 
IOT - Presentation to PEP @ Progress
IOT - Presentation to PEP @ ProgressIOT - Presentation to PEP @ Progress
IOT - Presentation to PEP @ Progress
 
Node.js as an IOT Bridge
Node.js as an IOT BridgeNode.js as an IOT Bridge
Node.js as an IOT Bridge
 
What is IoT and how Modulus and Pacific can Help - Featuring Node.js and Roll...
What is IoT and how Modulus and Pacific can Help - Featuring Node.js and Roll...What is IoT and how Modulus and Pacific can Help - Featuring Node.js and Roll...
What is IoT and how Modulus and Pacific can Help - Featuring Node.js and Roll...
 
What is the Internet of Things and How it Impacts You
What is the Internet of Things and How it Impacts YouWhat is the Internet of Things and How it Impacts You
What is the Internet of Things and How it Impacts You
 
Community Update 25 Mar2010 - English
Community Update 25 Mar2010 - EnglishCommunity Update 25 Mar2010 - English
Community Update 25 Mar2010 - English
 
GlassFish Community Update 25 Mar2010
GlassFish Community Update 25 Mar2010GlassFish Community Update 25 Mar2010
GlassFish Community Update 25 Mar2010
 
Glass Fish Portfolio C1 West V3.Mini
Glass Fish Portfolio C1 West V3.MiniGlass Fish Portfolio C1 West V3.Mini
Glass Fish Portfolio C1 West V3.Mini
 
Virtual Box Aquarium May09
Virtual Box Aquarium May09Virtual Box Aquarium May09
Virtual Box Aquarium May09
 
Introduction To Web Beans
Introduction To Web BeansIntroduction To Web Beans
Introduction To Web Beans
 
Ehcache Architecture, Features And Usage Patterns
Ehcache Architecture, Features And Usage PatternsEhcache Architecture, Features And Usage Patterns
Ehcache Architecture, Features And Usage Patterns
 
OpenDS Primer Aquarium
OpenDS Primer AquariumOpenDS Primer Aquarium
OpenDS Primer Aquarium
 
Fuji Overview
Fuji OverviewFuji Overview
Fuji Overview
 
Nuxeo 5.2 Glassfish
Nuxeo 5.2 GlassfishNuxeo 5.2 Glassfish
Nuxeo 5.2 Glassfish
 

Kürzlich hochgeladen

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 

Kürzlich hochgeladen (20)

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 

Building With Open MQ

  • 1. Using OpenMQ Linda Schneider Technical Lead Sun Microsystems, Inc.
  • 2. What will be covered ? An introduction to OpenMQ. A Customer example. Basic customer requirements. Building part of the infrastructure. Warnings: No in depth coverage Assumes basic JMS knowledge [2] Copyright Sun Microsystems Inc. All Rights Reserved.
  • 3. What is OpenMQ ? [3] Copyright Sun Microsystems Inc. All Rights Reserved.
  • 4. Overview Allows heterogenous applications to reliability and asynchronously pass data between each other. Open Source Java Message Service (JMS) implementation (+ additions) Default Messaging Provider for Glassfish Useful on its own for standalone JMS applications Enterprise level quality (>8 years in development) Open Source since JavaOne 2006 Available as a supported product: Sun Java System Message Queue (SJSMQ) [4] Copyright Sun Microsystems Inc. All Rights Reserved.
  • 5. Tell Me More Developer and User discussion forums Stable builds with product releases Early access, promoted builds available New features, and fixes Dual license support (GPL v2 and CDDL) Open source version of Java MQ is available from http://mq.dev.java.net [5] Copyright Sun Microsystems Inc. All Rights Reserved.
  • 6. Using OpenMQ ? [6] Copyright Sun Microsystems Inc. All Rights Reserved.
  • 7. An example To mimic problems faced in designing applications, an example: Represents a complex system with loosely connected applications Utilizes various types of messaging Is easy to understand Is at least minimally interesting [7] Copyright Sun Microsystems Inc. All Rights Reserved.
  • 8. Our Example: Santa Claus, Inc Why, you ask ? Even if you don't believe in Santa Claus, you must still understand that delivering all those presents would be a daunting task And while its not Christmas which comes but once a year, but requires year round planning and preparation. Just because Santa Claus lives at the North Pole, doesn't imply he can't use technology [8] Copyright Sun Microsystems Inc. All Rights Reserved.
  • 9. Overall System Requirements Santa Claus, Inc. software applications need do the following: Handle gift selection and delivery Manage resources e.g. gifts reindeer Elves Track general status information how many days before Christmas etc. [9] Copyright Sun Microsystems Inc. All Rights Reserved.
  • 10. What are we doing: Focusing on handling christmas gift processing Steps to design it include: Determining the high level operation Coming up with the name and type of destinations Determining models used for the messaging Determining load characteristics Looking at code for some components [10] Copyright Sun Microsystems Inc. All Rights Reserved.
  • 11. Defining the High Level Operation of the System [11] Copyright Sun Microsystems Inc. All Rights Reserved.
  • 12. What do we need to do ? [12] Copyright Sun Microsystems Inc. All Rights Reserved.
  • 13. What do we need to do ? (cont.) [13] Copyright Sun Microsystems Inc. All Rights Reserved.
  • 14. What are the destinations ? [14] Copyright Sun Microsystems Inc. All Rights Reserved.
  • 15. The Child Queue [15] Copyright Sun Microsystems Inc. All Rights Reserved.
  • 16. The Naughty/Nice Queues [16] Copyright Sun Microsystems Inc. All Rights Reserved.
  • 17. The Wrap Queue [17] Copyright Sun Microsystems Inc. All Rights Reserved.
  • 18. The Stuff to Pack Queue [18] Copyright Sun Microsystems Inc. All Rights Reserved.
  • 19. Select-a-gift Queues [19] Copyright Sun Microsystems Inc. All Rights Reserved.
  • 20. Topic LogChild [20] Copyright Sun Microsystems Inc. All Rights Reserved.
  • 21. A quick overview to design patterns [21] Copyright Sun Microsystems Inc. All Rights Reserved.
  • 22. Some basic design patterns: Pattern Description Message is sent to another application who  Request/Reply sends back a response Messages go through several iterations, the  message is persisted at key points where  Step Operations processing it again would be expensive Broadcast One message goes to many consumers Multiple consumers send messages to a single  Conduit destination Batch Messages are processed in a chunk Messages must be processed within a short  period of time (e.g. under an hour) and can not  Time Critical/Sensitive be lost [22] Copyright Sun Microsystems Inc. All Rights Reserved.
  • 23. More things to think about: Use persistent messages if it can not afford to be lost Use non-persistent messages for: non-critical step messages (when it can be repeated) Request/Reply Anytime a message can be lost on a server crash Use durables for Topics when it may need to be retrieved later Use normal or XA transactions when multiple things must process together: XA if it includes other resources like databases [23] Copyright Sun Microsystems Inc. All Rights Reserved.
  • 24. Processing Queue Child Conduit: many producers to one queue Persistent: would be time consuming to lose message [24] Copyright Sun Microsystems Inc. All Rights Reserved.
  • 25. Processing Naughty and Nice Step Pattern: one step of it Naughty Queue: Non-Persistent its OK if a child who is bad misses their coal Nice Queue: Persistent. They must get their present. [25] Copyright Sun Microsystems Inc. All Rights Reserved.
  • 26. Processing Nice Step Pattern: more steps of it Multiple resources so XA [26] Copyright Sun Microsystems Inc. All Rights Reserved.
  • 27. Processing Nice (Select a gift) Request/Reply Pattern Non-persistent Action repeated on failure [27] Copyright Sun Microsystems Inc. All Rights Reserved.
  • 28. The Wrap Queue Step operation Persistent: end of an expensive set of steps that they don't want to repeat [28] Copyright Sun Microsystems Inc. All Rights Reserved.
  • 29. The Log Child Topic Broadcast Pattern Persistent because santa wants his database accurate [29] Copyright Sun Microsystems Inc. All Rights Reserved.
  • 30. In this example: The batch pattern was not used Santa does use It for processing HR updates for the elves The time sensitive/critical data pattern was not used: Santa does use it during present delivery on christmas eve to track where he is Because he has no time sensitive/critical data, reliability is important however data availability isn't [30] Copyright Sun Microsystems Inc. All Rights Reserved.
  • 31. Performance Requirements 22 billion kids 364 days for preparation (since christmas is taken) 31,526,000 seconds 70 children/second must be processed Assume 60% are “nice” Assume 40% downtime to cover outages and normal processing (so goal is approx 100 kids/second) [31] Copyright Sun Microsystems Inc. All Rights Reserved.
  • 32. Performance Requirements (cont) Naughty Kids use 1 Persistent queue (child) 1 Non-persistent queue (naughty) 1 Persistent Topic (log child) Nice Kids Use: Persistent Queue (child) Persistent Queue (nice) 2 Non-Persistent Queues (Inventory request and reply queues) Non-persistent queue (Wrap) 1 Persistent Topic (log child) [32] Copyright Sun Microsystems Inc. All Rights Reserved.
  • 33. The cold hard requirements Messages: Child: 100 msgs/second (persistent) Naughty: 40 msgs/second (non-persistent) Log Child: 100msgs/second (persistent) Nice: 60 msgs/second (persistent in XA transaction) Inventory request/reply: 60 msgs/second *2 (non- persistent) Wrap: 60 msgs/second (persistent) TOTALS: Persistent: 380 msgs/second Non-persistent: 160 msgs/second [33] Copyright Sun Microsystems Inc. All Rights Reserved.
  • 34. Some Sample Code [34] Copyright Sun Microsystems Inc. All Rights Reserved.
  • 35. Sending the “Child” message public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // retrieve initial context (ic) QueueConnectionFactory qcf = (QueueConnectionFactory) ic.lookup(quot;MyConnectionFactoryquot;); Queue destQueue = (Queue)ic.lookup(quot;Childquot;); QueueConnection connection = qcf.createQueueConnection(); try { QueueSession session = connection.createQueueSession( False, Session.AUTO_ACKNOWLEDGE); QueueSender sender = session.createSender(destQueue); MapMessage msg = session.createMapMessage(); // Set each item msg.setString(“firstname”, request.getParameter(“firstname”)); // … retrieve other properties … ; sender.send(msg); } finally { connection.close(); } } [35] Copyright Sun Microsystems Inc. All Rights Reserved.
  • 36. Processing the “nice” queue public void onMessage(Message inMessage) { TextMessage msg = null; try { //Message is of type text and has a unique child id msg = (TextMessage) inMessage; String id = msg.getText(); String[] list = db.getList(id); // makes SQL call String item = null; if (list == null) { // no list, send request String item = getListItem(); //next slide } else { item = list[0]; } //update inventory db.updateInventory(item, id);//makes SQL call // put on packing list pack(item, id); } catch (Exception e) { // things went wrong roll back mdc.setRollbackOnly(); } } [36] Copyright Sun Microsystems Inc. All Rights Reserved.
  • 37. Processing the “nice” queue (step 2) public String getListItem(String childid) throws Exception { QueueConnectionFactory factory = jndiContext.lookup(“MyQueueFactory”); QueueConnection qc = factory.createQueueConnection(); qc.start(); QueueSession session = qc.createSession(true, Session.AUTO_ACKNOWLEDGED); Queue q = session.createQueue(“RandomPresent”); Queue reply = session.createTemporaryQueue(); // get sender and receiver QueueSender sender = session.createSender(q); QueueReceiver receiver = session.createReceiver(q); //send message and wait TextMessage m = session.createTextMessage(childid); m.setJMSReplyTo(reply); //send the message sender.send(m); TextMessage back = (TextMessage) receiver.receive(60*1000); // wait a minute if (back == null) { didn't get anything throw new Exception(“Nothing”); return back.getText(); [37] } Copyright Sun Microsystems Inc. All Rights Reserved.
  • 38. Processing the “nice” queue (step 3) public String pack(String item, String child_id) throws JMSException { QueueConnectionFactory factory = jndiContext.lookup(“MyQueueFactory”); QueueConnection qc = factory.createQueueConnection(); QueueSession session = qc.createSession(true, Session.AUTO_ACKNOWLEDGED);); Queue q = session.createQueue(“Pack”); // get sender QueueSender sender = session.createSender(q); //send message MapMessage m = session.createMapMessage(childid); m.setString(“child_id”, child_id); m.setString(“present”, item); sender.send(m); } [38] Copyright Sun Microsystems Inc. All Rights Reserved.
  • 39. You'll need to fill in the rest [39] Copyright Sun Microsystems Inc. All Rights Reserved.
  • 40. More Information [40] Copyright Sun Microsystems Inc. All Rights Reserved.
  • 41. OpenMQ -- More Information Visit the product webpage http://sun.com/software/products/message_queue Join the Open Message Queue project https://mq.dev.java.net Browse the product documentation http://docs.sun.com/app/docs/coll/1307.3 Take the free technical training http://www.sun.com/training/catalog/courses/WMT-SMQ-1491.xml [41] Copyright Sun Microsystems Inc. All Rights Reserved.
  • 42. Related Information Java Composite Application Platform Suite http://sun.com/software/javaenterprisesystem/javacaps/ Java System Identity Manager http://sun.com/software/products/identity Project GlassFish https://glassfish.dev.java.net/ The Aquarium, A community forum http://blogs.sun.com/theaquarium/ [42] Copyright Sun Microsystems Inc. All Rights Reserved.
  • 43. Thank You! Using OpenMQ Linda Schneider linda.schneider@sun.com