Class InboundAdapter
java.lang.Object
energy.eddie.aiida.adapters.datasource.DataSourceAdapter<InboundDataSource>
energy.eddie.aiida.adapters.datasource.MqttDataSourceAdapter<InboundDataSource>
energy.eddie.aiida.adapters.datasource.inbound.InboundAdapter
- All Implemented Interfaces:
AutoCloseable,org.eclipse.paho.mqttv5.client.MqttCallback,org.springframework.boot.actuate.health.HealthContributor,org.springframework.boot.actuate.health.HealthIndicator
-
Field Summary
Fields inherited from class energy.eddie.aiida.adapters.datasource.MqttDataSourceAdapter
asyncClientFields inherited from class energy.eddie.aiida.adapters.datasource.DataSourceAdapter
dataSource, healthSink, recordSink -
Constructor Summary
ConstructorsConstructorDescriptionInboundAdapter(InboundDataSource dataSource, MqttConfiguration mqttConfiguration) Creates the adapter for the inbound data source. -
Method Summary
Modifier and TypeMethodDescriptionprotected org.eclipse.paho.mqttv5.client.MqttConnectionOptionsreactor.core.publisher.Flux<InboundRecord> voidmessageArrived(String topic, org.eclipse.paho.mqttv5.common.MqttMessage message) MQTT callback function that is called when a new message from the broker is received.Methods inherited from class energy.eddie.aiida.adapters.datasource.MqttDataSourceAdapter
authPacketArrived, close, connectComplete, deliveryComplete, disconnected, health, mqttErrorOccurred, setKeepAliveInterval, start, subscribeToHealthTopicMethods inherited from class energy.eddie.aiida.adapters.datasource.DataSourceAdapter
create, dataSource, emitAiidaRecordMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.boot.actuate.health.HealthIndicator
getHealth
-
Constructor Details
-
InboundAdapter
Creates the adapter for the inbound data source. It connects to the specified MQTT broker and expects that the EP publishes its messages on the specified topic.- Parameters:
dataSource- The entity of the data source.
-
-
Method Details
-
messageArrived
MQTT callback function that is called when a new message from the broker is received. Will store the message in plaintext format in the database, as this datasource is not designed to parse the messages.- Parameters:
topic- Name of the topic, the message was published to.message- The actual message.
-
inboundRecordFlux
-
createConnectOptions
protected org.eclipse.paho.mqttv5.client.MqttConnectionOptions createConnectOptions()- Overrides:
createConnectOptionsin classMqttDataSourceAdapter<InboundDataSource>
-