Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 97 additions & 0 deletions README.WorkerApplication.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# WorkerApplication Configuration and HK2 Bindings

This document inventories all configurations used in WorkerApplication.


## Configuration overview

1. bucketName
- Type and name: Context: bucket. ENV: PUBLISH_S3_BUCKET
- What it does: Defines the S3 bucket used for export.
- Quarkus suggestion: Map to `@ConfigProperty` in `application.properties`.

2. cloudId
- Type and name: Context: cloudId. ENV: CLOUDID
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current logic:
context parameter overrides environment variable, enables multiple workers.

The context parameter should be refactored to @ConfigProperty. Let's drop the ENV support.

- What it does: Identifies the AWS worker instance. If not set, AWS worker will not start.
- Quarkus suggestion: Map to `@ConfigProperty`.

3. aws.accessKeyId
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drop both accessKeyId and secretKey. We will rely entirely on DefaultAwsRegionProviderChain.

This is possible because in CMS 5.3 cloud setup we no longer need separate API keys for multi-worker installations.

- Type and name: Context: aws.accessKeyId.
- What id does: AWS access key used for authentication.
- Quarkus suggestion: Map to `quarkus.amazon.credentials.type` or `@ConfigProperty`.

4. aws.secretKey
- Type and name: Context: aws.secretKey.
- What it does: AWS secret key is used for authentication.
- Quarkus suggestion: Map to `quarkus.amazon.credentials.type` or `@ConfigProperty`.

5. AWS Region
- Type and name: ENV (AWS default region configuration)
- What it does: Determines which AWS region is used. And default fallback is eu-west-1.
- Quarkus suggestion: Use `quarkus.amazon.region` or `@ConfigProperty`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, will see which is needed depending on how the S3 / SFN clients are injected. We can remove the default if it simplifies the implementation.

Important:
When running on EC2 it MUST detect automatically, typically via regionProvider.getRegion()


6. PUBLISH_S3_ACCELERATED
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should remain an ENV (same name)

- Type and name: ENV: PUBLISH_S3_ACCELERATED
- What it does: Enables S3 transfer acceleration.
- Quarkus suggestion: Map to `@ConfigProperty`.

7. PUBLISH_FS_PATH
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should remain an ENV (same name)

- Type and name: ENV: PUBLISH_FS_PATH
- What is does: Defines local filesystem export path. If set, export uses local file system instead of S3.
- Quarkus suggestion: Map to `@ConfigProperty`.

8. APTAPPLICATION
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

APTAPPLICATION must remain an ENV because it is used by Arbortext as well.

- Type and name: ENV: APTAPPLICATION
- What it does: Defines application path prefix used by PublishJobService.
- Quarkus suggestion: Map to `@ConfigProperty`.


## HK2 Bindings Overview

1. WorkerStatusReport
- Class / Type: WorkerStatusReport
- Purpose: Used to report worker status inside the application
- Quarkus suggestion: Replace with `@Singleton` CDI bean.

2. region
- Class / Type: Region.
- Purpose: Represents the AWS region used by AWS clients.
- Quarkus suggestion: Inject via `@ConfigProperty` or `@Singleton`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure, depends on how clients are injected. Might be better with @produces


3. bucketName
- Class / Type: String (named binding)
- Purpose: Holds the configured S3 bucket name. Injected by name in HK2.
- Quarkus suggestion: Use `@ConfigProperty` with `@Named`.

4. exportProviders (Important – Multiple Implementations).
- Class / Type: Map<String, CmsExportProvider>.
- Purpose: Contains multiple export provider implementations.
- "fs" --> CmsExportProviderFsSingle (local file export).
- "s3" --> CmsExportProviderAwsSingle (S3 export).
- Quarkus suggestion: Inject as a singleton bean with `@Produces`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, produce the whole Map which means we (hopefully) don't have to modify the code using this Map.


5. SfnClient
- Class / Type: SfnClient.
- Purpose: AWS Step Functions client
- Quarkus suggestion: Replace with `@Singleton` or Quarkus AWS SDK client injection.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be more consistent to use @produces since S3Client / exportProviders and other stuff needs @produces.


6. ObjectReader / ObjectWriter
- Class / Type: Jackson
- Purpose: JSON serialization and deserialization.
- Quarkus suggestion: Inject via CDI or use `@Produces` beans.

7. PublishServicePe
- Class / Type: PublishServicePe.
- Purpose: Backend publish service.
- Quarkus suggestion: Replace with `@Singleton` CDI bean.

8. PublishJobService
- Class / Type: PublishJobService.
- Purpose: Orchestrates export and publish jobs.
- Quarkus suggestion: Replace with `@Singleton` CDI bean.