building a messaging framework on the salesforce1 platform
DESCRIPTION
This presentation describes an architecture to make asynchronous outbound webservice callouts using the Message Queue design patternTRANSCRIPT
![Page 1: Building a Messaging Framework on the Salesforce1 Platform](https://reader033.vdocuments.net/reader033/viewer/2022060117/55856e7ad8b42a512c8b48d1/html5/thumbnails/1.jpg)
Building a Messaging Framework on the Salesforce1 PlatformAnup Jadhav
Manager of Mobility / Technical Architect
@anup
![Page 2: Building a Messaging Framework on the Salesforce1 Platform](https://reader033.vdocuments.net/reader033/viewer/2022060117/55856e7ad8b42a512c8b48d1/html5/thumbnails/2.jpg)
Anup JadhavManager of Mobility / Technical Architect
@anup
![Page 3: Building a Messaging Framework on the Salesforce1 Platform](https://reader033.vdocuments.net/reader033/viewer/2022060117/55856e7ad8b42a512c8b48d1/html5/thumbnails/3.jpg)
OVERVIEW
![Page 4: Building a Messaging Framework on the Salesforce1 Platform](https://reader033.vdocuments.net/reader033/viewer/2022060117/55856e7ad8b42a512c8b48d1/html5/thumbnails/4.jpg)
OVERVIEW
Describe an architecture to make Asynchronous Outbound Webservice Callouts using a native custom built message queue
![Page 5: Building a Messaging Framework on the Salesforce1 Platform](https://reader033.vdocuments.net/reader033/viewer/2022060117/55856e7ad8b42a512c8b48d1/html5/thumbnails/5.jpg)
OVERVIEW
Describe an architecture to make Asynchronous Outbound Webservice Callouts using a native custom built message queue
![Page 6: Building a Messaging Framework on the Salesforce1 Platform](https://reader033.vdocuments.net/reader033/viewer/2022060117/55856e7ad8b42a512c8b48d1/html5/thumbnails/6.jpg)
OVERVIEW
Describe an architecture to make Asynchronous Outbound Webservice Callouts using a native custom built message queue
![Page 7: Building a Messaging Framework on the Salesforce1 Platform](https://reader033.vdocuments.net/reader033/viewer/2022060117/55856e7ad8b42a512c8b48d1/html5/thumbnails/7.jpg)
OVERVIEW
Describe an architecture to make Asynchronous Outbound Webservice Callouts using a native custom built message queue
![Page 8: Building a Messaging Framework on the Salesforce1 Platform](https://reader033.vdocuments.net/reader033/viewer/2022060117/55856e7ad8b42a512c8b48d1/html5/thumbnails/8.jpg)
OVERVIEW
Describe an architecture to make Asynchronous Outbound Webservice Callouts using a native custom built message queue
![Page 9: Building a Messaging Framework on the Salesforce1 Platform](https://reader033.vdocuments.net/reader033/viewer/2022060117/55856e7ad8b42a512c8b48d1/html5/thumbnails/9.jpg)
OVERVIEWMessage Queue Pattern
![Page 10: Building a Messaging Framework on the Salesforce1 Platform](https://reader033.vdocuments.net/reader033/viewer/2022060117/55856e7ad8b42a512c8b48d1/html5/thumbnails/10.jpg)
OVERVIEWMessage Queue Pattern
![Page 11: Building a Messaging Framework on the Salesforce1 Platform](https://reader033.vdocuments.net/reader033/viewer/2022060117/55856e7ad8b42a512c8b48d1/html5/thumbnails/11.jpg)
OVERVIEWMessage Queue Pattern
![Page 12: Building a Messaging Framework on the Salesforce1 Platform](https://reader033.vdocuments.net/reader033/viewer/2022060117/55856e7ad8b42a512c8b48d1/html5/thumbnails/12.jpg)
OVERVIEWMessage Queue Pattern
![Page 13: Building a Messaging Framework on the Salesforce1 Platform](https://reader033.vdocuments.net/reader033/viewer/2022060117/55856e7ad8b42a512c8b48d1/html5/thumbnails/13.jpg)
REQUIREMENTS
![Page 14: Building a Messaging Framework on the Salesforce1 Platform](https://reader033.vdocuments.net/reader033/viewer/2022060117/55856e7ad8b42a512c8b48d1/html5/thumbnails/14.jpg)
REQUIREMENTS• Automated Retry Capability• Allow SF Admin to Re-Submit Failed Request• Ability to view Webservice Request/Response Payload content• Ability to proactively alert Sys Admins if large no of Webservice Callouts are failing• Turn off particular type of Interface on-demand• Define Operation Hours• Metrics – response time, no.of failures, message volume per day etc
![Page 15: Building a Messaging Framework on the Salesforce1 Platform](https://reader033.vdocuments.net/reader033/viewer/2022060117/55856e7ad8b42a512c8b48d1/html5/thumbnails/15.jpg)
ARCHITECTURE
![Page 16: Building a Messaging Framework on the Salesforce1 Platform](https://reader033.vdocuments.net/reader033/viewer/2022060117/55856e7ad8b42a512c8b48d1/html5/thumbnails/16.jpg)
ARCHITECTUREUsing a middleware (MQ system not ETL)
• Complex to implement• Expensive• In-House skillset
![Page 17: Building a Messaging Framework on the Salesforce1 Platform](https://reader033.vdocuments.net/reader033/viewer/2022060117/55856e7ad8b42a512c8b48d1/html5/thumbnails/17.jpg)
ARCHITECTUREOutbound Messaging
• Supports single sObjects only• Enforce interface contract that the receiver should adhere to• Remote listener (end point) would need to handle request in an idempotent fashion• Can only be used with Workflow rules• You cannot build an audit trail using OM
![Page 18: Building a Messaging Framework on the Salesforce1 Platform](https://reader033.vdocuments.net/reader033/viewer/2022060117/55856e7ad8b42a512c8b48d1/html5/thumbnails/18.jpg)
ARCHITECTUREBespoke solution
Build something native on Force.com platform that Can retry webservice callouts Allows manual re-submission of callouts Stores request and response payload Alerts sys admins if an interface is down Provides analytics around webservice callouts
![Page 19: Building a Messaging Framework on the Salesforce1 Platform](https://reader033.vdocuments.net/reader033/viewer/2022060117/55856e7ad8b42a512c8b48d1/html5/thumbnails/19.jpg)
ARCHITECTURE
![Page 20: Building a Messaging Framework on the Salesforce1 Platform](https://reader033.vdocuments.net/reader033/viewer/2022060117/55856e7ad8b42a512c8b48d1/html5/thumbnails/20.jpg)
![Page 21: Building a Messaging Framework on the Salesforce1 Platform](https://reader033.vdocuments.net/reader033/viewer/2022060117/55856e7ad8b42a512c8b48d1/html5/thumbnails/21.jpg)
ARCHITECTUREMessage Queue
Used to hold web service messages Each message can be retried
automatically/manually Messages contain service handler
information Contains Request and Response
payload content
![Page 22: Building a Messaging Framework on the Salesforce1 Platform](https://reader033.vdocuments.net/reader033/viewer/2022060117/55856e7ad8b42a512c8b48d1/html5/thumbnails/22.jpg)
ARCHITECTUREBatch Job
Apex batch class : responsible for processing messages from Message Queue
Can process one message at a time Invokes the Service Handler
![Page 23: Building a Messaging Framework on the Salesforce1 Platform](https://reader033.vdocuments.net/reader033/viewer/2022060117/55856e7ad8b42a512c8b48d1/html5/thumbnails/23.jpg)
ARCHITECTUREScheduler
Acts like a Batch Job manager Is responsible for scheduling batch jobs
in a round robin fashion
![Page 24: Building a Messaging Framework on the Salesforce1 Platform](https://reader033.vdocuments.net/reader033/viewer/2022060117/55856e7ad8b42a512c8b48d1/html5/thumbnails/24.jpg)
ARCHITECTUREService Handler
Does the actual Webservice callout Updates the message and also updates
other sObjects if required
![Page 25: Building a Messaging Framework on the Salesforce1 Platform](https://reader033.vdocuments.net/reader033/viewer/2022060117/55856e7ad8b42a512c8b48d1/html5/thumbnails/25.jpg)
ARCHITECTUREWebservice Log
Log webservice requests and response in this table
Can be used in reports/dashboards Determine num of success, failures,
average response time
![Page 26: Building a Messaging Framework on the Salesforce1 Platform](https://reader033.vdocuments.net/reader033/viewer/2022060117/55856e7ad8b42a512c8b48d1/html5/thumbnails/26.jpg)
LIMITATIONS
![Page 27: Building a Messaging Framework on the Salesforce1 Platform](https://reader033.vdocuments.net/reader033/viewer/2022060117/55856e7ad8b42a512c8b48d1/html5/thumbnails/27.jpg)
LIMITATIONS Complex to implement Only supports asynchronous webservice callouts Be wary of callout, batch job and scheduler limitations Does not guarantee order or sequence of callouts Testing can be tricky
![Page 28: Building a Messaging Framework on the Salesforce1 Platform](https://reader033.vdocuments.net/reader033/viewer/2022060117/55856e7ad8b42a512c8b48d1/html5/thumbnails/28.jpg)
Demo
![Page 29: Building a Messaging Framework on the Salesforce1 Platform](https://reader033.vdocuments.net/reader033/viewer/2022060117/55856e7ad8b42a512c8b48d1/html5/thumbnails/29.jpg)
Questions
![Page 30: Building a Messaging Framework on the Salesforce1 Platform](https://reader033.vdocuments.net/reader033/viewer/2022060117/55856e7ad8b42a512c8b48d1/html5/thumbnails/30.jpg)
![Page 31: Building a Messaging Framework on the Salesforce1 Platform](https://reader033.vdocuments.net/reader033/viewer/2022060117/55856e7ad8b42a512c8b48d1/html5/thumbnails/31.jpg)
Join us for Pre Gala Drinks: cloudsherpas.com/df14UK Happy Hour Tuesday 14th October5pm - 7pm
540 Howard Street,San Fran, CA, 94105
Grab your FREE Entry Postcard here!