Since the SDKs contain all the modules we will need for our web service, we can go right to writing our executable: src/bin/sourcing.rs.
We start by declaring our dependent external crates
extern crate daas;
extern crate actix_web;
We then declare the modules we will be using.
use daas::service::listener::{DaaSListener, DaaSListenerService};
use daas::service::extractor::{Base64Author};
use pbd::dua::middleware::actix::*;
use pbd::dtc::middleware::actix::*;
use actix_web::{web, App, HttpServer};
use actix_web::middleware::Logger;
Finally, we write the main function that will be called.
Since the DaaS Listener that consumes the source data is loosely coupled to the broker, it is important that we keep a local copy of the DaaSDocument in case connection to the broker is lost. We configure the directory path the local storage using the environment variable DAAS_LOCAL_STORAGE. If this is not set, the DaaSListener module will use the system's default temporary directory.