<commit_before># Creating a Batch Worker

## Prerequisites

- Refer to the correct Maven Settings found
[here](https://github.hpe.com/caf/caf-development/tree/master/environment/maven-settings).
- Maven
- Docker VM
- IntelliJ (Optional)
- NetBeans (Optional)

## Introduction

Stateless Workers are microservices that can be scaled up or down to meet demand. In essence, a Worker should not be
aware (or need to be aware) of any other Worker or its surrounding system. This way additional "clones" of a Worker can
be created or destroyed at will to provide scaling without affecting other Workers.

### Components of a Batch Worker

The following modules are required to create a Batch worker. Each contains its own pom.xml with its own dependencies
and plugins:

**These modules are generated from the worker-batch-archetype:**
- `worker-<artifactId>-batch-plugin` module contains the worker itself and an md documentation explaining the service
use of the worker.
	1. **\<workerName>BatchPlugin** – responsible for doing the work. This class implements the BatchWorkerPlugin
	interface.
- `worker-<artifactId>-container` module is for building the Docker image of the worker and pushing the image to Docker.
The module starts a container for RabbitMQ, webdav, test-configs, the worker and runs worker acceptance integration
testcases.
	1. **\<workerName>AcceptanceIT** – calls the `worker-batch-testing` dependency's BatchTestControllerProvider class
	to generate or run worker integration testing testcase files.
	2. **pom.xml** – specifies the Docker Maven plugin configurations to build the image for the worker, and Maven
	compiler and failsafe plugin for compiling and running integration tests.

## Using the Batch Worker Archetype

A Maven Archetype is a template which you can base a project on.

Excerpt from
[Apache Maven Archetype Introduction](https://maven.apache.org/guides/introduction/introduction-to-archetypes.html) :

<pre>"Archetype is a Maven project templating toolkit.
An archetype is defined as an original pattern or model from which all other things of the same kind are made."</pre>

### Maven Archetype for Batch Worker projects

You can create the foundations of a new Batch Worker project by using the `worker-batch-archetype` project.
<commit_msg>CAF-2257: Improved bullet pointing of the projects that are output from the archetype generation and removed mention of an MD doc that is not output from the generation.<commit_after># Creating a Batch Worker

## Prerequisites

- Refer to the correct Maven Settings found
[here](https://github.hpe.com/caf/caf-development/tree/master/environment/maven-settings).
- Maven
- Docker VM
- IntelliJ (Optional)
- NetBeans (Optional)

## Introduction

Stateless Workers are microservices that can be scaled up or down to meet demand. In essence, a Worker should not be
aware (or need to be aware) of any other Worker or its surrounding system. This way additional "clones" of a Worker can
be created or destroyed at will to provide scaling without affecting other Workers.

### Components of a Batch Worker

The following modules are required to create a Batch worker. Each contains its own pom.xml with its own dependencies
and plugins:

**These modules are generated from the worker-batch-archetype:**
- `worker-<artifactId>` aggregator project that contains the following modules:
    - `worker-<artifactId>-batch-plugin` module contains the batch worker plugin.
	    - **\<workerName>BatchPlugin** – responsible for doing the work. This class implements the BatchWorkerPlugin
	interface.
    - `worker-<artifactId>-container` module is for building the Docker image of the worker and pushing the image to Docker.
The module starts a container for RabbitMQ, webdav, test-configs, the worker and runs worker acceptance integration
testcases.
	    - **\<workerName>AcceptanceIT** – calls the `worker-batch-testing` dependency's BatchTestControllerProvider class
	to generate or run worker integration testing testcase files.
	    - **pom.xml** – specifies the Docker Maven plugin configurations to build the image for the worker, and Maven
	compiler and failsafe plugin for compiling and running integration tests.

## Using the Batch Worker Archetype

A Maven Archetype is a template which you can base a project on.

Excerpt from
[Apache Maven Archetype Introduction](https://maven.apache.org/guides/introduction/introduction-to-archetypes.html) :

<pre>"Archetype is a Maven project templating toolkit.
An archetype is defined as an original pattern or model from which all other things of the same kind are made."</pre>

### Maven Archetype for Batch Worker projects

You can create the foundations of a new Batch Worker project by using the `worker-batch-archetype` project.

{'fraction_non_alphanumeric': 0.06478754732856541, 'fraction_numerical': 0.001472444257467396, 'mean_word_length': 4.681003584229391, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1461281', 'n_tokens_mistral': 1285, 'n_tokens_neox': 1215, 'n_words': 614}