The Companies House Streaming Platform Cache consumes offsets from the Streaming Platform Backend service and caches the entries in Redis, and pushes these to connected users as an event stream.
Requirements
The following services and applications are required to build and/or run chs-streaming-api-cache:
AWS ECR
Docker
Redis
Companies House Streaming Platform Backend (chs-streaming-api-backend)
You will need an HTTP client that supports server-sent events (e.g. cURL) to connect to the service and receive published offsets.
Building and Running Locally
Login to AWS ECR.
Build the project by running docker build from the project directory.
Run the Docker image that has been built by running docker run IMAGE_ID from the command line, ensuring values have been specified for the environment variables (see Configuration) and that port 6001 is exposed.
Send a GET request using your HTTP client to /filings. A connection should be established and any offsets published to the stream-filing-history topic should appear in the response body. The offsets should also be cached in Redis for other consumers.