Installation Middleware4j: Difference between revisions
No edit summary |
Updated by push_wiki.py |
||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
This page covers deploying Middleware4j on a server or integration host. | |||
== Requirements == | |||
* Network access to any input or output directories defined in the map configuration (local paths, UNC shares, or mounted network drives) | |||
* If using the EMAIL connector: network access to an SMTP server | |||
* If using the SOCKET connector: network access to the target TCP/IP device | |||
* Windows, Linux, or macOS | |||
* Java 21 — required only when running from the distribution archive; the native install package bundles its own Java runtime | |||
== Installation == | |||
[[ | Native install packages for Windows, macOS, and Linux are available from the [[Downloads]] page and are the preferred installation method. The installer creates the application directory, copies all configuration templates, and handles the Java runtime dependency automatically. | ||
Alternatively, a distribution archive can be extracted to a suitable directory, for example: | |||
C:\Commander4j\Middleware4j\ (Windows) | |||
/opt/commander4j/middleware4j/ (Linux) | |||
The extracted directory contains: | |||
c4jMiddleware.jar | |||
Middleware_Service.exe (Windows — service launcher) | |||
Middleware_GUI.exe (Windows — desktop GUI launcher) | |||
Encrypt_String.exe (Windows — utility to encrypt passwords) | |||
start.cmd (Windows — fallback start script) | |||
start.sh (Linux/macOS — start script) | |||
xml/config/ | |||
xslt/ | |||
interface/ | |||
logs/ | |||
samples/ | |||
== Configuration Before First Run == | |||
=== 1. Maps === | |||
Edit <code>xml/config/config.xml</code> to define the transformation maps. Each map specifies one input connector, one or more output connectors, and optionally an XSLT stylesheet. See [[Maps]] for the full configuration reference. | |||
=== 2. XSLT Stylesheets === | |||
Place any XSLT stylesheets used by your maps in the <code>xslt/</code> directory. A library of over 60 sample stylesheets is included covering common integration scenarios with SAP, Sage, Tropos, B2MML, and others. | |||
=== 3. Email Notifications (Optional) === | |||
Edit <code>xml/config/email.xml</code> with your SMTP server details and recipient addresses for error notifications. | |||
=== 4. Password Encryption === | |||
Any passwords stored in configuration files (SMTP, database connections) must be AES-encrypted. Use the included <code>Encrypt_String.exe</code> utility (Windows) to generate encrypted values. On Linux/macOS, use the equivalent utility from the Commander4j installation. | |||
== Installing as a Windows Service == | |||
The native install package includes <code>Middleware_Service.exe</code>, a service-mode launcher built with install4j. This executable manages the Windows service directly — no additional wrapper (such as WinSW) is required. | |||
All service commands must be run from an elevated command prompt (Run as Administrator). | |||
The default Windows service name is '''Middleware Service''' (the launcher name defined in the installer). You can specify a different name as an optional second parameter — useful if you need to run multiple instances on the same machine. If a custom name is used at install time, that same name must be passed to every subsequent command. | |||
{| class="wikitable" | |||
|- | |||
! Command !! Effect | |||
|- | |||
| <code>Middleware_Service.exe /install</code> || Register as '''Middleware Service''' with automatic startup on boot | |||
|- | |||
| <code>Middleware_Service.exe /install "My Middleware"</code> || Register with a custom service name | |||
|- | |||
| <code>Middleware_Service.exe /install-demand</code> || Register with manual startup only | |||
|- | |||
| <code>Middleware_Service.exe /start</code> || Start the service | |||
|- | |||
| <code>Middleware_Service.exe /stop</code> || Stop the service (waits for graceful shutdown) | |||
|- | |||
| <code>Middleware_Service.exe /restart</code> || Restart the service | |||
|- | |||
| <code>Middleware_Service.exe /status</code> || Query status (exit code: 0 = running, 3 = stopped) | |||
|- | |||
| <code>Middleware_Service.exe /uninstall</code> || Remove the service registration | |||
|} | |||
If a custom service name was used at install time, append it to all subsequent commands: | |||
Middleware_Service.exe /start "My Middleware" | |||
Middleware_Service.exe /stop "My Middleware" | |||
Middleware_Service.exe /uninstall "My Middleware" | |||
Once installed, the service also appears in the Windows Services management console (<code>services.msc</code>). | |||
=== Testing Before Installing as a Service === | |||
[[ | Before committing to service installation, run Middleware4j in desktop GUI mode using: | ||
Middleware_GUI.exe | |||
This launches a desktop window showing all configured maps, their current status, and real-time message counts. Use this mode to confirm that maps are reading from the correct input directories and that XSLT transformations produce the expected output. Once satisfied, switch to service mode for production deployment. | |||
== Starting on Linux / macOS == | |||
Use the provided shell script: | |||
./start.sh | |||
The mode (GUI or Service) is passed as an argument by the script. The process runs in the foreground. For production deployment, use systemd, launchd, or nohup to manage it as a background process. | |||
== Verifying the Installation == | |||
After starting Middleware4j: | |||
# Check <code>logs/</code> for startup messages confirming that each map thread has initialised. | |||
# Place a test input file in the input directory of one of the configured maps. | |||
# Confirm the file is consumed and the expected output appears in the output directory. | |||
# Check <code>interface/log/</code> for the message transaction record. | |||
== Log Files == | |||
All activity is written to the Log4j log file in the <code>logs/</code> directory. Log rotation and retention are configured in <code>xml/config/log4j2.xml</code>. | |||
See also: [[Overview_Middleware4j]], [[Maps]], [[Connectors]] | |||
[[Category:Middleware4j]] | |||
Latest revision as of 18:05, 5 April 2026
This page covers deploying Middleware4j on a server or integration host.
Requirements
- Network access to any input or output directories defined in the map configuration (local paths, UNC shares, or mounted network drives)
- If using the EMAIL connector: network access to an SMTP server
- If using the SOCKET connector: network access to the target TCP/IP device
- Windows, Linux, or macOS
- Java 21 — required only when running from the distribution archive; the native install package bundles its own Java runtime
Installation
Native install packages for Windows, macOS, and Linux are available from the Downloads page and are the preferred installation method. The installer creates the application directory, copies all configuration templates, and handles the Java runtime dependency automatically.
Alternatively, a distribution archive can be extracted to a suitable directory, for example:
C:\Commander4j\Middleware4j\ (Windows) /opt/commander4j/middleware4j/ (Linux)
The extracted directory contains:
c4jMiddleware.jar Middleware_Service.exe (Windows — service launcher) Middleware_GUI.exe (Windows — desktop GUI launcher) Encrypt_String.exe (Windows — utility to encrypt passwords) start.cmd (Windows — fallback start script) start.sh (Linux/macOS — start script) xml/config/ xslt/ interface/ logs/ samples/
Configuration Before First Run
1. Maps
Edit xml/config/config.xml to define the transformation maps. Each map specifies one input connector, one or more output connectors, and optionally an XSLT stylesheet. See Maps for the full configuration reference.
2. XSLT Stylesheets
Place any XSLT stylesheets used by your maps in the xslt/ directory. A library of over 60 sample stylesheets is included covering common integration scenarios with SAP, Sage, Tropos, B2MML, and others.
3. Email Notifications (Optional)
Edit xml/config/email.xml with your SMTP server details and recipient addresses for error notifications.
4. Password Encryption
Any passwords stored in configuration files (SMTP, database connections) must be AES-encrypted. Use the included Encrypt_String.exe utility (Windows) to generate encrypted values. On Linux/macOS, use the equivalent utility from the Commander4j installation.
Installing as a Windows Service
The native install package includes Middleware_Service.exe, a service-mode launcher built with install4j. This executable manages the Windows service directly — no additional wrapper (such as WinSW) is required.
All service commands must be run from an elevated command prompt (Run as Administrator).
The default Windows service name is Middleware Service (the launcher name defined in the installer). You can specify a different name as an optional second parameter — useful if you need to run multiple instances on the same machine. If a custom name is used at install time, that same name must be passed to every subsequent command.
| Command | Effect |
|---|---|
Middleware_Service.exe /install |
Register as Middleware Service with automatic startup on boot |
Middleware_Service.exe /install "My Middleware" |
Register with a custom service name |
Middleware_Service.exe /install-demand |
Register with manual startup only |
Middleware_Service.exe /start |
Start the service |
Middleware_Service.exe /stop |
Stop the service (waits for graceful shutdown) |
Middleware_Service.exe /restart |
Restart the service |
Middleware_Service.exe /status |
Query status (exit code: 0 = running, 3 = stopped) |
Middleware_Service.exe /uninstall |
Remove the service registration |
If a custom service name was used at install time, append it to all subsequent commands:
Middleware_Service.exe /start "My Middleware" Middleware_Service.exe /stop "My Middleware" Middleware_Service.exe /uninstall "My Middleware"
Once installed, the service also appears in the Windows Services management console (services.msc).
Testing Before Installing as a Service
Before committing to service installation, run Middleware4j in desktop GUI mode using:
Middleware_GUI.exe
This launches a desktop window showing all configured maps, their current status, and real-time message counts. Use this mode to confirm that maps are reading from the correct input directories and that XSLT transformations produce the expected output. Once satisfied, switch to service mode for production deployment.
Starting on Linux / macOS
Use the provided shell script:
./start.sh
The mode (GUI or Service) is passed as an argument by the script. The process runs in the foreground. For production deployment, use systemd, launchd, or nohup to manage it as a background process.
Verifying the Installation
After starting Middleware4j:
- Check
logs/for startup messages confirming that each map thread has initialised. - Place a test input file in the input directory of one of the configured maps.
- Confirm the file is consumed and the expected output appears in the output directory.
- Check
interface/log/for the message transaction record.
Log Files
All activity is written to the Log4j log file in the logs/ directory. Log rotation and retention are configured in xml/config/log4j2.xml.
See also: Overview_Middleware4j, Maps, Connectors