Production Connector as MQTT client: New connection settings and Last Will & Testament messages
With the 2605 release of SAP Digital Manufacturing, the Production Connector introduces enhanced MQTT client capabilities that improve reliability, observability, and connection handling. This blog explains the new configuration settings—Last Will and Testament (LWT), Clean Session, and Keep Alive—and demonstrates how they enable robust communication scenarios and help detect ungraceful disconnects and notify subscribed systems in real time.
Introduction
In modern manufacturing integration scenarios, reliable messaging is critical—especially when leveraging MQTT for lightweight, event-driven communication. With the 2605 release of SAP Digital Manufacturing and Production Connector 3.1, the Production Connector evolves further as an MQTT client by introducing three new configuration capabilities:
- Last Will and Testament (LWT)
- Keep Alive Interval
- Clean Session
These settings align the Production Connector more closely with standard MQTT behavior and significantly enhance resiliency in distributed environments.
Understanding the new MQTT connection settings
1- Last Will and Testament (LWT)
The Last Will and Testament is a built-in MQTT safety mechanism. It allows a client to register a message with the broker during connection setup. If the client disconnects unexpectedly (without sending a proper disconnect signal), the broker automatically publishes this message to a predefined topic:
Key configuration elements:
- Topic: Where the LWT message will be published
- Payload: The content of the message
- Quality of Service (QoS): Delivery guarantee level
- Retain flag: Keeps the last known state available for new subscribers
This mechanism is especially useful for monitoring scenarios:
When the Production Connector goes offline ungracefully, all clients subscribed to the configured topic are immediately notified.
2 – Keep Alive Interval
The Keep Alive setting acts as a heartbeat between client and broker:
- Defines how frequently the client must send a ping
- If no ping is received within the interval, the broker assumes the client is disconnected
- The broker triggers the LWT message if the disconnect is ungraceful
In the Production Connector the default value is 30 seconds. Depending on local network conditions the customer may have the need to change to higher values to reduce network traffic.
This mechanism ensures:
- Fast detection of connection loss
- Immediate notification through LWT
3- Clean Session
The Clean Session flag determines whether the broker should persist session data across reconnects.
- Clean Session = true
- Session data is discarded after disconnect
- No subscriptions or queued messages are retained
- Each connection starts fresh
- Clean Session = false
- Session state is preserved
- Subscriptions and queued QoS 1 and 2 messages are retained
- Ensures continuity in unstable networks
For production environments, setting this to false is typically recommended to guarantee reliable communication despite intermittent connectivity. Only for scenarios with lightweight brokers the flag may be set to “true”.
Configuration Steps
Within the Manage Message Broker app, new configuration sections are available for:
- Subscriber client
- Publisher client
The subscriber client uses a dedicated agent instance and maintains a single connection to the broker. Only the subscriber client has a “Clean Session” flag while the LWT and Keep Alive settings are available for all clients.
Publisher clients are created dynamically through automation sequences: Each MQTT publish step creates its own client. Subscriptions in the Manage Automatic Triggers app also create clients, if “Message Publishing” is selected as action type.
This means:
- Multiple publisher clients can exist simultaneously
- Currently, they share the same configuration settings
In the example shown below we have configured for the subscriber client:
- An LWT payload was defined:
“Production connector subscriber client went offline” - A dedicated topic was configured, here lwtTopic/subscriber
- For the Keep Alive interval we kept its default value of 30 seconds
- We are using the default Quality of Service 0 – At Most Once
Conclusion
With the introduction of LWT, Keep Alive, and Clean Session settings, the Production Connector becomes a more robust and transparent MQTT client. These capabilities empower developers and operators to:
- Detect and react to failures instantly
- Ensure message delivery continuity
- Build more reliable industrial integration scenarios
As MQTT adoption continues to grow in manufacturing, these enhancements are a significant step toward production-grade messaging reliability in SAP Digital Manufacturing.
If you’re working with MQTT integration in Production Connector, now is a great time to explore these settings and integrate them into your architecture.



