Functional

Service Modularity in the Finagle Framework

5 minute read Published:

Using Modules to compose services.
Motivation Typical examples of dependency Injection DI show that the decoupling gained from removing glue code provides better testability, separation of concerns, and readability. Building applications by glueing resources together the manual way is OK, but not preferred when services need to be adapted in many ways. Dependency Injection (DI) can make your application more resilient to changes, and bring additional configurability to your project. Finagle, uses the Guice library as it’s foundation for building modules.

Server Flags with Twitter Finagle

3 minute read Published:

Program Switches (Flags) in Finagle Applications with Scala
This Example In this example, we setup and run an HTTP Service with Scala and SBT. We’ll cover the configuration of our services with the FinagleFlags API. If this is your first time seeing Finagle, then I would suggest you take a look at the Finagle intro document which describes how to code and run a simple HTTP service. Build with SBT This example, and others like it will rely on a quick and simple build tool.

Getting started with Filters in Finagle

4 minute read Published:

Finagle lets you develop and deploy services easily.
What is Finagle In this example, we will go through the steps to deploy a Filtered HTTP Service with Scala and SBT. Finagle is an extensible RPC system for the JVM, that lets developers write non-blocking, high-concurrency services with ease. Much of what Finagle will let us do is summarized in the doc. Finagle implements uniform client and server APIs for several protocols, and is designed for high performance and concurrency.

Intro to Finagle services with Scala and SBT.

4 minute read Published:

Finagle lets you develop and deploy services easily.
What is Finagle Finagle is an extensible RPC system for the JVM, that lets developers write non-blocking, high-concurrency services with ease. Much of what Finagle will let us do is explained in the doc. Finagle implements uniform client and server APIs for several protocols, and is designed for high performance and concurrency. Most of Finagle’s code is protocol agnostic, simplifying the implementation of new protocols. In this example, we will go through the steps to deploy a basic Finagle HTTP Service with Scala and SBT.

Setup and Customize a Login Page With Reactive Spring Security.

7 minute read Published:

Spring Security provides a intuitive and concise API for managing Authentication aspects within your app.
Customized WebFlux Form Authentication This demonstration examines Spring Security WebFlux’s Authentication mechanisms. We will look at authentication with HTML forms using Mustache, User Authentication, and customized form-based login / logout configurations. The ServerHttpSecurity Configuration SecurityWebFilterChain is the governing chain of [WebFilter]’s that allows us to lock down reactive WebFlux applications. With @EnableWebFluxSecurity turned on, we can build this object by issuing commands to the ServerHttpSecurity DSL object. SecurityConfiguration.java: @EnableWebFluxSecurity @Slf4j @Configuration public class SecurityConfiguration { @Bean public SecurityWebFilterChain securityWebFilterChain(ServerHttpSecurity http) { return http .

Setup and customize Authentication against a WebFlux Application

4 minute read Published:

Spring Security provides a intuitive and concise API for managing Authentication aspects within your app.
Configuring Authentication against a WebFlux app This demonstration examines Spring Security WebFlux’s Authentication mechanisms. We will look at Authentication request escalation, as well as user-domain customizations. Authentication flow-control How do we determine when a request must provide an authentication context? Spring does this with help from an AuthenticationEntryPoint that identifies un-authenticated requests and returns with a response to the user to perform some authentication action. Configure ServerHttpSecurity to use HTTP-BASIC by calling it’s httpBasic() method.

Reactive Websocket Client with Spring

3 minute read Published:

Demonstrating the Spring WebSocket Client
This Demo This demo client will connect and receive events from any URL that emits an open websocket stream. We have an existing server to stand up that can supply the socket events. A reactive client means that we can respond to backpressure, and weild the Observer pattern to our client connections. The Client (SANS web) We can use our favorite Spring Application Initializr start dot spring dot io to generate the application.

Sending and consuming messages with Spring and KafKa

5 minute read Published:

This demonstration explains how to craft classical (not reactive) consumer/producer componentS within you Spring apps
Spring Kafka Writer and Readers What is Kafka Apache Kafka is an open-source stream-processing software platform developed by the Apache Software Foundation written in Scala and Java. You’ll find more information about Kafka at it’s Homepage. Intro to Spring For Apache Kafka The Spring for Apache Kafka (spring-kafka) project applies core Spring concepts to the development of Kafka-based messaging solutions. It provides a “template” as a high-level abstraction for sending messages.

Intro to RIFF Is For Functions

5 minute read Published:

RiFF allows you to create ephermeral services that respond to demand!
Motivation of Functions Functions as a Service are a new paradigm for application composition and deployment. Functions are a smaller deployable unit than microservices and especially traditional monoliths. Project Riff is a new Pivotal project that runs functions in a cloud environment like Pivotal Container Services (Kubernetes). Lets get started by setting up a new Riff environment and then creating some functions. Preparing the environment minikube is the tool that we’ll use to run Kubernetes locally.