Introduction
The Local Binary Binaries Provider is a side project of the Binary Binaries Service. The main functionality of this service is to provide access to the content of a zip file via HTTP. In DDB there are cases where binaries associated to an ingest process are not provided on external servers but instead are delivered as zips together with the data to be ingested. To keep the workflow simple and to prevent handling special cases in the Binary Service, these zips can be uploaded to the Local Binary Provider and downloaded from there as if they were external resources.
Technology
The Local Binary Provider Binar iesProvider is implemented as a plain Java Servlet intendend to run on Tomcat 9 with Java 8.
Implementation Details
The application consist of to main classes. The UploadService class is an implementaion of HTTPServlet and handles the HTTP communication and saves the received archives to the filesystem. It delegates the work to the UploadService which starts a thread to unpack unpacks the data asynchronouslysynchronously.
Furthermore there is a Cleaner class which is a thread that runs in regular intervals and cleans unpacked archives older than a predefined number of days. This should prevent the system from running out of disk space.
The actual delivery of the unpacked archive contents is handled by Tomcat because the Local Binary Binaries Provider simply unpacks the archive in the Tomcats web-root directory.
API Documentation
METHOD | URL | Description |
---|
POST | / | Accepts a multipart/form-data request containing the archive file and its name. |
Deployments
There is a deployment in the development network automatically updated by Bamboo and one in the production network responsible for the production and qa-systems.
ToDos / Known issues
...
- Currently the Local Binary Service unpacks the archive asynchronously, so the upload request returns before the archive is unpacked. This can theoretically lead to the situation where the transformation begins, transmits a URL to the Binary Service which then tries to download a file the Local Binary Provider has not unpacked yet. This could be prevented with minimal impact on overall performance by directly unpacking the archive instead of saving it to disk to disk first.
...