Posts

Installing Apache Kafka and Zookeeper on Windows

Image
In this article, I’ll talk about how to Install, configure and start Apache Zookeeper and Apache Kafka Server on Windows OS. Prerequisite JRE running on your machine and path must set to Environment Variable Any Zip tool like 7-zip , WinZip or WinRAR. Download and Extract Apache Zookeeper using 7-zip. Download and Extract Apache Kafka using 7-zip ZooKeeper Installation Instructions: Go to the conf directory of your Zookeeper. For me its under D:\Softwares\apache-zookeeper-3.5.5 Copy and rename zoo_sample.cfg to zoo.cfg file. Open and Edit dataDIr=/tmp/zookeeper to dataDir=D:\Softwares\apache-zookeeper-3.5.5 Add entries in System Environment Variables ZOOKEEPER_HOME=D:\Softwares\apache-zookeeper-3.5.5 Append D:\Softwares\apache-zookeeper-3.5.5\bin to PATH system variable. Open command prompt and type zkserver to start the Zookeeper application. You can easily edit the default port ( 2181) in zoo.cfg file. Congratulations, ZooKeeper is up and...

JAVA 11 – New String methods

JAVA 11 – New String methods In this blog, we will discuss about all six new methods which got introduced with JDK 11. isBlank(): returns true if string is empty otherwise false. White spaces code will also be considered as empty string. // Java 8 Predefine Functional Interface              // The best way to learn JAVA 8 is to implement it wherever you can...              BiConsumer<String, String> display = ( msg1 , msg2 ) -> System. out .println( msg1 + msg2 );              // local variable type inference              var msg = "Welcome to waheedtechblog page" ;              // String msg = "Welcome to waheedtechblog page"; both are same ...

Java 10 - Local Variable Type Inference

Java 10 - Local Variable Type Inference In one of my previous blog, I have already discussed about Type Inference. If you don’t have the idea about Type Inference then you can check my blog here . If we want to understand Type Inference in one line then we can say that It is the capability of the compiler to automatically detect the datatype of a variable at the compiler time. What is Local Variable type inference? Java 10 added new feature that allows the developer to skip the type declaration associated with local variables (those defined inside method definitions, initialization blocks, for-loops, and other blocks like if-else), and the type is inferred by the JDK. It will, then, be the job of the compiler to figure out the datatype of the variable. Until Java 9 , we had to define the type of the local variable. E.g.: String message = “Welcome to Waheedtechblog.com”; The above statement is right as that’s how things have been since the inception of java b...