This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push: new 4ef5b8d CAMEL-16937: camel-paho-mqtt5 - Add option to set session expiry interval. 4ef5b8d is described below commit 4ef5b8d061c74d0d8c7af25bd03cf4981f394b7b Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Thu Sep 9 16:43:19 2021 +0200 CAMEL-16937: camel-paho-mqtt5 - Add option to set session expiry interval. --- .../paho/mqtt5/PahoMqtt5ComponentConfigurer.java | 6 + .../paho/mqtt5/PahoMqtt5EndpointConfigurer.java | 6 + .../paho/mqtt5/PahoMqtt5EndpointUriFactory.java | 3 +- .../camel/component/paho/mqtt5/paho-mqtt5.json | 2 + .../src/main/docs/paho-mqtt5-component.adoc | 6 +- .../paho/mqtt5/PahoMqtt5Configuration.java | 21 +++ .../component/paho/mqtt5/PahoMqtt5Endpoint.java | 3 + .../dsl/PahoMqtt5ComponentBuilderFactory.java | 26 ++++ .../dsl/PahoMqtt5EndpointBuilderFactory.java | 150 +++++++++++++++++++++ .../modules/ROOT/pages/paho-mqtt5-component.adoc | 6 +- 10 files changed, 224 insertions(+), 5 deletions(-) diff --git a/components/camel-paho-mqtt5/src/generated/java/org/apache/camel/component/paho/mqtt5/PahoMqtt5ComponentConfigurer.java b/components/camel-paho-mqtt5/src/generated/java/org/apache/camel/component/paho/mqtt5/PahoMqtt5ComponentConfigurer.java index 620779c..4ed2d31 100644 --- a/components/camel-paho-mqtt5/src/generated/java/org/apache/camel/component/paho/mqtt5/PahoMqtt5ComponentConfigurer.java +++ b/components/camel-paho-mqtt5/src/generated/java/org/apache/camel/component/paho/mqtt5/PahoMqtt5ComponentConfigurer.java @@ -66,6 +66,8 @@ public class PahoMqtt5ComponentConfigurer extends PropertyConfigurerSupport impl case "retained": getOrCreateConfiguration(target).setRetained(property(camelContext, boolean.class, value)); return true; case "serveruris": case "serverURIs": getOrCreateConfiguration(target).setServerURIs(property(camelContext, java.lang.String.class, value)); return true; + case "sessionexpiryinterval": + case "sessionExpiryInterval": getOrCreateConfiguration(target).setSessionExpiryInterval(property(camelContext, long.class, value)); return true; case "socketfactory": case "socketFactory": getOrCreateConfiguration(target).setSocketFactory(property(camelContext, javax.net.SocketFactory.class, value)); return true; case "sslclientprops": @@ -129,6 +131,8 @@ public class PahoMqtt5ComponentConfigurer extends PropertyConfigurerSupport impl case "retained": return boolean.class; case "serveruris": case "serverURIs": return java.lang.String.class; + case "sessionexpiryinterval": + case "sessionExpiryInterval": return long.class; case "socketfactory": case "socketFactory": return javax.net.SocketFactory.class; case "sslclientprops": @@ -193,6 +197,8 @@ public class PahoMqtt5ComponentConfigurer extends PropertyConfigurerSupport impl case "retained": return getOrCreateConfiguration(target).isRetained(); case "serveruris": case "serverURIs": return getOrCreateConfiguration(target).getServerURIs(); + case "sessionexpiryinterval": + case "sessionExpiryInterval": return getOrCreateConfiguration(target).getSessionExpiryInterval(); case "socketfactory": case "socketFactory": return getOrCreateConfiguration(target).getSocketFactory(); case "sslclientprops": diff --git a/components/camel-paho-mqtt5/src/generated/java/org/apache/camel/component/paho/mqtt5/PahoMqtt5EndpointConfigurer.java b/components/camel-paho-mqtt5/src/generated/java/org/apache/camel/component/paho/mqtt5/PahoMqtt5EndpointConfigurer.java index c43e345..5bb680d 100644 --- a/components/camel-paho-mqtt5/src/generated/java/org/apache/camel/component/paho/mqtt5/PahoMqtt5EndpointConfigurer.java +++ b/components/camel-paho-mqtt5/src/generated/java/org/apache/camel/component/paho/mqtt5/PahoMqtt5EndpointConfigurer.java @@ -60,6 +60,8 @@ public class PahoMqtt5EndpointConfigurer extends PropertyConfigurerSupport imple case "retained": target.getConfiguration().setRetained(property(camelContext, boolean.class, value)); return true; case "serveruris": case "serverURIs": target.getConfiguration().setServerURIs(property(camelContext, java.lang.String.class, value)); return true; + case "sessionexpiryinterval": + case "sessionExpiryInterval": target.getConfiguration().setSessionExpiryInterval(property(camelContext, long.class, value)); return true; case "socketfactory": case "socketFactory": target.getConfiguration().setSocketFactory(property(camelContext, javax.net.SocketFactory.class, value)); return true; case "sslclientprops": @@ -124,6 +126,8 @@ public class PahoMqtt5EndpointConfigurer extends PropertyConfigurerSupport imple case "retained": return boolean.class; case "serveruris": case "serverURIs": return java.lang.String.class; + case "sessionexpiryinterval": + case "sessionExpiryInterval": return long.class; case "socketfactory": case "socketFactory": return javax.net.SocketFactory.class; case "sslclientprops": @@ -189,6 +193,8 @@ public class PahoMqtt5EndpointConfigurer extends PropertyConfigurerSupport imple case "retained": return target.getConfiguration().isRetained(); case "serveruris": case "serverURIs": return target.getConfiguration().getServerURIs(); + case "sessionexpiryinterval": + case "sessionExpiryInterval": return target.getConfiguration().getSessionExpiryInterval(); case "socketfactory": case "socketFactory": return target.getConfiguration().getSocketFactory(); case "sslclientprops": diff --git a/components/camel-paho-mqtt5/src/generated/java/org/apache/camel/component/paho/mqtt5/PahoMqtt5EndpointUriFactory.java b/components/camel-paho-mqtt5/src/generated/java/org/apache/camel/component/paho/mqtt5/PahoMqtt5EndpointUriFactory.java index 7fcf701..91e8d9c 100644 --- a/components/camel-paho-mqtt5/src/generated/java/org/apache/camel/component/paho/mqtt5/PahoMqtt5EndpointUriFactory.java +++ b/components/camel-paho-mqtt5/src/generated/java/org/apache/camel/component/paho/mqtt5/PahoMqtt5EndpointUriFactory.java @@ -20,7 +20,7 @@ public class PahoMqtt5EndpointUriFactory extends org.apache.camel.support.compon private static final Set<String> PROPERTY_NAMES; private static final Set<String> SECRET_PROPERTY_NAMES; static { - Set<String> props = new HashSet<>(32); + Set<String> props = new HashSet<>(33); props.add("serverURIs"); props.add("customWebSocketHeaders"); props.add("willMqttProperties"); @@ -50,6 +50,7 @@ public class PahoMqtt5EndpointUriFactory extends org.apache.camel.support.compon props.add("sslHostnameVerifier"); props.add("topic"); props.add("persistence"); + props.add("sessionExpiryInterval"); props.add("willPayload"); props.add("willRetained"); props.add("exceptionHandler"); diff --git a/components/camel-paho-mqtt5/src/generated/resources/org/apache/camel/component/paho/mqtt5/paho-mqtt5.json b/components/camel-paho-mqtt5/src/generated/resources/org/apache/camel/component/paho/mqtt5/paho-mqtt5.json index e9e4d17..30bdd96 100644 --- a/components/camel-paho-mqtt5/src/generated/resources/org/apache/camel/component/paho/mqtt5/paho-mqtt5.json +++ b/components/camel-paho-mqtt5/src/generated/resources/org/apache/camel/component/paho/mqtt5/paho-mqtt5.json @@ -36,6 +36,7 @@ "receiveMaximum": { "kind": "property", "displayName": "Receive Maximum", "group": "common", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 65535, "configurationClass": "org.apache.camel.component.paho.mqtt5.PahoMqtt5Configuration", "configurationField": "configuration", "description": "Sets the Receive Maximum. This value represents the limit of QoS 1 and QoS 2 publications that the clie [...] "retained": { "kind": "property", "displayName": "Retained", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.paho.mqtt5.PahoMqtt5Configuration", "configurationField": "configuration", "description": "Retain option" }, "serverURIs": { "kind": "property", "displayName": "Server URIs", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.paho.mqtt5.PahoMqtt5Configuration", "configurationField": "configuration", "description": "Set a list of one or more serverURIs the client may connect to. Multiple servers can be separated by comma. Each serverURI [...] + "sessionExpiryInterval": { "kind": "property", "displayName": "Session Expiry Interval", "group": "common", "label": "", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": -1, "configurationClass": "org.apache.camel.component.paho.mqtt5.PahoMqtt5Configuration", "configurationField": "configuration", "description": "Sets the Session Expiry Interval. This value, measured in seconds, defines the maximum tim [...] "willMqttProperties": { "kind": "property", "displayName": "Will Mqtt Properties", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.eclipse.paho.mqttv5.common.packet.MqttProperties", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.paho.mqtt5.PahoMqtt5Configuration", "configurationField": "configuration", "description": "Sets the Last Will and Testament (LWT) for the connection. In the eve [...] "willPayload": { "kind": "property", "displayName": "Will Payload", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.paho.mqtt5.PahoMqtt5Configuration", "configurationField": "configuration", "description": "Sets the Last Will and Testament (LWT) for the connection. In the event that this client unexpectedly loses its connecti [...] "willQos": { "kind": "property", "displayName": "Will Qos", "group": "common", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 1, "configurationClass": "org.apache.camel.component.paho.mqtt5.PahoMqtt5Configuration", "configurationField": "configuration", "description": "Sets the Last Will and Testament (LWT) for the connection. In the event that this client unexpectedly loses its connectio [...] @@ -69,6 +70,7 @@ "receiveMaximum": { "kind": "parameter", "displayName": "Receive Maximum", "group": "common", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 65535, "configurationClass": "org.apache.camel.component.paho.mqtt5.PahoMqtt5Configuration", "configurationField": "configuration", "description": "Sets the Receive Maximum. This value represents the limit of QoS 1 and QoS 2 publications that the cli [...] "retained": { "kind": "parameter", "displayName": "Retained", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.paho.mqtt5.PahoMqtt5Configuration", "configurationField": "configuration", "description": "Retain option" }, "serverURIs": { "kind": "parameter", "displayName": "Server URIs", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.paho.mqtt5.PahoMqtt5Configuration", "configurationField": "configuration", "description": "Set a list of one or more serverURIs the client may connect to. Multiple servers can be separated by comma. Each serverUR [...] + "sessionExpiryInterval": { "kind": "parameter", "displayName": "Session Expiry Interval", "group": "common", "label": "", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": -1, "configurationClass": "org.apache.camel.component.paho.mqtt5.PahoMqtt5Configuration", "configurationField": "configuration", "description": "Sets the Session Expiry Interval. This value, measured in seconds, defines the maximum ti [...] "willMqttProperties": { "kind": "parameter", "displayName": "Will Mqtt Properties", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.eclipse.paho.mqttv5.common.packet.MqttProperties", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.paho.mqtt5.PahoMqtt5Configuration", "configurationField": "configuration", "description": "Sets the Last Will and Testament (LWT) for the connection. In the ev [...] "willPayload": { "kind": "parameter", "displayName": "Will Payload", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.paho.mqtt5.PahoMqtt5Configuration", "configurationField": "configuration", "description": "Sets the Last Will and Testament (LWT) for the connection. In the event that this client unexpectedly loses its connect [...] "willQos": { "kind": "parameter", "displayName": "Will Qos", "group": "common", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 1, "configurationClass": "org.apache.camel.component.paho.mqtt5.PahoMqtt5Configuration", "configurationField": "configuration", "description": "Sets the Last Will and Testament (LWT) for the connection. In the event that this client unexpectedly loses its connecti [...] diff --git a/components/camel-paho-mqtt5/src/main/docs/paho-mqtt5-component.adoc b/components/camel-paho-mqtt5/src/main/docs/paho-mqtt5-component.adoc index 47abfe9..70e193b 100644 --- a/components/camel-paho-mqtt5/src/main/docs/paho-mqtt5-component.adoc +++ b/components/camel-paho-mqtt5/src/main/docs/paho-mqtt5-component.adoc @@ -78,7 +78,7 @@ The following two sections lists all the options, firstly for the component foll == Component Options -The Paho MQTT 5 component supports 31 options, which are listed below. +The Paho MQTT 5 component supports 32 options, which are listed below. @@ -99,6 +99,7 @@ The Paho MQTT 5 component supports 31 options, which are listed below. | *receiveMaximum* (common) | Sets the Receive Maximum. This value represents the limit of QoS 1 and QoS 2 publications that the client is willing to process concurrently. There is no mechanism to limit the number of QoS 0 publications that the Server might try to send. The default value is 65535 | 65535 | int | *retained* (common) | Retain option | false | boolean | *serverURIs* (common) | Set a list of one or more serverURIs the client may connect to. Multiple servers can be separated by comma. Each serverURI specifies the address of a server that the client may connect to. Two types of connection are supported tcp:// for a TCP connection and ssl:// for a TCP connection secured by SSL/TLS. For example: tcp://localhost:1883 ssl://localhost:8883 If the port is not specified, it will default to 1883 for tcp:// URIs, and 8883 for ssl:// URIs. If serv [...] +| *sessionExpiryInterval* (common) | Sets the Session Expiry Interval. This value, measured in seconds, defines the maximum time that the broker will maintain the session for once the client disconnects. Clients should only connect with a long Session Expiry interval if they intend to connect to the server at some later point in time. By default this value is -1 and so will not be sent, in this case, the session will not expire. If a 0 is sent, the session will end immediately once the N [...] | *willMqttProperties* (common) | Sets the Last Will and Testament (LWT) for the connection. In the event that this client unexpectedly loses its connection to the server, the server will publish a message to itself using the supplied details. The MQTT properties set for the message. | | MqttProperties | *willPayload* (common) | Sets the Last Will and Testament (LWT) for the connection. In the event that this client unexpectedly loses its connection to the server, the server will publish a message to itself using the supplied details. The byte payload for the message. | | String | *willQos* (common) | Sets the Last Will and Testament (LWT) for the connection. In the event that this client unexpectedly loses its connection to the server, the server will publish a message to itself using the supplied details. The quality of service to publish the message at (0, 1 or 2). | 1 | int @@ -140,7 +141,7 @@ with the following path and query parameters: |=== -=== Query Parameters (31 parameters): +=== Query Parameters (32 parameters): [width="100%",cols="2,5,^1,2",options="header"] @@ -159,6 +160,7 @@ with the following path and query parameters: | *receiveMaximum* (common) | Sets the Receive Maximum. This value represents the limit of QoS 1 and QoS 2 publications that the client is willing to process concurrently. There is no mechanism to limit the number of QoS 0 publications that the Server might try to send. The default value is 65535 | 65535 | int | *retained* (common) | Retain option | false | boolean | *serverURIs* (common) | Set a list of one or more serverURIs the client may connect to. Multiple servers can be separated by comma. Each serverURI specifies the address of a server that the client may connect to. Two types of connection are supported tcp:// for a TCP connection and ssl:// for a TCP connection secured by SSL/TLS. For example: tcp://localhost:1883 ssl://localhost:8883 If the port is not specified, it will default to 1883 for tcp:// URIs, and 8883 for ssl:// URIs. If serv [...] +| *sessionExpiryInterval* (common) | Sets the Session Expiry Interval. This value, measured in seconds, defines the maximum time that the broker will maintain the session for once the client disconnects. Clients should only connect with a long Session Expiry interval if they intend to connect to the server at some later point in time. By default this value is -1 and so will not be sent, in this case, the session will not expire. If a 0 is sent, the session will end immediately once the N [...] | *willMqttProperties* (common) | Sets the Last Will and Testament (LWT) for the connection. In the event that this client unexpectedly loses its connection to the server, the server will publish a message to itself using the supplied details. The MQTT properties set for the message. | | MqttProperties | *willPayload* (common) | Sets the Last Will and Testament (LWT) for the connection. In the event that this client unexpectedly loses its connection to the server, the server will publish a message to itself using the supplied details. The byte payload for the message. | | String | *willQos* (common) | Sets the Last Will and Testament (LWT) for the connection. In the event that this client unexpectedly loses its connection to the server, the server will publish a message to itself using the supplied details. The quality of service to publish the message at (0, 1 or 2). | 1 | int diff --git a/components/camel-paho-mqtt5/src/main/java/org/apache/camel/component/paho/mqtt5/PahoMqtt5Configuration.java b/components/camel-paho-mqtt5/src/main/java/org/apache/camel/component/paho/mqtt5/PahoMqtt5Configuration.java index 83386c4..d85ba38 100644 --- a/components/camel-paho-mqtt5/src/main/java/org/apache/camel/component/paho/mqtt5/PahoMqtt5Configuration.java +++ b/components/camel-paho-mqtt5/src/main/java/org/apache/camel/component/paho/mqtt5/PahoMqtt5Configuration.java @@ -86,6 +86,8 @@ public class PahoMqtt5Configuration implements Cloneable { private Map<String, String> customWebSocketHeaders; @UriParam(label = "advanced", defaultValue = "1") private int executorServiceTimeout = 1; + @UriParam(defaultValue = "-1") + private long sessionExpiryInterval = -1; public String getClientId() { return clientId; @@ -527,6 +529,25 @@ public class PahoMqtt5Configuration implements Cloneable { this.executorServiceTimeout = executorServiceTimeout; } + public long getSessionExpiryInterval() { + return sessionExpiryInterval; + } + + /** + * Sets the Session Expiry Interval. + * + * This value, measured in seconds, defines the maximum time that the broker will maintain the session for once the + * client disconnects. Clients should only connect with a long Session Expiry interval if they intend to connect to + * the server at some later point in time. + * + * By default this value is -1 and so will not be sent, in this case, the session will not expire. If a 0 is sent, + * the session will end immediately once the Network Connection is closed. When the client has determined that it + * has no longer any use for the session, it should disconnect with a Session Expiry Interval set to 0. + */ + public void setSessionExpiryInterval(long sessionExpiryInterval) { + this.sessionExpiryInterval = sessionExpiryInterval; + } + public PahoMqtt5Configuration copy() { try { return (PahoMqtt5Configuration) clone(); diff --git a/components/camel-paho-mqtt5/src/main/java/org/apache/camel/component/paho/mqtt5/PahoMqtt5Endpoint.java b/components/camel-paho-mqtt5/src/main/java/org/apache/camel/component/paho/mqtt5/PahoMqtt5Endpoint.java index 725df0d..9990889 100644 --- a/components/camel-paho-mqtt5/src/main/java/org/apache/camel/component/paho/mqtt5/PahoMqtt5Endpoint.java +++ b/components/camel-paho-mqtt5/src/main/java/org/apache/camel/component/paho/mqtt5/PahoMqtt5Endpoint.java @@ -114,6 +114,9 @@ public class PahoMqtt5Endpoint extends DefaultEndpoint { if (config.getServerURIs() != null) { options.setServerURIs(config.getServerURIs().split(",")); } + if (config.getSessionExpiryInterval() >= 0) { + options.setSessionExpiryInterval(config.getSessionExpiryInterval()); + } return options; } diff --git a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/PahoMqtt5ComponentBuilderFactory.java b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/PahoMqtt5ComponentBuilderFactory.java index 29aa8b8..c091150 100644 --- a/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/PahoMqtt5ComponentBuilderFactory.java +++ b/core/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/PahoMqtt5ComponentBuilderFactory.java @@ -326,6 +326,31 @@ public interface PahoMqtt5ComponentBuilderFactory { return this; } /** + * Sets the Session Expiry Interval. This value, measured in seconds, + * defines the maximum time that the broker will maintain the session + * for once the client disconnects. Clients should only connect with a + * long Session Expiry interval if they intend to connect to the server + * at some later point in time. By default this value is -1 and so will + * not be sent, in this case, the session will not expire. If a 0 is + * sent, the session will end immediately once the Network Connection is + * closed. When the client has determined that it has no longer any use + * for the session, it should disconnect with a Session Expiry Interval + * set to 0. + * + * The option is a: <code>long</code> type. + * + * Default: -1 + * Group: common + * + * @param sessionExpiryInterval the value to set + * @return the dsl builder + */ + default PahoMqtt5ComponentBuilder sessionExpiryInterval( + long sessionExpiryInterval) { + doSetProperty("sessionExpiryInterval", sessionExpiryInterval); + return this; + } + /** * Sets the Last Will and Testament (LWT) for the connection. In the * event that this client unexpectedly loses its connection to the * server, the server will publish a message to itself using the @@ -708,6 +733,7 @@ public interface PahoMqtt5ComponentBuilderFactory { case "receiveMaximum": getOrCreateConfiguration((PahoMqtt5Component) component).setReceiveMaximum((int) value); return true; case "retained": getOrCreateConfiguration((PahoMqtt5Component) component).setRetained((boolean) value); return true; case "serverURIs": getOrCreateConfiguration((PahoMqtt5Component) component).setServerURIs((java.lang.String) value); return true; + case "sessionExpiryInterval": getOrCreateConfiguration((PahoMqtt5Component) component).setSessionExpiryInterval((long) value); return true; case "willMqttProperties": getOrCreateConfiguration((PahoMqtt5Component) component).setWillMqttProperties((org.eclipse.paho.mqttv5.common.packet.MqttProperties) value); return true; case "willPayload": getOrCreateConfiguration((PahoMqtt5Component) component).setWillPayload((java.lang.String) value); return true; case "willQos": getOrCreateConfiguration((PahoMqtt5Component) component).setWillQos((int) value); return true; diff --git a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/PahoMqtt5EndpointBuilderFactory.java b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/PahoMqtt5EndpointBuilderFactory.java index 6351f3a..bacaa6a 100644 --- a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/PahoMqtt5EndpointBuilderFactory.java +++ b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/PahoMqtt5EndpointBuilderFactory.java @@ -483,6 +483,56 @@ public interface PahoMqtt5EndpointBuilderFactory { return this; } /** + * Sets the Session Expiry Interval. This value, measured in seconds, + * defines the maximum time that the broker will maintain the session + * for once the client disconnects. Clients should only connect with a + * long Session Expiry interval if they intend to connect to the server + * at some later point in time. By default this value is -1 and so will + * not be sent, in this case, the session will not expire. If a 0 is + * sent, the session will end immediately once the Network Connection is + * closed. When the client has determined that it has no longer any use + * for the session, it should disconnect with a Session Expiry Interval + * set to 0. + * + * The option is a: <code>long</code> type. + * + * Default: -1 + * Group: common + * + * @param sessionExpiryInterval the value to set + * @return the dsl builder + */ + default PahoMqtt5EndpointConsumerBuilder sessionExpiryInterval( + long sessionExpiryInterval) { + doSetProperty("sessionExpiryInterval", sessionExpiryInterval); + return this; + } + /** + * Sets the Session Expiry Interval. This value, measured in seconds, + * defines the maximum time that the broker will maintain the session + * for once the client disconnects. Clients should only connect with a + * long Session Expiry interval if they intend to connect to the server + * at some later point in time. By default this value is -1 and so will + * not be sent, in this case, the session will not expire. If a 0 is + * sent, the session will end immediately once the Network Connection is + * closed. When the client has determined that it has no longer any use + * for the session, it should disconnect with a Session Expiry Interval + * set to 0. + * + * The option will be converted to a <code>long</code> type. + * + * Default: -1 + * Group: common + * + * @param sessionExpiryInterval the value to set + * @return the dsl builder + */ + default PahoMqtt5EndpointConsumerBuilder sessionExpiryInterval( + String sessionExpiryInterval) { + doSetProperty("sessionExpiryInterval", sessionExpiryInterval); + return this; + } + /** * Sets the Last Will and Testament (LWT) for the connection. In the * event that this client unexpectedly loses its connection to the * server, the server will publish a message to itself using the @@ -1555,6 +1605,56 @@ public interface PahoMqtt5EndpointBuilderFactory { return this; } /** + * Sets the Session Expiry Interval. This value, measured in seconds, + * defines the maximum time that the broker will maintain the session + * for once the client disconnects. Clients should only connect with a + * long Session Expiry interval if they intend to connect to the server + * at some later point in time. By default this value is -1 and so will + * not be sent, in this case, the session will not expire. If a 0 is + * sent, the session will end immediately once the Network Connection is + * closed. When the client has determined that it has no longer any use + * for the session, it should disconnect with a Session Expiry Interval + * set to 0. + * + * The option is a: <code>long</code> type. + * + * Default: -1 + * Group: common + * + * @param sessionExpiryInterval the value to set + * @return the dsl builder + */ + default PahoMqtt5EndpointProducerBuilder sessionExpiryInterval( + long sessionExpiryInterval) { + doSetProperty("sessionExpiryInterval", sessionExpiryInterval); + return this; + } + /** + * Sets the Session Expiry Interval. This value, measured in seconds, + * defines the maximum time that the broker will maintain the session + * for once the client disconnects. Clients should only connect with a + * long Session Expiry interval if they intend to connect to the server + * at some later point in time. By default this value is -1 and so will + * not be sent, in this case, the session will not expire. If a 0 is + * sent, the session will end immediately once the Network Connection is + * closed. When the client has determined that it has no longer any use + * for the session, it should disconnect with a Session Expiry Interval + * set to 0. + * + * The option will be converted to a <code>long</code> type. + * + * Default: -1 + * Group: common + * + * @param sessionExpiryInterval the value to set + * @return the dsl builder + */ + default PahoMqtt5EndpointProducerBuilder sessionExpiryInterval( + String sessionExpiryInterval) { + doSetProperty("sessionExpiryInterval", sessionExpiryInterval); + return this; + } + /** * Sets the Last Will and Testament (LWT) for the connection. In the * event that this client unexpectedly loses its connection to the * server, the server will publish a message to itself using the @@ -2557,6 +2657,56 @@ public interface PahoMqtt5EndpointBuilderFactory { return this; } /** + * Sets the Session Expiry Interval. This value, measured in seconds, + * defines the maximum time that the broker will maintain the session + * for once the client disconnects. Clients should only connect with a + * long Session Expiry interval if they intend to connect to the server + * at some later point in time. By default this value is -1 and so will + * not be sent, in this case, the session will not expire. If a 0 is + * sent, the session will end immediately once the Network Connection is + * closed. When the client has determined that it has no longer any use + * for the session, it should disconnect with a Session Expiry Interval + * set to 0. + * + * The option is a: <code>long</code> type. + * + * Default: -1 + * Group: common + * + * @param sessionExpiryInterval the value to set + * @return the dsl builder + */ + default PahoMqtt5EndpointBuilder sessionExpiryInterval( + long sessionExpiryInterval) { + doSetProperty("sessionExpiryInterval", sessionExpiryInterval); + return this; + } + /** + * Sets the Session Expiry Interval. This value, measured in seconds, + * defines the maximum time that the broker will maintain the session + * for once the client disconnects. Clients should only connect with a + * long Session Expiry interval if they intend to connect to the server + * at some later point in time. By default this value is -1 and so will + * not be sent, in this case, the session will not expire. If a 0 is + * sent, the session will end immediately once the Network Connection is + * closed. When the client has determined that it has no longer any use + * for the session, it should disconnect with a Session Expiry Interval + * set to 0. + * + * The option will be converted to a <code>long</code> type. + * + * Default: -1 + * Group: common + * + * @param sessionExpiryInterval the value to set + * @return the dsl builder + */ + default PahoMqtt5EndpointBuilder sessionExpiryInterval( + String sessionExpiryInterval) { + doSetProperty("sessionExpiryInterval", sessionExpiryInterval); + return this; + } + /** * Sets the Last Will and Testament (LWT) for the connection. In the * event that this client unexpectedly loses its connection to the * server, the server will publish a message to itself using the diff --git a/docs/components/modules/ROOT/pages/paho-mqtt5-component.adoc b/docs/components/modules/ROOT/pages/paho-mqtt5-component.adoc index 9a5ef77..221e489 100644 --- a/docs/components/modules/ROOT/pages/paho-mqtt5-component.adoc +++ b/docs/components/modules/ROOT/pages/paho-mqtt5-component.adoc @@ -80,7 +80,7 @@ The following two sections lists all the options, firstly for the component foll == Component Options -The Paho MQTT 5 component supports 31 options, which are listed below. +The Paho MQTT 5 component supports 32 options, which are listed below. @@ -101,6 +101,7 @@ The Paho MQTT 5 component supports 31 options, which are listed below. | *receiveMaximum* (common) | Sets the Receive Maximum. This value represents the limit of QoS 1 and QoS 2 publications that the client is willing to process concurrently. There is no mechanism to limit the number of QoS 0 publications that the Server might try to send. The default value is 65535 | 65535 | int | *retained* (common) | Retain option | false | boolean | *serverURIs* (common) | Set a list of one or more serverURIs the client may connect to. Multiple servers can be separated by comma. Each serverURI specifies the address of a server that the client may connect to. Two types of connection are supported tcp:// for a TCP connection and ssl:// for a TCP connection secured by SSL/TLS. For example: tcp://localhost:1883 ssl://localhost:8883 If the port is not specified, it will default to 1883 for tcp:// URIs, and 8883 for ssl:// URIs. If serv [...] +| *sessionExpiryInterval* (common) | Sets the Session Expiry Interval. This value, measured in seconds, defines the maximum time that the broker will maintain the session for once the client disconnects. Clients should only connect with a long Session Expiry interval if they intend to connect to the server at some later point in time. By default this value is -1 and so will not be sent, in this case, the session will not expire. If a 0 is sent, the session will end immediately once the N [...] | *willMqttProperties* (common) | Sets the Last Will and Testament (LWT) for the connection. In the event that this client unexpectedly loses its connection to the server, the server will publish a message to itself using the supplied details. The MQTT properties set for the message. | | MqttProperties | *willPayload* (common) | Sets the Last Will and Testament (LWT) for the connection. In the event that this client unexpectedly loses its connection to the server, the server will publish a message to itself using the supplied details. The byte payload for the message. | | String | *willQos* (common) | Sets the Last Will and Testament (LWT) for the connection. In the event that this client unexpectedly loses its connection to the server, the server will publish a message to itself using the supplied details. The quality of service to publish the message at (0, 1 or 2). | 1 | int @@ -142,7 +143,7 @@ with the following path and query parameters: |=== -=== Query Parameters (31 parameters): +=== Query Parameters (32 parameters): [width="100%",cols="2,5,^1,2",options="header"] @@ -161,6 +162,7 @@ with the following path and query parameters: | *receiveMaximum* (common) | Sets the Receive Maximum. This value represents the limit of QoS 1 and QoS 2 publications that the client is willing to process concurrently. There is no mechanism to limit the number of QoS 0 publications that the Server might try to send. The default value is 65535 | 65535 | int | *retained* (common) | Retain option | false | boolean | *serverURIs* (common) | Set a list of one or more serverURIs the client may connect to. Multiple servers can be separated by comma. Each serverURI specifies the address of a server that the client may connect to. Two types of connection are supported tcp:// for a TCP connection and ssl:// for a TCP connection secured by SSL/TLS. For example: tcp://localhost:1883 ssl://localhost:8883 If the port is not specified, it will default to 1883 for tcp:// URIs, and 8883 for ssl:// URIs. If serv [...] +| *sessionExpiryInterval* (common) | Sets the Session Expiry Interval. This value, measured in seconds, defines the maximum time that the broker will maintain the session for once the client disconnects. Clients should only connect with a long Session Expiry interval if they intend to connect to the server at some later point in time. By default this value is -1 and so will not be sent, in this case, the session will not expire. If a 0 is sent, the session will end immediately once the N [...] | *willMqttProperties* (common) | Sets the Last Will and Testament (LWT) for the connection. In the event that this client unexpectedly loses its connection to the server, the server will publish a message to itself using the supplied details. The MQTT properties set for the message. | | MqttProperties | *willPayload* (common) | Sets the Last Will and Testament (LWT) for the connection. In the event that this client unexpectedly loses its connection to the server, the server will publish a message to itself using the supplied details. The byte payload for the message. | | String | *willQos* (common) | Sets the Last Will and Testament (LWT) for the connection. In the event that this client unexpectedly loses its connection to the server, the server will publish a message to itself using the supplied details. The quality of service to publish the message at (0, 1 or 2). | 1 | int