Author: Rishi Khandelwal

One-way & two-way streaming in a Lagom application

Now a days streaming word is a buzz word and you should have heard many types of streaming till now i.e. kafka streaming, spark streaming etc etc. But in this blog we will see a new type of streaming i.e Lagom-streaming. Lagom-streaming internally uses Akka streams, with the help of which we will see one way & two way streaming. But before going forward, it Continue Reading

A Java Lagom service which only consumes from Kafka topic (Subscriber only service)

Subscriber only service means an application which only consumes, does not produce. We have generally seen the applications which both produces and consumes data from a Kafka topic but sometimes we need to write an application which only consumes data i.e. consumes data from a 3rd party service. So in this blog I am going to explain how to write a Lagom service which only Continue Reading

What to do for overriding the PureConfig behavior in Scala ?

PureConfig has its own predefined behavior for reading and writing to the configuration files, but sometimes we got the tricky requirement in which we need some specific behavior; for example to read the config. It is possible to override the behavior of PureConfig for a certain type by implementing another instance of ConfigReader, ConfigWriter or ConfigConvert. So in this blog we will discuss all 3 Continue Reading

Deep dive into PureConfig types in Scala

Folks, I am back with some more exploration on PureConfig. This time we will talk about the types. For types, we have following two things to discuss: New supported types Override behaviour for types   In this blog, we will discuss only the first one i.e. New supported types New supported types: PureConfig does not support all kind of types. For ex, classes that are Continue Reading

A better way to load configuration of certain types with PureConfig in Scala

In this blog we will discuss about the better way of loading the configuration of certain types. Now a days we use typesafe config for the same purpose. PureConfig also uses typesafe config internally but also provides the better way of doing this. PureConfig is not a configuration library, it can be seen as a better front-end for the existing libraries. It uses the Typesafe Continue Reading

Apache Spark : Handle null timestamp while reading csv in Spark 2.0.0

Hello folks, Hope you all are doing good !!! In this blog, I will discuss a problem which I faced some days back. One thing to keep in mind that this problem is specifically related to Spark version 2.0.0. Other than this version, this problem does not occur. Problem : Spark code was reading CSV file. This particular CSV file had one timestamp column that might Continue Reading

Apache Spark : Spark Union adds up the partition of input RDDs

Some days back when I was doing union of 2 pair rdds, I found the strange behavior for the number of partitions. The output RDD got different number of partition than input Rdd. For ex: suppose rdd1 and rdd2, each have 2 no of partitions and after union of these rdds I was expecting same no of partitions for output RDD, but the output RDD got the Continue Reading

Compile & load an external scala file in your application

Some days ago, i got a requirement that i need to load an external scala file in my Scala application and have to use that. To use that file, it needs to be compile first and then can be used in the application. The location of that external file can be anything apart from your project. The structure of external file is fixed and should Continue Reading

A basic application to handle multipart form data using akka-http with test cases in Scala

In my previous blogs, I have talked about file upload and its test cases using akka-http. Now, in this blog I am going to explain the handling of multi part form data in akka-http with the help of a basic application which contains the code and its test cases. So Let’s start with the dependencies for the application. You have to add the following dependencies Continue Reading

Test cases for file upload using akka-http in Scala

Hello folks, In my previous blog, i explained how to upload a file using akka-http in Scala. Later, i got the queries about the test cases for the same. Therefore, in this blog I am going to explain the way of writing test cases for file upload. First we need to add test dependency : “com.typesafe.akka” %% “akka-http-testkit” % “2.4.3”, “org.scalatest” %% “scalatest” % “2.2.6” % Continue Reading

How to create auto incremented alphanumeric id in postgres

A few days ago, i got a condition where i need to create an alphanumeric auto incremented id in Postgres. I have created many auto incremented numeric ids before, but never got a use case like this. This was new for me.  Therefore, here i am going to share the solution for the same which can be useful for you as well. First , we will Continue Reading

File upload using akka-http in Scala

Lets begin with some introduction of Akka-http first. Akka HTTP is a layer to expose Actors to the web via HTTP and to enable them to consume HTTP services as a client. It is not an HTTP framework, it is an Actor-based toolkit for interacting with web services and clients. This toolkit is structured into several layers: akka-http-core: A complete implementation of the HTTP standard, both Continue Reading

Scala in Business | Knoldus Newsletter – April 2015

Hello Folks We are back again with April 2015, Newsletter. Here is this Scala in Business | Knoldus Newsletter – April 2015 In this newsletter, you will get the business related news for Scala. How organisation are adopting Scala for their business, how Scala related technologies increasing the performance of application and how Scala is getting popular in the industry So, if you haven’t subscribed to Continue Reading

%d bloggers like this: