<?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 Mites Mrinoy on Medium]]></title>
        <description><![CDATA[Stories by Mites Mrinoy on Medium]]></description>
        <link>https://medium.com/@miteshmrinoy?source=rss-8f66d73ba468------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*g5MNUQ4lu8ws18enokXbIQ.jpeg</url>
            <title>Stories by Mites Mrinoy on Medium</title>
            <link>https://medium.com/@miteshmrinoy?source=rss-8f66d73ba468------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 12:42:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@miteshmrinoy/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[Reactive Programming Using Vert.x]]></title>
            <link>https://medium.com/@miteshmrinoy/reactive-programming-using-vert-x-f18681015318?source=rss-8f66d73ba468------2</link>
            <guid isPermaLink="false">https://medium.com/p/f18681015318</guid>
            <dc:creator><![CDATA[Mites Mrinoy]]></dc:creator>
            <pubDate>Sun, 09 Aug 2020 04:42:36 GMT</pubDate>
            <atom:updated>2020-08-09T04:43:24.551Z</atom:updated>
            <content:encoded><![CDATA[<p>Reactive programming has become a trend in the present. In a pure theoretical point of view, reactive programming is a programming paradigm that responds to any changes or events and is commonly associated with asynchronous programming. So what exactly is reactive programming in practical terms??. Basically, when we say Reactive programming, it deals with data streams(commonly called as Observables). Events, messages, calls, and even failures are going to be conveyed by a data stream. With reactive programming, we observe these streams and react when a value is emitted. In our code, we are going to create data streams of anything for example,click events, HTTP requests, ingested messages, availability notifications, changes on a variable, cache events, measures from a sensor, literally anything that may change or happen. This causes the application to be inherently asynchronous. The picture below shows how reactive programming works.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*O1zTi7clYgdBkHTdX0RfTQ.png" /><figcaption>A typical reactive stream</figcaption></figure><p>As seen in the above picture, two data streams asynchronously perform their operations, resulting in faster response time.</p><p><strong>REACTIVE PROGRAMMING USING Vert.x</strong></p><p>Vert.x is an open source, reactive software development toolkit(read SDK) that provides the capabilities of polyglot programming. Polyglot programming is basically a capability to support various languages simultaneously. Vert.x supports a large variety of JVM and Non JVM languages like Java,Groovy,Ruby,Python.</p><p>In this article, I will be discussing a sample vert.x application using Java</p><p>For this, the following dependencies are required</p><pre><strong>&lt;! — </strong><a href="https://mvnrepository.com/artifact/io.vertx/vertx-core"><strong>https://mvnrepository.com/artifact/io.vertx/vertx-core</strong></a><strong> →<br>&lt;dependency&gt;<br> &lt;groupId&gt;io.vertx&lt;/groupId&gt;<br> &lt;artifactId&gt;vertx-core&lt;/artifactId&gt;<br> &lt;version&gt;4.0.0-milestone5&lt;/version&gt;<br>&lt;/dependency&gt;</strong></pre><p><strong>PARTS OF A VERT.X APPLICATION</strong></p><p><strong>VERTICLES</strong></p><p>Verticles are basically the pieces of code that is to be executed by the vert.x engine. The vert.x SDK has lots of abstract verticle classes that can be used as and when needed. Verticles can be written in any of the supported languages. An application is usually composed of multiple verticles running in the same Vert.x instance and communicate with each other using events via the event bus.</p><p>For verticles in Java, the class must implement <em>io.vertx.core.Verticle </em>interface.</p><p><strong>EVENT BUS</strong></p><p>Verticles communicate with each other through the event bus. The message can be anything from a string to a complex object.</p><p>Message handling is ideally asynchronous, messages are queued to the event bus, and control is returned to the sender. Later it’s dequeued to the listening verticle. The response is sent using <em>Future </em>and <em>callback </em>methods.</p><p><strong>A SIMPLE VERT.X APPLICATION</strong></p><p>To create our verticle, we need to extend the <em>io.vertx.core.AbstractVerticle </em>class and override the <em>start() </em>method:</p><p>Here is my sample code:</p><pre>public class SampleVerticle extends AbstractVerticle{</pre><pre>@Override<br>public void start()<br>{<br>System.out.println(&quot;This starts my first vert.x application&quot;);<br>}</pre><p>In some earlier implementations, it might have been mandatory to pass the Future object inside the overridden start() method. But now, it isn’t necessary.</p><p>The deploy the verticle, we follow the steps.</p><pre>public class DemoApplication {</pre><pre>public static void main(String[] args) throws Exception {</pre><pre>Vertx vertx = Vertx.vertx();</pre><pre>vertx.deployVerticle(new SampleVerticle());</pre><pre>}</pre><p>And when the code is run, we get the following output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Az2gkRyy5Ot003k3h3Okmw.png" /><figcaption>The message can be seen here.</figcaption></figure><p>And that’s it. We just ran our first asynchronous vert.x application. Although, there are many other concepts using vert.x like creating a HTTP server, writing unit tests, creating RESTful web service and also setting up routers, this article just deals with a basic vert.x application and certain theoretical aspects related to it.This can be found in the following link <a href="https://vertx.io/docs/"><em>https://vertx.io/docs/</em></a></p><p>In the upcoming articles, I will discuss certain aspects of vert.x in more detail. Until then, Happy Learning!!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f18681015318" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Install Apache Kafka the Right Way in a Windows Environment]]></title>
            <link>https://medium.com/@miteshmrinoy/how-to-install-apache-kafka-the-right-way-in-a-windows-environment-f8ab41a0b672?source=rss-8f66d73ba468------2</link>
            <guid isPermaLink="false">https://medium.com/p/f8ab41a0b672</guid>
            <category><![CDATA[kafka]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[data-pipeline]]></category>
            <dc:creator><![CDATA[Mites Mrinoy]]></dc:creator>
            <pubDate>Sun, 05 Jul 2020 08:52:17 GMT</pubDate>
            <atom:updated>2020-07-05T08:52:17.626Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/505/1*Y23GJ2mvFLE__qa5zAjrfA.png" /></figure><p>Apache Kafka is an open source stream processing software platform developed by the Apache Foundation, written in Scala and Java. It performs an essential part in asynchronous communication among microservices and providing a high throughput and low latency data feeds. The usage and growth of Kafka is fast increasing with the likes of Uber ,Netflix and Microsoft using it to process billions of messages in a day</p><p>The installation and running of Kafka is tricky process and there are many articles that guide us through the whole process. But, unfortunately many of these instructions dont work. Hence the aim of this post is to guide through the whole process of setting up of the zookeeper server and Kafka in a Windows environment.</p><h3><strong>Install WINZIP</strong></h3><p>The first step is to install an extractor like WINZIP or 7ZIP. The link for this is given below</p><p><a href="https://www.winzip.com/landing/download-winzip-v1.html?gclid=Cj0KCQjw9IX4BRCcARIsAOD2OB3Dp8ZMjyuyemHSvlm5TYsnBl9B_amR44rnceOXQ86VWk53cxJG4DMaAmMYEALw_wcB">Download WinZip</a></p><h3><strong>Install JDK and JRE and set the PATH</strong></h3><p>The JDK and JRE needs to be downloaded. They can be downloaded from the official Oracle site. If you have the account, then its just a single click. If not then you might need an Oracle account which can be easily setup. The link or downloading JDK is given below.</p><p><a href="https://www.oracle.com/in/java/technologies/javase-downloads.html">Java SE Downloads</a></p><p>The JRE comes with JDK but if it is missing, you need to explicitly download it from the Oracle site. I downloaded it from the below link</p><p><a href="https://www.oracle.com/java/technologies/javase-jre8-downloads.html">Java SE Runtime Environment 8 - Downloads</a></p><p>Now for the purpose of clarity, I have kept both my JDK and JRE in same folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/1*5e9usWNHj4WRSZ_aEILaeQ.png" /><figcaption>The JDK and JRE paths have been shown in the above pic</figcaption></figure><p>The path for my JDK is C:\jdk-14.0.1 and for JRE is C:\jdk-14.0.1\jre. Now we need to set the Path and System variables.</p><p>Start typing ‘Environment’ in your Windows search bar. It’ll come up with an option to Edit the Systems variable in the Control Panel. Click that and you’ll be in System Properties. Click on the button that says Environment Variables… on the lower right.</p><p>Under User variables which is the top box, click on New and add JAVA_HOME and JRE_HOME. For the value for JAVA_HOME, click on the Browse Directories button and navigate to where you installed JDK. For me that is C:\jdk-14.0.1\</p><p>For the value of your JRE_HOME, click on the Browse Directories button and navigate to where you installed JRE. For me, that is C:\jdk-14.0.1\jre\</p><p>Then add the System variable by selecting<strong> Path</strong> and adding %JAVA_HOME%\bin;%JRE_HOME%\bin . Then or verifying if it is installed correctly, enter java -version. It should display something like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/558/1*nef-AOqLdtDnxvByVxPGvQ.png" /><figcaption>Java version message</figcaption></figure><h3><strong>Install Zookeeper</strong></h3><p>The Zookeeper server needs to be downloaded for making kafka work.The important point to note is that it needs to be in binary format. The link for downloading it is given below from the official Apache site.</p><p><a href="https://downloads.apache.org/zookeeper/zookeeper-3.6.1/apache-zookeeper-3.6.1-bin.tar.gz"><strong>https://downloads.apache.org/zookeeper/zookeeper-3.6.1/apache-zookeeper-3.6.1-bin.tar.gz</strong></a></p><p>The file will be downloaded in Compressed format which needs to be extracted in a proper place. For me, it is C:\apache-zookeeper-3.6.1-bin and looks like the image given below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*h_dLTFyeZt-hyVircuO9IQ.png" /><figcaption>The path for installing Zookeeper</figcaption></figure><p>Then the Zookeeper needs to be configured. For this we need to go to the conf folder. For me that is C:\apache-zookeeper-3.6.1-bin\conf and then rename the zoo_sample.cfg file to zoo.cfg. Then open it with an editor preferrably Notepad++ and In this file, you’ll see an entry called the dataDir with a value of /tmp. Change the dataDir to dataDir=../logs. This can be any absolute path.</p><p><strong>ZOOKEEPER PATHS</strong></p><p>The Zookeeper paths needs to be set just like JDK and JRE path.</p><p>Under User variables which is the top box, click on New and add ZOOKEEPER_HOME. For the value, click on the Browse Directories button and navigate to where you installed Zookeeper. For me, that is</p><p><strong>C:\apache-zookeeper-3.6.1-bin</strong></p><p>In the System variable box, double click on the Path and add the following at the end</p><p><strong>%ZOOKEEPER_HOME%\bin</strong></p><p>Then we can check if the installation is correct by starting the Zookeeper server using the command <strong>zkserver</strong></p><p>Open a command prompt in your zookeeper bin directory and type <strong>zkserver</strong></p><p>It should look like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/1*tvCG6PIL9OD1iT8CZjGdFw.png" /></figure><p><strong>Note that the cmd has to be started inside the bin folder in the zookeeper folder.</strong></p><h3><strong>KAFKA — — HOW TO INSTALL IT</strong></h3><p>Kafka is a message broker. It lets you create topics that you can think of are like chat rooms. You post a message on that topic and people who are subscribed to the topic will receive the message. The recipients are called Consumers. The message posters are called Producers.</p><p>Kafka can be installed in the following steps.</p><p>Download from the following official link</p><p><a href="https://www.apache.org/dyn/closer.cgi?path=/kafka/2.5.0/kafka_2.12-2.5.0.tgz">Apache Download Mirrors</a></p><p>Extract the file in a particular path. For me that is C:\kafka_2.12–2.5.0 and looks like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*Vqe3-yw2k17W6FkjTKpAuA.png" /><figcaption>kafka folder</figcaption></figure><p>Then go to the config directory and find the server.properties file. We need to find logs.dirs. For me that is <strong>log.dirs=C:\kafka_2.12–2.5.0\logs.</strong></p><p>We can also set multiple brokers but for that, the broker.id needs to be different. Apache Kafka will run on port <strong>9092</strong> and Apache Zookeeper will run on port <strong>2181.</strong></p><h3><strong>Running Kafka</strong></h3><p>First the Zookeeper needs to be started by using the zkserver command as discussed earlier in the post.</p><p>Create new terminal window from <strong>C:\kafka_2.12–2.5.0\bin\windows </strong>and execute the following command</p><h4>kafka-server-start.bat C:\kafka_2.12–2.5.0\config\server.properties</h4><p>This starts up the kafka server and will look like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/611/1*n8Z_HxP_IYBP2WlTLjT9JA.png" /></figure><p><strong>Pretty AWESOME isnt it??</strong></p><p>Now we need to create topics from which we need to listen. This can be done by the command inside the <strong>C:\kafka_2.12–2.5.0</strong> path. The topic for me is <strong>test2</strong></p><p><strong>bin\windows\kafka-topics.bat — create — bootstrap-server localhost:9092 — replication-factor 1 — partitions 1 — topic test2</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*xDNKISsycJPmv7wW3i0Y-w.png" /><figcaption>Topic creation</figcaption></figure><p>The list of topics can be shown by</p><p><strong>bin\windows\kafka-topics.bat — list — bootstrap-server localhost:9092</strong></p><p>Then we need to start the producer which will listen to a particular topic and sends messages to consumer. The following command works for me</p><p><strong>bin\windows\kafka-console-producer.bat — bootstrap-server localhost:9092 — topic test2</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/1*4EGabHYCC_zugf6_lTMPtA.png" /></figure><p>The above image describes a message which I send through the producer.</p><p>Then we need to consume the message through the consumer and check if the same message is received there. This can be done by</p><p><strong>bin\windows\kafka-console-consumer.bat — bootstrap-server localhost:9092 — topic test2 — from-beginning</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/1*5JjBzn5gCgLmXr0mWt1WcQ.png" /></figure><p>The exact message sent from the consumer is received here.</p><p><strong>WELCOME TO THE MAGIC OF TECHNOLOGY!!!!!</strong></p><h3>CONCLUSION</h3><p>A point to note here is that the zookeeper produces log files that may occupy lots of memory and needs to be routinely cleaned and also the zookeeper and kafka need to be started in a sequence i.e Zookeeper first and then Kafka otherwise it may crash the system. I hope the above article helps in installing this amazing software. Do comment if you face any issues. Until then,</p><p><strong>HAPPY LEARNING!!!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f8ab41a0b672" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Microservices-common myths and realities]]></title>
            <link>https://medium.com/@miteshmrinoy/microservices-common-myths-and-realities-69c690526888?source=rss-8f66d73ba468------2</link>
            <guid isPermaLink="false">https://medium.com/p/69c690526888</guid>
            <dc:creator><![CDATA[Mites Mrinoy]]></dc:creator>
            <pubDate>Sat, 13 Jun 2020 15:16:31 GMT</pubDate>
            <atom:updated>2020-06-13T15:16:31.730Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/1*35jBxh4OA46puqxPk9YNaw.png" /><figcaption><strong>Microservices Vs Monoliths</strong></figcaption></figure><p>Microservices have been the buzzword from the past many years. In purely layman term, it can be defined as a software architecture pattern that allows us to design a software application as a set of independently deployable services. It is independently scalable and makes it easier to debug. It also provides us with a very less downtime as compared to a traditional monolith.</p><p>Loose coupling is one of the key idea behind the design and development of microservices . Tech giants like Netflix, Uber, Amazon,Spotify have been using hundreds or probably thousands of microservices. The popularity and acceptance is on the rise and hence the emergence of a lot of myths and confusions. Personally, I have been working as a microservices developer from the past year and there are some myths that I have personally heard</p><p><strong>#MYTH-1 Microservices are equal to MVC</strong></p><p>This is one of the most common myths that is associated with microservices. While MVC is an architectural pattern to break an application to Model(Data),View(Display),Controller(display logic), it is not the same as microservices. Microservices are basically a set of independent applications that are not predefined like the MVC and interact with each other using API calls and through streaming pipelines like kafka. The development team has the full independence to segregrate the applications based on the business logic. But in case of MVC, it is restricted to three parts only.</p><p><strong>#MYTH-2 Microservices are apps built using certain tools</strong></p><p>The common misunderstanding associated with microservices is that it is built on certain tools like</p><ol><li>SpringBoot,Docker and K8s</li><li>ExpressJS,Docker,K8s</li></ol><p>While microservices are certainly built using the above tools, but it is not always necessary that all applications built using these tech stack are microservices. For applications to be classified into microservices, it needs to follow certain principles commonly called as the 12 Factor App which is a topic of discussion some other day.</p><p><strong>#MYTH-3 Microservices are cheaper to build and maintain</strong></p><p>High degree of scalability, loose coupling,leser downtime and easier debugging may make us think that microservices are cheaper but it might not be necessarily true. Since microservices use many independent applications, it may require separate containers and instances which may ultimately cause a high cost to be attached for maintaining the cloud infrastructure.</p><p><strong>#MYTH-4 Microservices are equivalent to SOA(Service Oriented Architecture)</strong></p><p>While modularity as a concept has been introduced in SOA, microservices have a much more wider concept than that. In SOA, the reusable services primarily use synchronous calls using REST apis which may cause dependencies and reduce the resiliency in applications. But in case of microservices, services can interact through asynchronous calls such as event sourcing and publish/subscribe model. This may reduce dependencies and increase resiliency in applications.</p><p><strong>CONCLUSION</strong></p><p>So, the above described myths are some common misconceptions that are associated with microservices. There are many other misconceptions that are associated with microservices but the primary four have been addressed above. I will be covering 12 factor app in microservices architecture in my next article</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=69c690526888" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>