<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Polly on Coffee-Driven Development</title>
    <link>https://duijzer.com/tags/polly/</link>
    <description>Recent content in Polly on Coffee-Driven Development</description>
    <generator>Hugo</generator>
    <language>en</language>
    <copyright>© {currentYear}, Jacob Duijzer. All rights reserved</copyright>
    <lastBuildDate>Sun, 30 May 2021 20:25:11 +0200</lastBuildDate>
    <atom:link href="https://duijzer.com/tags/polly/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Specflow and Eventual Consistency</title>
      <link>https://duijzer.com/posts/specflow-eventual-consistency/</link>
      <pubDate>Sun, 30 May 2021 20:25:11 +0200</pubDate>
      <guid>https://duijzer.com/posts/specflow-eventual-consistency/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://specflow.org/&#34;&gt;SpecFlow&lt;/a&gt; is a tool which can be used to describe test scenarios and automate the tests. Although I have been using SpecFlow for a while now I never used it for advanced examples where time might be an issue. Lets show a simple example scenario first. A scenario, written in &lt;a href=&#34;https://cucumber.io/docs/gherkin/reference/&#34;&gt;Gherkin&lt;/a&gt;, looks like this:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-gherkin&#34; data-lang=&#34;gherkin&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;Scenario:&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt; Add simple item with due date&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;&lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;    Given &lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;the user enters &amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;wash my car&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;&amp;#34;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;    &lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;And &lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;the user adds a due date of &amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;1-1-2022&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;&amp;#34;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;    &lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;When &lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;the user saves the item&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;    &lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;Then &lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;the item &amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;wash my car&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;&amp;#34; is added to the list&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;    &lt;/span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;And &lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;the due date is &amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#e6db74&#34;&gt;1-1-2022&lt;/span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;&amp;#34;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This scenario is easy to implement, the item will be added and stored. That&amp;rsquo;s it. Easy to verify, no delays, straight forward. But what if you have some microservices with a queueing mechanism? A scenario where data will be queued before processing so we can&amp;rsquo;t exactly know when the data is processed?&lt;/p&gt;</description>
    </item>
    <item>
      <title>Retry and fallback policies in C# with Polly</title>
      <link>https://duijzer.com/posts/polly-refit/</link>
      <pubDate>Thu, 18 Apr 2019 20:10:00 +0200</pubDate>
      <guid>https://duijzer.com/posts/polly-refit/</guid>
      <description>&lt;p&gt;In this blog I will try to explain how one can create clean and effective policies to retry API calls and have fallbacks when requests are failing. With &lt;a href=&#34;https://github.com/App-vNext/Polly&#34;&gt;Polly&lt;/a&gt; it is possible to create complex and advanced scenarios for error handling with just a few lines of code.&lt;/p&gt;&#xA;&lt;p&gt;This week I was connecting an eCommerce web application to an ERP system with REST APIs. There are multiple endpoints, all authenticated with OAuth. To make sure all calls to the APIs will have a high success rate I had to implement retry mechanisms for different scenarios.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
