Overview Middleware4j: Difference between revisions
No edit summary |
Updated by push_wiki.py |
||
| (8 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
Middleware4j is a file-based message transformation and routing engine. It was originally developed as a companion component to [[Commander4j]], but has no dependencies on it and can be used as a standalone middleware solution for any system integration requirement. | |||
== Purpose == | |||
[[file: | Many manufacturing and logistics sites need to exchange data between systems that use incompatible file formats — for example, sending production output data from Commander4j to an ERP system that expects CSV or fixed-column ASCII files, or receiving process orders from SAP in IDOC format and converting them to Commander4j's XML format. Middleware4j handles these conversions automatically, running continuously in the background as a service. | ||
== How It Works == | |||
Middleware4j monitors a set of input directories for incoming files. When a file arrives, it is read by the appropriate '''connector''', converted to an internal XML representation, optionally transformed by an XSLT stylesheet, and then written to one or more output destinations by one or more output connectors. | |||
This pipeline is defined by a '''[[Maps|Map]]''' — a configuration block that specifies: | |||
* One input connector (how to read the incoming file) | |||
* One or more output connectors (where to send the result and in what format) | |||
* Optional XSLT stylesheets for transforming the data | |||
* Optional conditions for routing to different outputs based on message content | |||
Multiple maps run simultaneously in background threads, each independently monitoring its own input directory. | |||
== Supported Formats == | |||
{| class="wikitable" | |||
|- | |||
! Format !! Input !! Output | |||
|- | |||
| [[ASCII]] — fixed-column flat files || ✓ || ✓ | |||
|- | |||
| [[CSV]] — delimited text files || ✓ || ✓ | |||
|- | |||
| [[XML]] — structured XML documents || ✓ || ✓ | |||
|- | |||
| IDOC — SAP IDOC format || ✓ || ✓ | |||
|- | |||
| Excel — XLS/XLSX spreadsheets || ✓ || ✓ | |||
|- | |||
| [[EMAIL]] — email with attachments || ✓ || ✓ | |||
|- | |||
| [[RAW]] — unmodified file copy || ✓ || ✓ | |||
|- | |||
| [[PDF_PRINT]] — print PDF to a named print queue || ✓ || ✓ | |||
|- | |||
| [[SOCKET]] — TCP/IP socket transmission || || ✓ | |||
|- | |||
| MQTT — publish to an MQTT broker || || ✓ | |||
|} | |||
== XSLT Transformation == | |||
The transformation engine is built on '''Saxon 12''' (XSLT 2.0). Stylesheets can use standard XPath 2.0 expressions as well as a set of custom Middleware4j extension functions for string manipulation, date formatting, and reading from external reference data files. | |||
Over 60 sample XSLT stylesheets are included covering real-world integration scenarios between Commander4j and common ERP and MES systems (SAP, Sage, Tropos, B2MML S95, and others). | |||
== Deployment Modes == | |||
Middleware4j can be run in two modes: | |||
{| class="wikitable" | |||
|- | |||
! Mode !! Description | |||
|- | |||
| '''Service''' || Runs as a background daemon (or Windows service) with no user interface. This is the normal production deployment. | |||
|- | |||
| '''GUI''' || Launches a desktop window showing configured maps and real-time message counts. Useful for testing and monitoring. | |||
|} | |||
See [[Installation Middleware4j]] for how to deploy as a Windows service. | |||
== Relationship to Commander4j == | |||
Middleware4j processes Commander4j's outbound XML messages (such as Production Declarations, Despatch Advice, and Equipment Tracking events) and converts them into whatever format an external system requires. It also handles inbound flows — receiving data from external systems (material masters, process orders, pallet status changes) in their native format and converting them to Commander4j's XML interface format for import. | |||
See also: [[Maps]], [[Connectors]], [[Middleware4j Example Configuration]], [[Installation Middleware4j]] | |||
[[Category:Middleware4j]] | |||
Latest revision as of 12:17, 1 April 2026
Middleware4j is a file-based message transformation and routing engine. It was originally developed as a companion component to Commander4j, but has no dependencies on it and can be used as a standalone middleware solution for any system integration requirement.
Purpose
Many manufacturing and logistics sites need to exchange data between systems that use incompatible file formats — for example, sending production output data from Commander4j to an ERP system that expects CSV or fixed-column ASCII files, or receiving process orders from SAP in IDOC format and converting them to Commander4j's XML format. Middleware4j handles these conversions automatically, running continuously in the background as a service.
How It Works
Middleware4j monitors a set of input directories for incoming files. When a file arrives, it is read by the appropriate connector, converted to an internal XML representation, optionally transformed by an XSLT stylesheet, and then written to one or more output destinations by one or more output connectors.
This pipeline is defined by a Map — a configuration block that specifies:
- One input connector (how to read the incoming file)
- One or more output connectors (where to send the result and in what format)
- Optional XSLT stylesheets for transforming the data
- Optional conditions for routing to different outputs based on message content
Multiple maps run simultaneously in background threads, each independently monitoring its own input directory.
Supported Formats
| Format | Input | Output |
|---|---|---|
| ASCII — fixed-column flat files | ✓ | ✓ |
| CSV — delimited text files | ✓ | ✓ |
| XML — structured XML documents | ✓ | ✓ |
| IDOC — SAP IDOC format | ✓ | ✓ |
| Excel — XLS/XLSX spreadsheets | ✓ | ✓ |
| EMAIL — email with attachments | ✓ | ✓ |
| RAW — unmodified file copy | ✓ | ✓ |
| PDF_PRINT — print PDF to a named print queue | ✓ | ✓ |
| SOCKET — TCP/IP socket transmission | ✓ | |
| MQTT — publish to an MQTT broker | ✓ |
XSLT Transformation
The transformation engine is built on Saxon 12 (XSLT 2.0). Stylesheets can use standard XPath 2.0 expressions as well as a set of custom Middleware4j extension functions for string manipulation, date formatting, and reading from external reference data files.
Over 60 sample XSLT stylesheets are included covering real-world integration scenarios between Commander4j and common ERP and MES systems (SAP, Sage, Tropos, B2MML S95, and others).
Deployment Modes
Middleware4j can be run in two modes:
| Mode | Description |
|---|---|
| Service | Runs as a background daemon (or Windows service) with no user interface. This is the normal production deployment. |
| GUI | Launches a desktop window showing configured maps and real-time message counts. Useful for testing and monitoring. |
See Installation Middleware4j for how to deploy as a Windows service.
Relationship to Commander4j
Middleware4j processes Commander4j's outbound XML messages (such as Production Declarations, Despatch Advice, and Equipment Tracking events) and converts them into whatever format an external system requires. It also handles inbound flows — receiving data from external systems (material masters, process orders, pallet status changes) in their native format and converting them to Commander4j's XML interface format for import.
See also: Maps, Connectors, Middleware4j Example Configuration, Installation Middleware4j