Customer Logins

Obtain the data you need to make the most informed decisions by accessing our extensive portfolio of information, analytics, and expertise. Sign in to the product or service center of your choice.

Customer Logins

My Logins

All Customer Logins
S&P Global S&P Global Marketplace
Explore S&P Global

  • S&P Global
  • S&P Dow Jones Indices
  • S&P Global Market Intelligence
  • S&P Global Mobility
  • S&P Global Commodity Insights
  • S&P Global Ratings
  • S&P Global Sustainable1
Close
Discover more about S&P Global’s offerings
Investor Relations
  • Investor Relations Overview
  • Investor Presentations
  • Investor Fact Book
  • News Releases
  • Quarterly Earnings
  • SEC Filings & Reports
  • Executive Committee
  • Corporate Governance
  • Merger Information
  • Stock & Dividends
  • Shareholder Services
  • Contact Investor Relations
Languages
  • English
  • 中文
  • 日本語
  • 한국어
  • Português
  • Español
  • ไทย
About
  • About Us
  • Contact Us
  • Email Subscription Center
  • Media Center
  • Glossary
Product Login
S&P Global S&P Global Market Intelligence Market Intelligence
  • Who We Serve
  • Solutions
  • News & Insights
  • Events
  • Product Login
  • Request Follow Up
  •  
    • Academia
    • Commercial Banking
    • Corporations
     
    • Government & Regulatory Agencies
    • Insurance
    • Investment & Global Banking
     
    • Investment Management
    • Private Equity
    • Professional Services
  • WORKFLOW SOLUTIONS
    • Capital Formation
    • Credit & Risk Solutions
    • Data & Distribution
    • Economics & Country Risk
    • Sustainability
    • Financial Technology
     
    • Issuer & IR Solutions
    • Lending Solutions
    • Post-Trade Processing
    • Private Markets
    • Risk, Compliance, & Reporting
    • Supply Chain
    PRODUCTS
    • S&P Capital IQ Pro
    • S&P Global Marketplace
    • China Credit Analytics
    • Climate Credit Analytics
    • Credit Analytics
    • RatingsDirect ®
    • RatingsXpress ®
    • 451 Research
    See More S&P Global Solutions
     
    • Capital Access
    • Corporate Actions
    • KY3P ®
    • EDM
    • PMI™
    • BD Corporate
    • Bond Pricing
    • ChartIQ
  • CONTENT
    • Latest Headlines
    • Special Features
    • Blog
    • Research
    • Videos
    • Infographics
    • Newsletters
    • Client Case Studies
    PODCASTS
    • The Decisive
    • IR in Focus
    • Masters of Risk
    • MediaTalk
    • Next in Tech
    • The Pipeline: M&A and IPO Insights
    • Private Markets 360°
    • Street Talk
    SEE ALL EPISODES
    SECTOR-SPECIFIC INSIGHTS
    • Differentiated Data
    • Banking & Insurance
    • Energy
    • Maritime, Trade, & Supply Chain
    • Metals & Mining
    • Technology, Media, & Telecoms
    • Investment Research
    • Sector Coverage
    • Consulting & Advisory Services
    More ways we can help
    NEWS & RESEARCH TOPICS
    • Credit & Risk
    • Economics & Country Risk
    • Financial Services
    • Generative AI
    • Maritime & Trade
    • M&A
    • Private Markets
    • Sustainability & Climate
    • Technology
    See More
    • All Events
    • In-Person
    • Webinars
    • Webinar Replays
    Featured Events
    Webinar2024 Trends in Data Visualization & Analytics
    • 10/17/2024
    • Live, Online
    • 11:00 AM - 12:00 PM EDT
    In PersonInteract New York 2024
    • 10/15/2024
    • Center415, 415 5th Avenue, New York, NY
    • 10:00 -17:00 CEST
    In PersonDatacenter and Energy Innovation Summit 2024
    • 10/30/2024
    • Convene Hamilton Square, 600 14th St NW, Washington, DC 20005, US
    • 7:30 AM - 5:00 PM ET
  • PLATFORMS
    • S&P Capital IQ Pro
    • S&P Capital IQ
    • S&P Global China Credit Analytics
    • S&P Global Marketplace
    OTHER PRODUCTS
    • Credit Analytics
    • Panjiva
    • Money Market Directories
     
    • Research Online
    • 451 Research
    • RatingsDirect®
    See All Product Logins
×

Disclaimer:

I certify that I have checked the post for the following items:

  • URL is correct and does not have double hyphens.
  • Title is correct.
  • Date of post is correct (if scheduled for future go live the dates are the same).
  • R&A category is correct as it links with divisional sites.
  • Applicable authors are assigned to the blog.
  • Body of post is correct (images are displaying correct, bullets, numbers, etc.)
  • The body copy uses bold for titles, not headers.
  • All links are working correctly within the body post (hyperlinks, buttons, etc.)
  • Post closing is displaying correctly when applicable.
  • Featured is selected when desired (almost all posts should be labeled “featured.”)
  • Boilerplate text is displaying correctly when applicable.
  • CTA override is displaying correctly when applicable.
  • Related products are displaying correctly.
  • Content type and regions are correctly assigned in the R&A Maker so that they will appear correctly as facets.
  • The tags shown under “Explore” are correct (e.g., areas of interest, industries).
  • Corporate writing guidelines have been followed.
NOT LIVE
BLOG Jul 27, 2022

What is Idempotency?

Contributor Image
Doug Ferguson

What is Idempotency?

Think of your paycheck. You don't want a communications error between your employer and the payroll processor to prevent you from getting paid. If an error happens in that process, you want the communication to be re-sent, and when the re-send occurs it shouldn't cause you to get paid twice. Effectively, idempotency is the ability to re-send messages when needed without causing problems from duplicated processing. While you may not mind receiving your paycheck twice, you would feel differently if you were charged twice for a plane ticket.

We live in a world of interconnected systems. Our systems need the ability to re-send messages in the event of a failure, and systems receiving the communications should be capable of receiving the same message more than once without duplicating transactions. In the most general of terms, handling messages in an idempotent manner comes down to two concepts; knowing when a message needs to be re-sent, and knowing if an incoming message has already been processed. First let's look at some of the message flows that can occur in a REST-based system.

Point-to-Point Message Flows via REST:

Happy path:

When things go well, the message is sent once, processed once, and acknowledged once.

The code to handle the happy path is simply a single line of code invoking an async Send method.

Unfortunately, given enough time and enough traffic, you can be assured that something will eventually fail.

Ways it can go wrong:

The original message could fail during the send, because of a communication error or because the Consumer is down.

The message might be sent but have a failure in processing.

The Consumer may successfully report back a failure, or there may be a communication failure preventing the Producer from receiving a notification of success or failure.

In a point-to-point communication pattern like this, the message producer now has to be responsible for re-sending when anything other than the happy path occurs.

Point-to-point communication gets even more challenging when multiple consumers are interested in the same message.

Once the concept of multiple consumers is introduced, the logic for sending and re-sending messages reliably gets exponentially more difficult. What should the Producer do when a message fails for a single consumer. Does it repeatedly re-send the message to all the consumers until it's acknowledged by the failing consumer? Does it stop sending to the other consumers until the failing consumer finally acknowledges the message? Or, does the Producer keep track of which consumers were successful and which failed and send different content to each?

The problem gets even worse if you introduce the concept of ordered message delivery.

With this type of setup, you can quickly find yourself writing more code dealing with message delivery than with providing actual business features. Instead of doing that, we can solve the problem by changing our communication paradigm by using a system designed specifically for handling messaging and the related complexities.

A Better Approach:

If we go back to basics and consider the Separation of Responsibilities, our business code should be focused on providing business functionality. The capabilities around handling messaging and delivery rules have nothing to do with our core business logic. It is critical to the proper functioning of interconnected systems, but it's not part of our core competencies. Instead of writing message plumbing, we should instead focus on our business deliverables and offload message delivery concerns to a system designed specifically for that purpose. An additional benefit of using a messaging intermediary is we can increase system reliability since Message Producers can continue functioning and sending messages even when one or more Consumers are unavailable.

Various forms of messaging systems can act as intermediaries between message producers and consumers, and they range from Queues and SNS Topics to Enterprise Service Buses. One such option is Pulsar by Apache, which is a cloud-native message broker that addresses the shortcomings of some of the solutions that came before it.

According to their website (https://pulsar.apache.org/), "Apache Pulsar is a cloud-native, multi-tenant, high-performance solution for server-to-server messaging and queuing built on the publisher-subscribe (pub-sub) pattern." Instead of having point-to-point communication where each Producer knows about each consumer, Pulsar allows Producers and Consumers to communicate only with Pulsar, and Pulsar manages the reliable delivery of messages to consumers.

With this type of model, Pulsar is responsible for deliveries to the Consumers. If Consumer 3 doesn't successfully acknowledge a message, the Message Producer won't even know there was an issue, much less have to implement logic to try a re-delivery. All of that work can be offloaded to Pulsar. It is worth highlighting that this type of approach does not have point-to-point communication between systems. In other words, it uses asynchronous communication patterns.

We've Been Working Without a Message Broker Forever. Why Change Now?

Breaking up the Monolith

When working with monolithic software, code can communicate directly with other code dependencies via in-process calls. Communication within a monolith is easy, but the disadvantages of monolithic software begin to outweigh the benefits as software projects get larger and more complex. As we break functionality out into different services, we need another way for the services to communicate with each other in a reliable fashion. The moment we extract the first micro-service out of the monolith, we introduce inter-process communications and now the stability of the system as a whole is dependent on multiple services being up and running at the same time.

Interconnected Application Domains

Applications don't exist in a vacuum and need to communicate across different Application Domains, especially in large enterprises. In the past, a single business unit might have been able to operate in isolation, but as part of a larger organization, it becomes necessary for that business unit to share messaging and events with other parts of the organization. Not only do we need a way for messages to be transmitted within an application domain, we need to be able to communicate between domains. Message brokers facilitate this type of communication and can eliminate the need for message producers to change each time a new consumer needs to be added. Martin Fowler pointed out that message-based integration patterns allow us to reverse the direction of dependencies between Producers and Consumers. Upstream message Consumers can depend on messages generated by downstream Producers as opposed to Producers needing to know about specific Consumers in order to send messages.

Idempotent Consumers

I previously mentioned that Idempotency was about the ability of messages to be re-sent when necessary AND for message consumers to handle the receipt of duplicate messages without undesired side effects from duplicate processing. Much of the discussion so far was about the logical complexities of re-sending messages. A future post will show a code example with Consumer code capable of receiving the same message more than once while processing the duplicate messages "effectively once".

This is the first in a series of blog posts related to idempotency and how to handle it effectively.

Posted 27 July 2022 by Doug Ferguson, Director, Software Engineer, WSO Software, S&P Global Market Intelligence


S&P Global provides industry-leading data, software and technology platforms and managed services to tackle some of the most difficult challenges in financial markets. We help our customers better understand complicated markets, reduce risk, operate more efficiently and comply with financial regulation.


This article was published by S&P Global Market Intelligence and not by S&P Global Ratings, which is a separately managed division of S&P Global.

Previous Next
Recommended for you

Data and Information Services
Trade Processing
Risk and Regulatory Compliance
Financial Technology Solutions

Learn more about our WSO Software

Click here
Related Posts
VIEW ALL
Equities Commentary May 06, 2025

Securities Finance April 2025

Equities Commentary May 01, 2025

Deal or No Deal? The Risks and Rewards of the Paramount-Skydance Merger.

Equities Commentary Apr 30, 2025

Tariff-ic Times: Borrowing in Chinese ETFs surges.

VIEW ALL
{"items" : [ {"name":"share","enabled":true,"desc":"<strong>Share</strong>","mobdesc":"Share","options":[ {"name":"facebook","url":"https://www.facebook.com/sharer.php?u=http%3a%2f%2fstage.www.spglobal.com%2fmarketintelligence%2fen%2fmi%2fresearch-analysis%2fwhat-is-idempotency.html","enabled":true},{"name":"twitter","url":"https://twitter.com/intent/tweet?url=http%3a%2f%2fstage.www.spglobal.com%2fmarketintelligence%2fen%2fmi%2fresearch-analysis%2fwhat-is-idempotency.html&text=What+is+Idempotency%3f+%7c+S%26P+Global+","enabled":true},{"name":"linkedin","url":"https://www.linkedin.com/sharing/share-offsite/?url=http%3a%2f%2fstage.www.spglobal.com%2fmarketintelligence%2fen%2fmi%2fresearch-analysis%2fwhat-is-idempotency.html","enabled":true},{"name":"email","url":"?subject=What is Idempotency? | S&P Global &body=http%3a%2f%2fstage.www.spglobal.com%2fmarketintelligence%2fen%2fmi%2fresearch-analysis%2fwhat-is-idempotency.html","enabled":true},{"name":"whatsapp","url":"https://api.whatsapp.com/send?text=What+is+Idempotency%3f+%7c+S%26P+Global+ http%3a%2f%2fstage.www.spglobal.com%2fmarketintelligence%2fen%2fmi%2fresearch-analysis%2fwhat-is-idempotency.html","enabled":true}]}, {"name":"rtt","enabled":true,"mobdesc":"Top"} ]}
Filter Sort
  • About S&P Global Market Intelligence
  • Quality Program
  • Email Subscription Center
  • Media Center
  • Our Values
  • Investor Relations
  • Contact Customer Care & Sales
  • Careers
  • Our History
  • News Releases
  • Support by Division
  • Corporate Responsibility
  • Ventures
  • Quarterly Earnings
  • Report an Ethics Concern
  • Leadership
  • Press
  • SEC Filings & Reports
  • Office Locations
  • IOSCO ESG Rating & Data Product Statements
  • © 2025 S&P Global
  • Terms of Use
  • Cookie Notice
  • Privacy Policy
  • Disclosures
  • Do Not Sell My Personal Information