クラス AbstractMqttMessageDrivenChannelAdapter<T extends com.hivemq.client.mqtt.MqttClient>
java.lang.ObjectSE
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.endpoint.AbstractEndpoint
org.springframework.integration.endpoint.MessageProducerSupport
org.springframework.integration.mqtt.client.inbound.AbstractMqttMessageDrivenChannelAdapter<T>
- 型パラメーター:
T- MQTT クライアントの種類
- 実装済みのインターフェース一覧:
Aware, BeanFactoryAware, BeanNameAware, DisposableBean, InitializingBean, SmartInitializingSingleton, ApplicationContextAware, ApplicationEventPublisherAware, Lifecycle, Phased, SmartLifecycle, ComponentSourceAware, ExpressionCapable, MessageProducer, IntegrationPattern, ClientManager.ConnectCallback, NamedComponent, IntegrationInboundManagement, IntegrationManagement, ManageableLifecycle, ManageableSmartLifecycle, TrackableComponent
public abstract class AbstractMqttMessageDrivenChannelAdapter<T extends com.hivemq.client.mqtt.MqttClient>
extends MessageProducerSupport
implements ApplicationEventPublisherAware, ClientManager.ConnectCallback
MQTT メッセージ駆動型チャネルアダプターの抽象クラス。
- 導入:
- 7.2
- 作成者:
- Jiandong Ma, WooSeung Kim
ネストされたクラスの概要
インターフェース IntegrationManagement から継承されたネストクラス / インターフェース
IntegrationManagement.ManagementOverridesフィールド概要
フィールド修飾子と型フィールド説明protected final AtomicBooleanSEprotected final AtomicBooleanSEprotected SmartMessageConverterprotected final ClientManager<T> クラス AbstractEndpoint から継承されたフィールド
lifecycleLockクラス IntegrationObjectSupport から継承されたフィールド
EXPRESSION_PARSER, loggerインターフェース IntegrationManagement から継承されたフィールド
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEインターフェース SmartLifecycle から継承されたフィールド
DEFAULT_PHASEコンストラクター概要
コンストラクター修飾子コンストラクター説明protectedAbstractMqttMessageDrivenChannelAdapter(ClientManager<T> mqttClientManager) protectedAbstractMqttMessageDrivenChannelAdapter(ClientManager<T> mqttClientManager, StringSE... topics) 方法の概要
修飾子と型メソッド説明voiddestroy()protected ApplicationEventPublisherprotected Tprotected @Nullable ExecutorSEprotected SmartMessageConverterprotected ClassSE<?> protected com.hivemq.client.mqtt.datatypes.MqttQosgetQos()protected StringSE @Nullable[]booleanmqttClient が接続されているかどうかを返します。protected booleanprotected voidonInit()サブクラスは、初期化ロジック用にこれを実装できます。protected voidsendReceivedMessage(ObjectSE mqttPublish, SupplierSE<Message<?>> messageSupplier, SimpleAcknowledgment acknowledgment, FunctionSE<RuntimeExceptionSE, MqttIntegrationEvent> conversionFailedEventFactory) 受信した MQTT パブリッシュから作成したメッセージを送信します。voidsetApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) voidsetExecutor(ExecutorSE executor) メッセージコールバックが実行されるエグゼキュータを設定します。voidsetManualAck(boolean manualAck) 発行メッセージを手動で確認するかどうかを設定します。voidsetMessageConverter(SmartMessageConverter messageConverter) messageConverter を設定して、ペイロードを期待される payloadType に変換します。voidsetPayloadType(ClassSE<?> payloadType) MQTT メッセージからの変換後に生成するターゲットメッセージペイロードの型を設定します。voidsetQos(com.hivemq.client.mqtt.datatypes.MqttQos qos) トピックの QoS を設定するクラス MessageProducerSupport から継承されたメソッド
afterSingletonsInstantiated, buildErrorMessage, doStart, doStop, getErrorChannel, getErrorMessageAttributes, getErrorMessageStrategy, getIntegrationPatternType, getMessagingTemplate, getOutputChannel, getOutputChannelName, getRequiredOutputChannel, isObserved, registerObservationRegistry, sendErrorMessageIfNecessary, sendMessage, setErrorChannel, setErrorChannelName, setErrorMessageStrategy, setObservationConvention, setOutputChannel, setOutputChannelName, setSendTimeout, setShouldTrack, subscribeToPublisherクラス AbstractEndpoint から継承されたメソッド
doStop, getPhase, getRole, isActive, isAutoStartup, isRunning, setAutoStartup, setPhase, setRole, start, stop, stopクラス IntegrationObjectSupport から継承されたメソッド
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentDescription, getComponentName, getComponentSource, getConversionService, getExpression, getIntegrationProperties, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentDescription, setComponentName, setComponentSource, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringクラス ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, wait, waitSE, waitSEインターフェース ClientManager.ConnectCallback から継承されたメソッド
onClientConnectedインターフェース IntegrationManagement から継承されたメソッド
getManagedName, getManagedType, getOverrides, getThisAs, isLoggingEnabled, registerMetricsCaptor, setLoggingEnabled, setManagedName, setManagedTypeインターフェース NamedComponent から継承されたメソッド
getBeanName, getComponentNameインターフェース SmartLifecycle から継承されたメソッド
isPauseable, pause, restart
フィールドの詳細
mqttClientManager
isSubscribing
isSubscribed
messageConverter
コンストラクターの詳細
AbstractMqttMessageDrivenChannelAdapter
AbstractMqttMessageDrivenChannelAdapter
protected AbstractMqttMessageDrivenChannelAdapter(ClientManager<T> mqttClientManager, StringSE... topics)
方法の詳細
setApplicationEventPublisher
- 次で指定:
- インターフェース
ApplicationEventPublisherAware内のsetApplicationEventPublisher
getApplicationEventPublisher
onInit
protected void onInit()クラスからコピーされた説明:IntegrationObjectSupportサブクラスは、初期化ロジック用にこれを実装できます。- オーバーライド:
- クラス
MessageProducerSupportのonInit
destroy
public void destroy()- 次で指定:
- インターフェース
DisposableBean内のdestroy - 次で指定:
- インターフェース
IntegrationManagement内のdestroy - オーバーライド:
- クラス
AbstractEndpointのdestroy
getClient
setMessageConverter
messageConverter を設定して、ペイロードを期待される payloadType に変換します。- パラメーター:
messageConverter- messageConverter
getMessageConverter
getTopics
setQos
public void setQos(com.hivemq.client.mqtt.datatypes.MqttQos qos) トピックの QoS を設定する- パラメーター:
qos- QoS 値
getQos
protected com.hivemq.client.mqtt.datatypes.MqttQos getQos()setManualAck
public void setManualAck(boolean manualAck) 発行メッセージを手動で確認するかどうかを設定します。- パラメーター:
manualAck- 手動承認の場合に当てはまります。
isManualAck
protected boolean isManualAck()setExecutor
getExecutor
setPayloadType
MQTT メッセージから変換後に生成するターゲットメッセージペイロードの型を設定します。デフォルトはbyte[].classです。v5 の場合はMqtt5Publish、MQTT メッセージ全体をペイロードとして生成する場合はMqtt3Publishに設定できます。- パラメーター:
payloadType- MQTT メッセージを変換するために期待されるペイロード型。
getPayloadType
isConnected
public boolean isConnected()mqttClient が接続されているかどうかを返します。- 戻り値:
- mqttClient が接続されているかどうか。
sendReceivedMessage
protected void sendReceivedMessage(ObjectSE mqttPublish, SupplierSE<Message<?>> messageSupplier, SimpleAcknowledgment acknowledgment, FunctionSE<RuntimeExceptionSE, MqttIntegrationEvent> conversionFailedEventFactory) 受信した MQTT パブリッシュから構築したメッセージを送信します。サブスクリプションが終了するため、MQTT クライアントのコールバックで例外をスローしてはなりません。メッセージを構築できない場合は、エラーがログに記録され、手動確認モードでパブリッシュが確認され、変換失敗イベントが発行されます。ダウンストリームのエラーは、エラーチャネルが存在する場合はそこに送信されます。存在しない場合、またはエラーフローが失敗した場合は、エラーがログに記録されます。- パラメーター:
mqttPublish- 受信した MQTT パブリッシュ。messageSupplier- 送信するメッセージの供給元。acknowledgment- 受信した MQTT パブリッシュに対する確認応答。conversionFailedEventFactory- メッセージを作成できない場合にイベントが発信するファクトリ。
getComponentType
- 次で指定:
- インターフェース
NamedComponent内のgetComponentType - オーバーライド:
- クラス
MessageProducerSupportのgetComponentType