Class MqttFacade
java.lang.Object
org.frankframework.extensions.mqtt.MqttFacade
- All Implemented Interfaces:
FrankElement
,HasApplicationContext
,HasName
,HasPhysicalDestination
,IConfigurable
,IScopeProvider
,NameAware
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
- Direct Known Subclasses:
MqttListener
,MqttSender
public abstract class MqttFacade
extends Object
implements HasPhysicalDestination, IConfigurable, NameAware, FrankElement
Requires a resource to be configured. Example resources.yml:
The clientId is automatically determined from
Inbound and outbound messages are persisted while they are in flight to prevent data loss. The default is an in memory store, but the persistenceDirectory flag can be used to set the disk storage location.
mqtt:
- name: "my-connection"
type: "org.frankframework.jdbc.datasource.MqttClientSettings"
url: "tcp://host:port"
properties:
automaticReconnect: "true"
cleanSession: "false"
The clientId is automatically determined from
transactionmanager.uid
, but can optionally be overwritten. Be aware that the clientId must be unique
for each instance of the framework.
Inbound and outbound messages are persisted while they are in flight to prevent data loss. The default is an in memory store, but the persistenceDirectory flag can be used to set the disk storage location.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Configure this component.protected String
void
setCharset
(String charset) character encoding of received messagesvoid
The functional name of the object.void
setQos
(int qos) void
setResourceName
(String resourceName) void
toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.context.ApplicationContextAware
setApplicationContext
Methods inherited from interface org.frankframework.core.HasApplicationContext
getApplicationContext, getConfigurationClassLoader
Methods inherited from interface org.frankframework.core.HasPhysicalDestination
getDomain
-
Field Details
-
client
protected org.eclipse.paho.client.mqttv3.MqttClient client
-
-
Constructor Details
-
MqttFacade
public MqttFacade()
-
-
Method Details
-
configure
Description copied from interface:IConfigurable
Configure this component.configure()
is called once at startup of the framework in the configure method of the owner of thisIConfigurable
. Purpose of this method is to check whether the static configuration of the object is correct. As much as possible class-instantiating should take place in theconfigure()
, to improve performance.In the case of a container, this will propagate the configure signal to all components that apply.
- Specified by:
configure
in interfaceIConfigurable
- Throws:
ConfigurationException
- in case it was not able to configure the component.
-
getPhysicalDestinationName
- Specified by:
getPhysicalDestinationName
in interfaceHasPhysicalDestination
-
toString
-
setName
Description copied from interface:NameAware
The functional name of the object. -
getLogPrefix
-
setTopic
-
setQos
public void setQos(int qos) see MqttClient(java.lang.String serverURI, java.lang.String clientId, MqttClientPersistence persistence)- Default value
- 2
-
setCharset
character encoding of received messages- Default value
- UTF-8
-
setResourceName
-