Today we will discuss about Solr, Scala with Akka-HTTP. We will create rest-endpoints and try to connect with Solr server with them.
The basic idea behind using Akka-HTTP for creating Rest end points is modules implement a full server and client-side HTTP stack on top of akka-actor and akka-stream. We can customize these routes according to our use case.
We will talk step by step to develop this Rest API after which you will able to run this API on your server and start hitting Rest end points.
Now we start coding :
We will start our implementation with the pom.xml file. We will keep all require dependencies in this file.
This is the part where we interact with the Solr. This code shows how we can can insert or update data and query for searching data from the Solr system.
This is the part where we develop routes to provide rest end points to the client so that they can interact with server and perform the operation which are mention in Factories using REST end points.
This is the part where we define our configuration like http’s interface , port and Solr’s url, collectionName. We define this file in resources folder.
This is the basic idea for developing a Rest end points with Akka-http. If you want to see code, you can find here and if you want to use template you can find here or you all can just follow the README.md file and you will ready to hit the server.
This is the basic implementation of how to perform basic operation on Solr using the Akka-HTTP.