daas workshop
  • Hands-On experience building a Data as a Service Platform
  • Set Up
    • Creating a Workstation
    • Installing Tools
    • Starting Kafka
    • Congratulations
  • Module I - Overview of the DaaS Pattern
    • Section I - The Overall Pattern
    • Section II - Data Sourcing
    • Section III - Data Provisioning
    • Section IV - Data Consumption
  • Module II - Building a Rust Project
    • Section I - Create a Package
    • Section II - Creating a Library
    • Section III - Creating an Executable
    • Section IV - Creating a Hello World RESTful Endpoint
      • Section IV - manifest
      • Section IV - library
      • Section IV - module
      • Section IV - integrated testing
      • Section IV - executable
  • Module III - Building a RESTful Endpoint for Sourcing Data
    • Section I - Overview
    • Section II - manifest
    • Section III - executable
    • Section IV - starting the service
    • Section V - service testing
  • Module IV - Building a Genesis Microservice for Processing the Sourced Data
    • Section I - Overview
    • Section II - manifest
    • Section III - executable
    • Section IV - starting the service
    • Section V - service testing
  • Module V - Building a Provisioning Microservice
    • Section I - Overview
    • Section II - manifest
    • Section III - executable
    • Section IV - starting the service
    • Section V - adding the business logic
    • Section VI - testing the service
  • Module VI - Building a RESTful Endpoint for Publishing Reporting Data
    • Section I - Overview
    • Section II - manifest
    • Section III - executable
    • Section IV - starting the service
    • Section V - adding the business logic
    • Section VI - testing the service
  • Privacy Design Strategies
  • Further Exploration
Powered by GitBook
On this page
  • Step 1 - Checking the services
  • Step 2 - Checking the data storage

Was this helpful?

  1. Module V - Building a Provisioning Microservice

Section VI - testing the service

If you are not seeing the correct results when calling the services, double check that you are running all the services from the same relative path, (e.g.: cargo run vs ./target/debug/...)

The WORKSPACE_LOCAL_STORAGE variable is relative (./workshop_storage) and therefore depends on where you are running the executable.

Step 1 - Checking the services

Let's first make sure all our services are running and restart our order clothing service.

In a new terminal, run the following command:

./rust-daas/target/debug/myapp_order_clothing

In another terminal, let's run the sourcing script.

./scripts/curl-sourcing.sh 

You should see all the services printing to the console about the data they have touched.

Sourcing RESTful service

[2020-11-09T13:24:06Z INFO  actix_web::middleware::logger] 127.0.0.1:33482 curl/7.61.1
[2020-11-09T13:24:06Z INFO  actix_web::middleware::logger] 127.0.0.1:33482 "POST /order/clothing/iStore/5000 HTTP/1.1" 200 15 "-" "curl/7.61.1" 0.002745

Genesis service

[2020-11-09T13:24:06Z INFO  daas::service::processor] Putting document order~clothing~iStore~5000 in S3
[2020-11-09T13:24:06Z INFO  daas::service::processor] Brokering document order~clothing~iStore~5000 ... 

Order Clothing service

ArchConfWorkshopUser:~/environment $ ./rust-daas/target/debug/myapp_order_clothing 
Clothing Orders processor is running ...
Press [Enter] to stop the Clothing Orders processor.
Order Number 5000 from the iStore has a status of "new"...
Retreiving leather_jacket file

Step 2 - Checking the data storage

There should now be a new directory int he environment directory named workshop_storage. Inside the workshop_storage directory should be a clothing-leather_jacket.json file. This is where the aggregated records is stored.

ls $HOME/environment/workshop_storage -l
ArchConfWorkshopUser:~/environment $ ls $HOME/environment/workshop_storage -l
total 4
-rw-rw-r-- 1 ec2-user ec2-user 12 Nov  9 13:24 clothing-leather_jacket.json

If we look at the clothing-leater_jacket.json the JSON document should look something like this:

{"orders":5}
PreviousSection V - adding the business logicNextModule VI - Building a RESTful Endpoint for Publishing Reporting Data

Last updated 3 years ago

Was this helpful?