WillMessage Property

The message that the server should publish in the event of an ungraceful disconnection.


ANSI (Cross Platform)
char* GetWillMessage();
int SetWillMessage(const char* lpszWillMessage); Unicode (Windows) LPWSTR GetWillMessage();
INT SetWillMessage(LPCWSTR lpszWillMessage);
@property (nonatomic,readwrite,assign,getter=willMessage,setter=setWillMessage:) NSString* willMessage;
- (NSString*)willMessage;
- (void)setWillMessage:(NSString*)newWillMessage;

IPWORKSMQ_EXTERNAL void* IPWORKSMQ_CALL IPWorksMQ_MQTT_Get(void *lpObj, int propid, int arridx, int *lpcbVal, int64 *lpllVal);
IPWORKSMQ_EXTERNAL int IPWORKSMQ_CALL IPWorksMQ_MQTT_Set(void *lpObj, int propid, int arridx, const void *val, int cbVal);

Default Value



This property may be set before calling Connect to specify to the server a message that should be published on WillTopic if the connection is closed ungracefully. Since it is sent to the server when Connect is called, this property's value cannot be changed when already connected.

Note that the WillMessage will only be sent to the server when Connect is called if WillTopic is set.

Refer to WillTopic for more information about MQTT Will functionality.

This property is not available at design time.

Data Type


Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks MQ 2020 C++ Edition - Version 20.0 [Build 8162]