Author: munandersingh

Basics of Apache camel

Reading Time: 3 minutes Apache Camel is a solution for migrating content from one endpoint/platform to another. As it applies to an AEM migration, a Camel implementation may be vital to saving time and resources, particularly in cases where the amount of content to migrate is enormous, where it would be prohibitively tedious for authors to attempt recreating pages by hand in AEM’s Site Author mode. Camel uses abstraction Continue Reading

A sneak peek into Java8 Stream Transformation and Terminal Operations

Reading Time: 3 minutes Stream API was introduced in Java 8. It is used to process the collections of objects. With the help of Streams and Lambda functions, we can write clean, concise and understandable code. Streams is pipeline of operations, which we can use to evaluate the data. Streams have intermediate and terminal operations which we can use as per our requirement. Here’s a list of Operations: Intermediate Operations: peek, Continue Reading

Security & SSL Setup in Confluent Kafka

Reading Time: 2 minutes What is SSL ? Secure Socket Layer (SSL) is a security protocol for the transport layer. In SSL Protocol data is divided into fragments. The fragments are compressed and encrypted Message Authentication Code (MAC) generated by algorithms like Secure Hash Protocol(SHA) and MD5(Message Digest) is appended. SSL is the predecessor of Transport Layer Security(TLS) . After encryption of data, finally, the SSL header is appended Continue Reading

Customized logging using MDC

Reading Time: 3 minutes Introduction Mapped Diagnostic Context or MDC manages contextual information on a per-thread basis. So we can benefit from MDC when logging in a multi-threaded application. For example, we can store the IP address of each request in a web application and insert this data into each log statement. In our case, we’ll introduce a unique correlation id for each request. Web servers generally have a Continue Reading

Indexes in MongoDB

Reading Time: 4 minutes In any database, indexes in MongoDB support the efficient execution of queries. Without them, the database must scan every document in a collection or table to select those that match the query statement. If an appropriate index exists for a query, the database can use the index to limit the number of documents it must inspect. Keypoints for Indexing As you create indexes, consider the Continue Reading

How to Analyze query performance in MongoDB

Reading Time: 2 minutes Analyze query performance in mongodb may became complicated if we do not really know which part should be measured. Fortunately, MongoDB provides very handy tool which can be used to evaluate query performance: explain(“executionStats”). This tool provide us some general measurements such as number of examined document and execution time that can be used to do statistical analysis. The Database and Collection In this easy tutorial, Continue Reading

Akka HTTP Route Testing

Reading Time: 2 minutes Akka HTTP puts a lot of focus on testability of code. It has a dedicated module akka-http-testkit for testing rest api’s. When you use this testkit you are not need to run external web server or application server to test your rest API’s. It will do all needed the stubbing and mocking for you which greatly simplifies the testing process. Adding dependency You need to add akka-http-testkit Continue Reading

Akka-gRPC

Reading Time: 3 minutes Akka gRPC provides support for building streaming gRPC servers and clients on top of Akka Streams and Akka Http. Features of Akka-gRPC A generator, that starts from a protobuf service definitions, for: Model classes The service API as a Scala trait using Akka Stream Sources On the server side code to create an Akka HTTP route based on your implementation of the service On the client side, a client for the Continue Reading

Testing for Rejection handling in Akka HTTP Routes

Reading Time: 2 minutes We will learn how we able to testing for rejection handling in Akka-Http.We will be using Akka TestKit and Akka-Http TestKit.Dependencies are as follows: Suppose we have a rejection builder and a route A regular test case for this route would look like But what if we want to test when the parameters are missing? That test case will be Because we are passing no Continue Reading

Server Streaming via gRPC

Reading Time: 2 minutes In this blog, we will see how we can do Server Streaming via gRPC. In Server Streaming, the client sends only a single request and got multiple responses. Server Streaming via gRPC Server streaming RPCs where the client sends a request to the server and gets a stream to read a sequence of messages back. The client reads from the returned stream until there are Continue Reading

Exception Handling in Spring Boot

Reading Time: 4 minutes Exception Handling in Spring boot correctly in APIs while providing meaningful error messages is a very desirable feature, as it can help the API client properly respond to issues. The default behavior tends to be returning stack traces that are hard to understand and ultimately useless for the API client. Partitioning the error information into fields also enables the API client to parse it and Continue Reading

Unary Streaming via gRPC

Reading Time: 3 minutes If you want to get multiple responses and send multiple requests, it is the time to use gRPC Streaming concepts. You cant do streaming with REST API as REST API uses HTTP 1.1. In this blog, I will go through how you can do Unary Streaming via gRPC. Types of APIs or Streaming in gRPC gRPC supports four types of APIs to support streaming. 1. Continue Reading

Still not switch to HTTP/2?

Reading Time: 4 minutes Hi folks! Your website doesn’t reload fast and takes more time to get response . Then this is perfect time to move to HTTP/2. The relatively new HTTP/2 protocol speeds up page load significantly and is widely supported by all major browsers and servers. You should be using it right now. What is HTTP? HTTP is based on the Client/Server model. Client/Server model can be explained Continue Reading