- A Web Application of Apache Spark using Spring Boot MVC
- Spring is a very popular Java-based framework for building web and enterprise applications.
- Spring framework provides flexibility to configure beans/objects in multiple ways such as XML, Annotations, and JavaConfig.
- Spring’s dependency injection approach encourages writing testable code
- Spring Boot is basically an extension of the Spring framework which eliminated the boilerplate configurations required for setting up a Spring application.
- Apache Spark is an open-source distributed general-purpose cluster-computing framework.
- Create a Maven-Based Spring Boot Project
- Add the required dependencies in pom.xml
- Configure Spark Properties in application.properties
- Adding the Spark ApplicationConfig: declaring the JavaSparkContext and SparkConf as beans (using @Bean annotation) this tell the spring container to manage them for us
- Creating a service/controller for Read Csv & Register a REST Controller with an endpoint
- Run the application using
mvn spring-boot:run -Dspring-boot.run.jvmArguments="--add-exports java.base/sun.nio.ch=ALL-UNNAMED"
- Test your application from a REST client or on Browser Url: http://localhost:8080/spark-context/read-csv