Media Service
Service Type: Deployable backend service Language: Kotlin / Micronaut Database: No persistent database Messaging: Apache Kafka External Integrations: S3-compatible object storage, Kafka Status: Implemented; currently focused on image thumbnail processing
Summary & Purpose
whitelabel/media-service is an asynchronous media-processing service. Its currently implemented capability is image thumbnail generation: it consumes resize requests from Kafka, downloads source images from S3-compatible storage, generates thumbnails, uploads the results, and publishes processing outcomes.
Business Responsibilities
- Process image resize requests.
- Download source images from object storage.
- Generate fixed-size 100×100 pixel thumbnails.
- Upload generated thumbnails.
- Notify requesting services about processing results.
- Report download, resize, and upload failures.
Owned Data
The service does not own persistent business data.
It temporarily processes image content and stores generated thumbnails in S3-compatible object storage. The service owns the generated file path convention, including the miniatures directory and PNG thumbnail output.
Interfaces
Inbound Interfaces
Kafka
- Consumes
media.resizing.requested. - Requests contain:
- Source S3 key
- Requesting service name No REST or GraphQL API was verified.
Outbound Interfaces
Object Storage
- Downloads the original image.
- Uploads the generated thumbnail.
Kafka
- Publishes the result to:
{requestingService}.resizing.resultThe result contains the generated S3 key and processing status.
Kafka Producers & Consumers
Producers
{requestingService}.resizing.result- Notifies the requesting service that processing completed.
- Returns the generated thumbnail key.
- Reports success or a processing error.
Consumers
media.resizing.requested- Requests image thumbnail generation.
External Integrations
S3-Compatible Object Storage
The service uses the shared file-manager abstraction to download source images and upload generated thumbnails. The configured storage can be AWS S3 or an S3-compatible service such as MinIO.
Kafka
Kafka is used for asynchronous request processing and result notification.
ImageIO
Java ImageIO is used to read supported image formats and generate PNG thumbnails.
Business Rules
-
Each resize request is processed using the source S3 key and requesting service.
-
Generated thumbnails have a fixed size of 100×100 pixels.
-
Thumbnails are stored under:
-
-
-
-
- The requesting service determines the result topic.
-
-
-
-
Processing results distinguish between:
- Success
- Download failure
- Resize failure
- Upload failure
-
Requests are processed by a single Kafka listener thread.
Processing & Error Handling
The processing flow consists of three steps:
- Download the original image from object storage.
- Resize the image to 100×100 pixels.
- Upload the generated PNG thumbnail. If any step fails, the service publishes an error result with the expected thumbnail key and an appropriate error status.
Observability
- Uses the common DEUSS logging framework.
- Logs received resize requests.
- Logs successful processing.
- Logs download, resize, upload, and Kafka publishing failures.
- No dedicated metrics, tracing, or alerting configuration was verified.
Relationships to Other Components
- Other backend services publish resize requests to Kafka.
media-serviceprocesses the image and stores the thumbnail.- The requesting service receives the result through its service-specific Kafka topic.
- Other services can subsequently use the generated S3 key.
Deployment Topology
- Independent Kotlin/Micronaut application.
- Runs as a Kafka consumer and producer.
- Uses the Kafka consumer group
media-serviceby default. - Does not own a PostgreSQL database.
- Does not use Flyway.
- Uses S3-compatible object storage.
- Does not expose a verified REST or GraphQL API.
- Does not directly integrate with blockchain services.
Architecture Notes & Inconsistencies
- The service currently implements image resizing only; broader media capabilities are not verified.
- The README describes the service as standalone and states that no environment variables are required, while
application.yamldefines AWS/S3 configuration. The runtime configuration should be treated as authoritative. - The resize implementation produces a fixed 100×100 image and does not preserve the original aspect ratio.
Source References
whitelabel/media-service/src/main/kotlin/cz/deuss/mediaservice/kafka/ResizeEventsListener.ktwhitelabel/media-service/src/main/kotlin/cz/deuss/mediaservice/kafka/ResizedEventsProducer.ktwhitelabel/media-service/src/main/kotlin/cz/deuss/mediaservice/service/ImageResizeService.ktwhitelabel/media-service/src/main/kotlin/cz/deuss/mediaservice/service/ImageIOResizeService.ktwhitelabel/media-service/src/main/kotlin/cz/deuss/mediaservice/service/S3ImageService.ktwhitelabel/media-service/src/main/resources/application.yamlwhitelabel/media-service/README.md