KxSystems / mqtt

MQTT messaging protocol interface
https://code.kx.com/q/interfaces
Apache License 2.0
9 stars 12 forks source link

Connection options - allowing user to configured various connection options #19

Closed sshanks-kx closed 1 year ago

sshanks-kx commented 4 years ago

Ref: https://www.eclipse.org/paho/files/mqttdoc/MQTTClient/html/_m_q_t_t_client_8h.html#aaa8ae61cd65c9dc0846df10122d7bd4e https://www.eclipse.org/paho/files/mqttdoc/MQTTClient/html/struct_m_q_t_t_client__connect_options.html#a9f1cdffc99659fd4e2d20e6de3c64df0

Currently theres a dict for username/password. Could add other options and document them, that correlate to the options on the above links.

NOTE: different options can have different datatypes

sshanks-kx commented 4 years ago

Following hardcoded conn_opts.keepAliveInterval = 20; conn_opts.cleansession = 1;

Param would be something like the following to do the same thing (each key/etc optional) (usernamepasswordkeepAliveIntervalcleansession!(user;pass;20i;1i))

sshanks-kx commented 4 years ago

(our current code differs from the know default by having hardcoded change to keepAliveInterval to make it 20)

keepAliveInterval - type int or long - default 60 cleansession - type int or long - default 1 reliable - type int or long - default 1 username - type symbol - default empty password - type symbol - default empty connectTimeout - type int or long - default 30 retryInterval - type int or long - default 0 MQTTVersion - type int or long - default 0 maxInflightMessages - type int or long - default -1 cleanstart - type int or long - default 0

Reference for settings: https://www.eclipse.org/paho/files/mqttdoc/MQTTClient/html/struct_m_q_t_t_client__connect_options.html

sshanks-kx commented 4 years ago

Tried with


.mqtt.conn[`$"tcp://mr1z5qb1r6wqc9.messaging.solace.cloud:20806";`src;(`username`password`keepAliveInterval)!(`$"solace-cloud-client";`blah;20i)]

.mqtt.conn[`$"tcp://mr1z5qb1r6wqc9.messaging.solace.cloud:20806";`src;(`username`password`keepAliveInterval)!(`$"solace-cloud-client";`blah;20)]

.mqtt.conn[`$"tcp://mr1z5qb1r6wqc9.messaging.solace.cloud:20806";`src;(`username`password)!(`$"solace-cloud-client";`blah)]

.mqtt.conn[`$"tcp://mr1z5qb1r6wqc9.messaging.solace.cloud:20806";`src;(`keepAliveInterval`cleansession)!(30i;0i)]

.mqtt.conn[`$"tcp://mr1z5qb1r6wqc9.messaging.solace.cloud:20806";`src;(`keepAliveInterval`cleansession)!(30;0)]