building a messaging framework on the salesforce1 platform

Post on 20-Jun-2015

265 Views

Category:

Technology

3 Downloads

Preview:

Click to see full reader

DESCRIPTION

This presentation describes an architecture to make asynchronous outbound webservice callouts using the Message Queue design pattern

TRANSCRIPT

Building a Messaging Framework on the Salesforce1 PlatformAnup Jadhav

Manager of Mobility / Technical Architect

@anup

Anup JadhavManager of Mobility / Technical Architect

@anup

OVERVIEW

OVERVIEW

Describe an architecture to make Asynchronous Outbound Webservice Callouts using a native custom built message queue

OVERVIEW

Describe an architecture to make Asynchronous Outbound Webservice Callouts using a native custom built message queue

OVERVIEW

Describe an architecture to make Asynchronous Outbound Webservice Callouts using a native custom built message queue

OVERVIEW

Describe an architecture to make Asynchronous Outbound Webservice Callouts using a native custom built message queue

OVERVIEW

Describe an architecture to make Asynchronous Outbound Webservice Callouts using a native custom built message queue

OVERVIEWMessage Queue Pattern

OVERVIEWMessage Queue Pattern

OVERVIEWMessage Queue Pattern

OVERVIEWMessage Queue Pattern

REQUIREMENTS

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

ARCHITECTURE

ARCHITECTUREUsing a middleware (MQ system not ETL)

• Complex to implement• Expensive• In-House skillset

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

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

ARCHITECTURE

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

ARCHITECTUREBatch Job

Apex batch class : responsible for processing messages from Message Queue

Can process one message at a time Invokes the Service Handler

ARCHITECTUREScheduler

Acts like a Batch Job manager Is responsible for scheduling batch jobs

in a round robin fashion

ARCHITECTUREService Handler

Does the actual Webservice callout Updates the message and also updates

other sObjects if required

ARCHITECTUREWebservice Log

Log webservice requests and response in this table

Can be used in reports/dashboards Determine num of success, failures,

average response time

LIMITATIONS

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

Demo

Questions

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!

top related