# Message Processing Rules

The **Message Processing Rule** card defines the splitting and aggregation rules applied when a file is split into JMS messages and when multiple JMS messages are aggregated into a single file.

Follow these steps to configure message processing rules:

1. In **Setup** → **Message Processing Rule**, click the **NEW** button.
2. In the **New Message Processing Rule** page, fill in the fields:
   1. **Name** (\*): assign a name to the rule you are creating. Maximum 128 characters are accepted.
   2. **Description**: (optional) enter a description for the rule you are configuring. Maximum 255 characters are accepted.
   3. **Protocol**: JMS is already selected.
   4. **Type**: select **File to message** if the rule must be applied when a file is split into multiple JMS messages; select **Message to file** if the rule must be applied when one or more JMS messages are aggregated into a single file.

## Splitting file content into JMS messages

By selecting **File to message** (a file is split into multiple JMS messages) in the **Type** field, the following options will appear:

* **Splitting strategy**:
  * **One to one**: send the entire file content as the body of a single JMS message.
  * **One to many**: split the file into multiple JMS messages each containing an individual “record” from the original file.
* **Max message size**: maximum dimension applied to the file or to each split file. If **One to one** is selected and a file exceeds the specified maximum size, an error will appear and the operation will fail. If **One to many** is selected, the file is split in chunks according to the specified maximum size.
* **Units**: unit if measure of the message size. Select MB or KB according to your needs.

When selecting **One to many**, the additional **Record demarcation policy** option appears to set the delimiter to split text files in multiple messages. These are its options:

* **Platform-defined end of record**: this option automatically applies the “File EOR” already associated with the file metadata in Data Mover.&#x20;
* **CR**: carriage return.
* **LF**: line feed.
* **CRLF**: carriage return line feed

## Aggregating JMS messages into files

By selecting **Message to file** (multiple JMS messages are aggregated into a single file) in the **Type** field, the following option will appear:

* **Aggregation strategy**:
  * **One to one**: each JMS message corresponds to one file. In this case, no aggregation is applied.
  * **Many to one**: multiple messages are converted into a single file. The number of messages must be specified in the **Number** field of the **File demarcation policy** option.
    * **File demarcation policy**: select **Basic thresholds** and in the **Threshold condition** pane enter the condition that must be applied when a new file is released to Data One. At least one of following threshold conditions must be verified:
      * **Number**: number of messages composing the file.
      * **Time**: time interval by which, if not all of the messages have arrived, the file containing the messages that have arrived will be created.

Message processing rules are listed on the page as shown in the picture below.

<figure><img src="/files/JJYeIlkcXCzBvNkDZ9RM" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.primeur.com/data-mover-1.21/transfer-protocols-and-connectors/jms-connector/message-processing-rules.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
