ssl-hep / ServiceX_App

REST Front End to ServiceX
BSD 3-Clause "New" or "Revised" License
3 stars 10 forks source link

Factory should not block until RabbitMQ is available #89

Closed AndrewEckart closed 3 years ago

AndrewEckart commented 3 years ago

Story

As a ServiceX developer I want to run the server without a RabbitMQ connection so I can test it locally.

Currently, the create_app factory calls the _init_rabbit_mq function, which blocks until a connection is made to RabbitMQ. This precludes using the server's other features, such as the web frontend and API requests which do not depend on RabbitMQ.

Acceptance Criteria

  1. It's possible to visiting webpages and make API requests to endpoints which do not require RabbitMQ before a connection is made.
  2. Endpoints which do require a RabbitMQ connection, such as submitting a transformation request, should return HTTP 503 - Service Unavailable if there is no connection.
  3. The server can be run locally using flask run with or without RabbitMQ.

Assumptions

  1. The SubmitTransformationRequest resource is the only one which requires a RabbitMQ connection.