Get started with the MES Middleware service
- Last UpdatedOct 23, 2024
- 3 minute read
The MES middleware is a process that handles two categories of tasks:
-
Scheduled tasks that are referred to generally as maintenance services
-
Client application transactions with the MES database
The MES middleware is fully multi-threaded and uses multiple CPUs. However, other restrictions related to handling transactions limit the number of sessions that one MES middleware host can support. For additional information about licensing, see the MES Deployment Guide.
Multiple MES Middleware Hosts
A multi-node environment can have more than one MES middleware host installed.
Any of the middleware hosts can handle client application database transactions. However, only one MES middleware at a time will be handling maintenance services. When configuring the MES DB/MW Communication component in the post‑install Configurator, a middleware can be selected as the preferred middleware to handle the maintenance services. For more information, see Determine the maintenance services middleware host.
Note that each MES middleware host acquires an MES Middleware count from the License Server.
MES Service Tasks Moved to the MES Middleware
In previous releases, the MES Service was connected to the MES middleware through the proxy layer. Starting with MES version 7.0, the MES Service is part of the MES middleware. Since the MES Service is now part of the MES middleware, the database maintenance activities are performed as part of the middleware, but on different threads.
Maintenance Services
The MES middleware that is currently handling the maintenance services performs the following scheduled tasks:
-
Cleaning up stale sessions
-
Running the Supply Chain Connector (SCC) schedules
-
Managing entity shift changes
-
Changing utilization reasons for entities for reasons that have elapsed
-
Generating future quality samples for time, shift, and production unit count frequencies
-
Changing quality sample states based on the passage of time
These tasks are critical to having consistent OEE and downtime data. For detailed information, see Middleware and maintenance services.
Client Application Database Transactions
Each active MES middleware can process client application calls to perform MES database transactions. The middleware supports the following call endpoints:
-
Synchronous
-
Asynchronous
-
Web API
-
Event Broker
For more information, see Understand middleware client application database transactions.
MES Middleware Proxies
An MES middleware proxy provides access to the MES middleware for clients. The proxy is installed on each client machine and on all MES middleware host server machines.By default, the communication between the MES middleware proxy and the MES middleware host is encrypted.
The middleware proxy allows code on a client machine to make a call across the network as if it was making the call on the server machine. For synchronous calls, the proxy communicates directly with the middleware. For asynchronous calls, the proxy puts messages onto an available middleware server's message queue, from which they are pulled and processed by the middleware. After the proxy makes the call, it waits for the command to be processed. If the middleware is too busy, the command can timeout and the proxy will report an error.
The MES Stateful and Stateless APIs use the MES middleware proxy. Client applications that make a call to the event broker endpoint to register for notifications of data changes also use the proxy.
MES Web API calls do not use an MES middleware proxy.
User Account Associated with Middleware Background Tasks
The Windows user account that is assigned to the MES Middleware Host service will be the user associated with executing middleware background tasks. By default, this account is NT Service\WCFHostService. The user account can be changed on the service's Properties dialog box in the Services control panel applet. To see the current user account assignment, see the MES Middleware Host service entry in the Services control panel applet.
The exception to this is the user that executes Supply Chain Connector (SCC) transactions. That user can be specified by system parameter 199 (User ID for background tasks<1866>). If the user configured in this system attribute does not exist in the user_name table, then the system defaults to the user account that is assigned to the MES Middleware Host service.
MES Middleware Host Service Startup Type
The Startup Type of the MES Middleware Host service is set to Automatic (Delayed Start). That is, it waits for other services, such as SQL Server, to be started first before starting itself. However, if required, this setting can be changed to Automatic.