Giter VIP home page Giter VIP logo

fake-availability-status-producer's Introduction

Pretends to be a fake availability status listener which plays nice with what the sources-api back end expects. It runs on the 10000 port by default.

Usage

Once built with go build, be sure to provide the following environment variables when running the binary:

  • PORT — If set, it runs on the specified port. Default value: 8000
  • QUEUE_HOST — If Clowder is enabled it's not needed. Example value: localhost
  • QUEUE_PORT — If Clowder is enabled it's not needed. Example value: 9092
  • SOURCES_API_HOST Example value: http://localhost
  • SOURCES_API_PORT Example value: SOURCES_API_PORT=10000

It has two endpoints:

  • /health which checks if the "sources-api" back end is reachable.
  • /availability-status which expects the {"source_id": "<id>"} payload to start the process.

It also listens on the platform.topological-inventory.operations-satellite Kafka topic, but again, it only cares for a payload with a "source_id" key. The rest of the keys are ignored.

Once an availability status update request has been received, the binary randomly picks one of the four valid availability statuses: "available", "in_progress", "partially_available" and "unavailable". If it chooses one of the latter two, it also includes an error message.

Finally, the status update message gets posted to the platform.sources.status Kafka topic, which is the one the sources-api back end is listening on.

fake-availability-status-producer's People

Contributors

mikelalejobr avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.