Class InboundAdapter

All Implemented Interfaces:
AutoCloseable, org.eclipse.paho.mqttv5.client.MqttCallback, org.springframework.boot.actuate.health.HealthContributor, org.springframework.boot.actuate.health.HealthIndicator

public class InboundAdapter extends MqttDataSourceAdapter<InboundDataSource>
  • Constructor Details

    • InboundAdapter

      public InboundAdapter(InboundDataSource dataSource, MqttConfiguration mqttConfiguration)
      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

      public void messageArrived(String topic, org.eclipse.paho.mqttv5.common.MqttMessage message)
      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

      public reactor.core.publisher.Flux<InboundRecord> inboundRecordFlux()
    • createConnectOptions

      protected org.eclipse.paho.mqttv5.client.MqttConnectionOptions createConnectOptions()
      Overrides:
      createConnectOptions in class MqttDataSourceAdapter<InboundDataSource>