<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Serkan Çamkerten on Medium]]></title>
        <description><![CDATA[Stories by Serkan Çamkerten on Medium]]></description>
        <link>https://medium.com/@serkancamkerten?source=rss-4baf60202f34------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*1hYObSwxWj_tnd7iV-5sjQ.jpeg</url>
            <title>Stories by Serkan Çamkerten on Medium</title>
            <link>https://medium.com/@serkancamkerten?source=rss-4baf60202f34------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 12:55:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@serkancamkerten/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[CQRS (Command Query Responsibility Segregation)]]></title>
            <link>https://medium.com/@serkancamkerten/cqrs-command-query-responsibility-segregation-87ef8912d01?source=rss-4baf60202f34------2</link>
            <guid isPermaLink="false">https://medium.com/p/87ef8912d01</guid>
            <category><![CDATA[mediator]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[design-patterns]]></category>
            <category><![CDATA[cqrs]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Serkan Çamkerten]]></dc:creator>
            <pubDate>Fri, 17 Feb 2023 17:24:03 GMT</pubDate>
            <atom:updated>2023-02-17T17:24:03.965Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*-IlOhrP_pzccSy3me14OMA.png" /></figure><h4>WHAT IS CQRS?</h4><p>CQRS is an architectural approach that aims to improve performance and scalability by separating the read (query) and write (command) operations of an application.</p><p>Many applications today use a monolithic architecture where both read and write operations are performed on the same database.</p><p>However, in large-scale applications, we may encounter problems such as performance, scalability and integrity.</p><p>To overcome these problems, we may prefer an alternative architectural approach such as CQRS introduced by Martin Fowler in 2005.</p><p>CQRS processes transactions in the application in two separate parts: commands and queries.</p><p>Commands are used to make changes to the application (INSERT, UPDATE, DELETE), while queries are used to retrieve data from the application.</p><p>This approach aims to improve performance and increase scalability by using a database optimized for reads and a separate database for writes.</p><p>In our practice, a clearer distinction is made between transactions and we lay the foundations of the SoC (Separation Of Concerns) principle, as each unit assumes its own responsibility.</p><h4>CQRS ADVANTAGES</h4><p><strong>Performance</strong></p><p>CQRS improves performance by using different units for read operations and write operations.<br>Query unit is optimized for read operations while Instruction unit is optimized for write operations.<br>Therefore, each unit is optimized only for its own processes and gives the best results in terms of performance.</p><p><strong>Scalability</strong></p><p>CQRS can increase scalability by separating read and write operations on separate servers.<br>Because CQRS is based on an asynchronous architecture, it can better manage the load on the system and make it more easily scalable.</p><p><strong>Integrity</strong></p><p>Using a separate server for writes is important to maintain data integrity.</p><p><strong>Maintenance</strong></p><p>CQRS makes the application easy to maintain. Because the query and command units are separate and each focuses on their own operations. Therefore, a problem that occurs in one skin does not affect other skins.</p><h4>CQRS DISADVANTAGES</h4><p><strong>Complexity</strong></p><p>CQRS makes the architecture of the application more complex. This can complicate the development and maintenance of the application.</p><p><strong>Data Inconsistency</strong></p><p>CQRS can cause data inconsistency by using separate servers for read and write operations.<br>Inconsistent results can be obtained, especially if the query is made before the write operation is complete.</p><h4>Conclusion</h4><p>The implementation of CQRS depends on the requirements and functionality of the application. In small-scale applications, the advantages of using CQRS may outweigh the disadvantages.<br>However, in large-scale applications, the advantages of CQRS in terms of performance, scalability, and integrity may be more obvious.</p><p>Proper implementation of CQRS requires a good selection of data models, management of asynchronous transactions, a good testing strategy, and a good management approach. Therefore, application developers should do a good analysis and plan properly before implementing the CQRS architecture.</p><p>In this article, we covered the basics, advantages, and disadvantages of the CQRS architecture. Although CQRS has many advantages, it also has disadvantages as it requires a different approach. However, when implemented correctly, it can be useful for improving performance and ensuring consistency, especially in large and complex applications.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=87ef8912d01" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[WCF Self-Hosting]]></title>
            <link>https://medium.com/adessoturkey/wcf-self-hosting-de34573bdddb?source=rss-4baf60202f34------2</link>
            <guid isPermaLink="false">https://medium.com/p/de34573bdddb</guid>
            <category><![CDATA[self-hosting]]></category>
            <category><![CDATA[csharp]]></category>
            <category><![CDATA[dot-net-framework]]></category>
            <category><![CDATA[dotnet]]></category>
            <category><![CDATA[wcf]]></category>
            <dc:creator><![CDATA[Serkan Çamkerten]]></dc:creator>
            <pubDate>Mon, 23 Jan 2023 13:46:44 GMT</pubDate>
            <atom:updated>2023-01-23T15:22:34.783Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*skHRSbvpI1ptwsDz_ss1xQ.png" /></figure><p>For client applications to consume WCF services, those services must be hosted. There are different options for hosting a WCF service.</p><ul><li>Self-Hosting</li><li>Windows Service</li><li>Internet Information Service (IIS)</li><li>Windows Activation Service (WAS)</li></ul><p>In this article, we will only touch on self-hosting.</p><p><em>The process of hosting a WCF service in a manageable .NET application is called “self-hosting”. Console, WPF, and Win Forms applications are examples of .NET applications that can be managed.</em></p><p><strong>Advantages</strong></p><ul><li>Installation is easy. Configuration can be done in the app.config file. With a few lines of code, you can get the service running.</li><li>Debugging is easy; a process is not applied to the application where the WCF service is hosted for this work.</li><li>Supports all binding and transmission protocols.</li><li>ServiceHost guarantees both flexibility and lifetime operation in the opening and closing of methods.</li></ul><h3>Create a WCF service and try to host it.</h3><p>First, let’s create a class library named WCF DemoService.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*GMktkN80FIqO8DH6MqqiFA.png" /></figure><p><strong>Delete </strong><strong>Class 1 that comes by default and create a folder called CalculateWCFService.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/654/1*rtT70_qwzHcwrpjE1aQb5Q.png" /></figure><p>Add a new WCF service named CalculateSRV inside the CalculateWCFService folder.</p><p>There will be two files named ICalculateSRV and CalculateSRV. Edit these files.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4fbae142aeaf4b80ac4ef35d825bd974/href">https://medium.com/media/4fbae142aeaf4b80ac4ef35d825bd974/href</a></iframe><p>The WCF service is ready to be hosted. We can start hosting operations by creating a new console application named Host.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Pl0JKBV-F_e1Cf-vMoCdWQ.png" /></figure><p>First, edit the app.config file on the host.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*W9JMy637A7L0bCht8Y8-CQ.png" /></figure><p>We create a new host object with ServiceHost. Do not forget to specify the service type when creating the host object.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/49034857b941271846d409672404bcc4/href">https://medium.com/media/49034857b941271846d409672404bcc4/href</a></iframe><p>Select the host project as the startup project and start it.</p><p>Great. We have created a WCF service, and it is hosted using self-hosting.</p><p>So, do WCF services always perform the desired operation on their own? Of course not. It will have some dependencies to perform operations.</p><h3>So, how do we manage my dependencies in our WCF services?</h3><p>Let’s say we have a class that does the calculations.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4fbae142aeaf4b80ac4ef35d825bd974/href">https://medium.com/media/4fbae142aeaf4b80ac4ef35d825bd974/href</a></iframe><p>Edit CalculateSRV.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9ab07b3b8e36690b86c35f09f99aca7b/href">https://medium.com/media/9ab07b3b8e36690b86c35f09f99aca7b/href</a></iframe><p>This is the error we get when we start the application again:</p><p><em>System.InvalidOperationException: “The service type provided could not be loaded as a service because it does not have a default (parameter-less) constructor. To fix the problem, add a default constructor to the type, or pass an instance of the type to the host.”</em></p><p>CalculateSRV is dependent on CalculateService. Since we do not manage dependencies, it looks for the default constructor method and gives an error since it cannot find it.</p><p>We will use Autofac and Autofac.WCF packages to manage dependencies.</p><p>Create a Startup class within the host project and manage the dependencies.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/280e19644fc6452de97c344aedef00c8/href">https://medium.com/media/280e19644fc6452de97c344aedef00c8/href</a></iframe><p>Notify the dependencies of the host object before it becomes the host.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8ad08c6278241d17f9fcb1dba26bd365/href">https://medium.com/media/8ad08c6278241d17f9fcb1dba26bd365/href</a></iframe><p>We can now host a WCF service by managing dependencies.</p><h3>So how can I host multiple WCF services?</h3><p>In the above example, there was only CalculateService. What if I had my x, y, z services with CalculateService?</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fc1b7e2d95ba59acbeb81dab748a2ca5/href">https://medium.com/media/fc1b7e2d95ba59acbeb81dab748a2ca5/href</a></iframe><p>1. We created an interface named IContract and gave it to our service contracts.</p><p>2. We created a new user WCF service and the decoration service it will use.</p><p>3. We added a new WCF service to our app.config file.</p><p>4. We added the dependencies to the container inside the Startup.</p><p>5. We created a method named “CreateHostWithDependencies”. This method takes as parameters the type it will host and which container it will add the dependencies to. The reason why it is in a generic structure is that we want to specify what type of contract it will be.</p><p>6. We create a method called OpenHosts in Startup. This method takes a list of hosts with added dependencies as parameters and initializes them.</p><p>7. We create a new host list in Program.cs and send the resulting list to the OpenHosts method.</p><p>These are the steps we need to take when we are going to add a new WCF from now on.</p><p><strong>Let’s start the host…</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*BaKznXvlVQQM4dh5ASGWXw.png" /></figure><p>Github WCF Self-Hosting: <a href="https://github.com/roserkan/wcf-selfhosting">wcf-selfhosting</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de34573bdddb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/adessoturkey/wcf-self-hosting-de34573bdddb">WCF Self-Hosting</a> was originally published in <a href="https://medium.com/adessoturkey">adessoTurkey</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Service Lifetimes]]></title>
            <link>https://medium.com/@serkancamkerten/service-lifetimes-5bb2d90d6c26?source=rss-4baf60202f34------2</link>
            <guid isPermaLink="false">https://medium.com/p/5bb2d90d6c26</guid>
            <category><![CDATA[lifetime]]></category>
            <category><![CDATA[csharp]]></category>
            <category><![CDATA[dependency-injection]]></category>
            <category><![CDATA[net-core]]></category>
            <category><![CDATA[dependency-inversion]]></category>
            <dc:creator><![CDATA[Serkan Çamkerten]]></dc:creator>
            <pubDate>Sun, 09 Oct 2022 20:35:44 GMT</pubDate>
            <atom:updated>2023-01-29T08:29:52.713Z</atom:updated>
            <content:encoded><![CDATA[<p>Hepimiz Dependency Injection kullanıyoruz. Dependency Injection kavramı ile birlikte bilmemiz gereken bir diğer kavram &quot;Service Lifetimes&quot;.</p><p>Kayıt ettiğimiz servisler kullanılırken oluşturulan her nesnenin bir yaşam ömrü vardır. Bu yaşam ömürlerini yönetebilmemiz için &quot;Microsoft.Extensions.DependencyInjection&quot; kütüphanesi altında gelen üç temel servis ömrü vardır. Singleton, Scoped ve Transient.</p><h4>Singleton</h4><p>Servis çağırıldığında bir kere örneği oluşturulur ve uygulama süresi boyunca sadece bu örnek kullanılır.</p><h4>Scoped</h4><p>Her istek olduğunda servis yeniden oluşturulur. İstek kapması boyunca sadece bu örnek kullanılır.</p><h4>Transient</h4><p>Servis her çağırıldığında yeni bir örnek oluşturur.</p><h4>Daha iyi anlamak için örnek üzerinden gidelim.</h4><p>Rastgele sayılar üretmesi için bir interface ve onu implemente eden bir servis yazıyoruz. Servisin yapıcı method’unda rastgele bir sayı oluşturuyoruz. Bunun sebebi her yeni nesne oluşturulduğunda yeni bir sayı geleceği için olayı kavramamız daha net olacak.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/048a0fc051b0c6450f61502c9dba2dc0/href">https://medium.com/media/048a0fc051b0c6450f61502c9dba2dc0/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f6ed9c875f07f488514b0a64fea438c4/href">https://medium.com/media/f6ed9c875f07f488514b0a64fea438c4/href</a></iframe><p>Üç temel servis ömrü ile servislerimizi kayıt edebiliriz.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9f71dd15a70511355249a4ee06d6d8a9/href">https://medium.com/media/9f71dd15a70511355249a4ee06d6d8a9/href</a></iframe><p>Son olarak Controller. Controller RandomNumberService class’ımıza bağımlı durumda.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/65c57453b86a74aaccc095cc465f96da/href">https://medium.com/media/65c57453b86a74aaccc095cc465f96da/href</a></iframe><h4>Her istek atıldığında servis 3 kere çağırılıyor. Örnek boyunca iki şer kere istek atılıyor.</h4><h4>Singleton kullandığımızda sonuç:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/271/1*y0yYcVf8t41Nr5e9o9XP_w.png" /><figcaption>Sağdaki sonuç 2. isteğimize ait sonuç.</figcaption></figure><p>Tüm sonuçlar aynı. İlk isteğimizde servis 3 kere çağırıldı. Servis ilk defa çağırıldığında bir örneği oluşturuldu. Geri kalan tüm servisler ilk oluşturulan nesne üzerinden çağırıldığı için tüm sonuçlar aynı.</p><h4>Scoped kullandığımızda sonuç:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/310/1*3jQ3hi0ZlrT-0LgydlJutQ.png" /><figcaption>Sağdaki sonuç 2. isteğimize ait sonuç.</figcaption></figure><p>Scoped yaşam döngüsü istek süresi boyuncadır. İlk isteği attığımızda 3 kere çağırılıyor. İlk örnek alındığında diğer ikisi aynı istek kapsamında(scope’unda) olduğu için aynı nesneyi kullandı. Yani scoped kullanıldığında nesne istek süresi boyunca devam eder.</p><h4>Transient kullandığımızda sonuç:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/276/1*GW_a1vdVVW69j_tdqePbZA.png" /><figcaption>Sağdaki sonuç 2. isteğimize ait sonuç.</figcaption></figure><p>Transient kullanıldığında her servis çağırıldığında yeni bir örnek oluşturur.</p><h4>Umarım bu yazı “Service Lifetimes” hakkında ki ufak soru işaretlerinizi gidermiştir.</h4><p>Linkedin: <a href="https://www.linkedin.com/in/serkancamkerten/">https://www.linkedin.com/in/serkancamkerten/</a><br>Github: <a href="https://github.com/roserkan">https://github.com/roserkan</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5bb2d90d6c26" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[.Net Core RabbitMQ Mesaj Gönderme ve Okuma]]></title>
            <link>https://medium.com/@serkancamkerten/net-core-rabbitmq-mesaj-g%C3%B6nderme-ve-okuma-4293d0e1b461?source=rss-4baf60202f34------2</link>
            <guid isPermaLink="false">https://medium.com/p/4293d0e1b461</guid>
            <category><![CDATA[c-sharp-programming]]></category>
            <category><![CDATA[rabbitmq]]></category>
            <category><![CDATA[net-core]]></category>
            <category><![CDATA[message-broker]]></category>
            <category><![CDATA[message-queue]]></category>
            <dc:creator><![CDATA[Serkan Çamkerten]]></dc:creator>
            <pubDate>Fri, 03 Jun 2022 15:14:20 GMT</pubDate>
            <atom:updated>2022-06-05T15:30:38.725Z</atom:updated>
            <content:encoded><![CDATA[<h3>.NET 6 ile RabbitMQ Mesaj Gönderme ve Okuma</h3><h4>RabbitMQ nedir?</h4><p>RabbitMQ Erlang dili ile geliştirilmiş açık kaynak kodlu bir mesaj kuyruk sistemidir.<br>RabbitMQ dışında Apache Kafka, ActiveMQ, MSMQ vb. gibi farklı alternatifler mevcuttur.</p><h4>Neden Kullanmalıyız?</h4><p>Request-Response süresini azaltmak,<br>Anlık olarak gerçekleşmesi gerekmeyen (uzun süren) işlemler,<br>Mikroservislerimiz arasında haberleşmek için, gibi özellikler sayabiliriz.</p><h3>Nasıl Çalışır?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*yxcb2ON-PJVhXMk4frJ49g.png" /></figure><ul><li>Publisher sahip olduğu mesajı kuyruğa gönderir.</li><li>Publisher mesajı gönderdikten sonra gönderilen mesajı Exchange karşılar ve route bilgisine göre gerekli kuyruğa gönderir.</li><li>Kuyruktan mesajları alıp işlemek isteyen consumer yapısıdır.</li><li>Producer ve Consumer programlama dillerinden bağımsızdır.</li><li>.Net ile geliştirilmiş bir uygulamadan publish edilmiş bir mesajı<br>Nodejs ile geliştirilmiş bir uygulama alıp tüketebilir.</li></ul><h4>Örnek Uygulama</h4><ol><li><strong>Publisher’ın mesaj gönderebilmesi için RabbitMQ sunucumuza bağlantı ve kanal oluşturmak.</strong></li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9c50ef4c2f89c88f21fe1a8ea4b8afe7/href">https://medium.com/media/9c50ef4c2f89c88f21fe1a8ea4b8afe7/href</a></iframe><p>RabbitMQ sunucumuza bağlantı sağlayıp bir kanal oluşturduk.</p><p><strong>2. Kuyruk oluşturma</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/55cc22adb44f635cd062767630efd772/href">https://medium.com/media/55cc22adb44f635cd062767630efd772/href</a></iframe><p>channel nesnesi üzerinden bir kuyruk tanımladık.</p><p><strong>queue</strong>: kuyruğun adı</p><p><strong>durable</strong>:</p><p>true =&gt; RabbitMQ da oluşan kuyruklar fiziksel olarak tutulur ve kaybolmaz.</p><p><strong>false </strong>=&gt;RabbitMQ da oluşan kuyruklar memory’de tutulur. RabbitMQ restart atarsa kuyruk silinir</p><p><strong>exclusive</strong>: Kuyruğa birden fazla kanalın bağlanıp bağlanmayacağına karar verir.</p><p><strong>autoDelete</strong>: True değerine karşılık tüm mesajlar bitince kuyruğu siler.</p><p><strong>3. Mesaj oluşturma ve gönderme</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fbfd78288ee1bf2b7550e27f767e58c5/href">https://medium.com/media/fbfd78288ee1bf2b7550e27f767e58c5/href</a></iframe><p>Gönderilecek mesajın içeriği kullanıcı bilgileri olduğu için User sınıfı tanımlandı.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/97f80b39bc12dde7551b508571700c25/href">https://medium.com/media/97f80b39bc12dde7551b508571700c25/href</a></iframe><p>RabbitMQ mesajları byte dizisi olarak gönderir. Bu sebeple oluşturuduğumuz kullanıcı nesnelerini serialize edip daha sonra byte dizisi haline getiriyoruz.</p><p>channel nesnesi üzerinden BasicPublish ile mesajımızı gönderiyoruz.</p><p><strong>exchange</strong>: Exchange kullanmayacaksak boş bir değer gönderiyoruz. Bu sayede Default Exchange kullanılacaktır. Exchange türlerini diğer yazılarımda değinip örnekler yapacağım.</p><p><strong><em>routingKey</em> </strong>: Default Exchange’de routingKey ile kuyruğun adı aynı olmalı. Biz kuyruğumuza user-queue adını vermiştik. O kuyruğa mesaj göndermek için routingKey değerimizi user-queue veriyoruz.</p><p><strong><em>body</em> </strong>: Gönderilecek byte dizisi halindeki mesajımız.</p><p>Uygulamayı başlattığımızda mesajlar kuyruğa gidecektir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*KV_AQWqzLCxEeIiMeErjKg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l88oVSVVKFRwznyDjVwy5A.png" /></figure><p>user-queue adında bir kuyruk oluştu ve hazırda bekleyen 50 tane mesaj var.</p><p><strong>4. Mesajı almak ve işlemek</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/477f924260a27bdc25be7fa5d5f518b2/href">https://medium.com/media/477f924260a27bdc25be7fa5d5f518b2/href</a></iframe><p>Farklı bir uygulama üzerinden tekrar RabbitMQ sunucumuza bağlanıyoruz. Bu sefer mesaj göndermek değil bu kanaldaki kuyruktan mesajları alıp işlemek için. Burada bir kuyruk tanımlaması yapmadık çünkü bir kuyruğumuz olduğundan eminiz. Aynı değerlerde bir kuyruk oluşturursak bir problem olmaz.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cb70bf8308b12143c6a76318a4850910/href">https://medium.com/media/cb70bf8308b12143c6a76318a4850910/href</a></iframe><p>Kuyruktaki mesajları alabilmek için bir event oluşturduk ve BasicConsume ile tüketime geçtik.</p><p><strong>queue:</strong> Mesajların hangi kuyruktan alınacağı.</p><p><strong><em>autoAck</em>:</strong> Kuruktan alınan mesajın silinip silinmemesine karar veriyor. Gelen mesajı işlerken beklenmedik hatalar ile karşılaşılabilir bu sebeple silinmesi önerilmez.</p><p><strong><em>consumer</em>:</strong> Gelen mesajların tüketicisi.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9717a0d3b0f0e08e89782247d3cbc882/href">https://medium.com/media/9717a0d3b0f0e08e89782247d3cbc882/href</a></iframe><p>Gelen mesajları tüketen consumer üzerinden Received ile mesajları okuyabiliriz. Mesajlar byte dizisi olarak geldiği için gerekli dönüşümleri yapıp ekrana yazdırıyoruz.</p><p>Eğer işlem başarılı ise channel nesnesi üzerinden BasicAck ile kuyruktaki mesajları bilinçli bir şekilde siliyoruz.</p><p>Uygulamamızı derleyip çalıştıralım.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/1*qzvZpoYhro169A_3QL7oww.png" /></figure><p>Gelen mesajları başarıyla okuduk.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1017/1*UONoqWTbx9ECN20tjF01Tg.png" /></figure><p>Mesajları başarıyla işleyip kuyruktan sildiğimiz için hazırda bekleyen bir mesajımız yok.</p><p>Linkedin: <a href="https://www.linkedin.com/in/serkancamkerten/">https://www.linkedin.com/in/serkancamkerten/</a></p><p>Github: <a href="https://github.com/roserkan">https://github.com/roserkan</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4293d0e1b461" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>