sber-sber / microservice-for-bob

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Microservice for Bob
******************************************
Uses ZeroMQ to communicate between server and client .py files.
Client file sends a stringified int as a request. 
Server file receives request and returns that number of random numbers as a stringified array.
******************************************
#TODO:
    -Add function challenges
    -Authenticate received message
******************************************
How to Install:
    Project is run locally.
    Dependencies:
    pyzmq (installed via "pip install pyzmq")
******************************************
How to Run:
    Run server.py
    Run client.py
        Use client.py to pass json object containing an array with the following three values: 
            - number of random numbers to return, 
            - value lower limit (optional, default=1),
            - upper limit (optional, default=100);
        Expects back b"{array of random numbers}" json object (which fits the requested parameters)
        Example of request:
            ...
            request_details = [num_vals, lower_limit, upper_limit + 1]
            request_data = json.dumps(request_details)
            socket.send_string(request_data)
        server.py loads json data and generates the number of random numbers (between the upper and 
        lower limits) requested, sending them as an array in a json object to client.py
        Example of returned string:
            Received reply [ [26, 44, 74, 49, 76, 37, 91, 84, 100, 47] ]
******************************************

# UML


![UML Sequence Diagram](./bob-microservice-uml.drawio)

About


Languages

Language:Python 100.0%