クラス AbstractMqttMessageHandler<T,C>
java.lang.ObjectSE
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.handler.MessageHandlerSupport
org.springframework.integration.handler.AbstractMessageHandler
org.springframework.integration.mqtt.outbound.AbstractMqttMessageHandler<T,C>
- 型パラメーター:
T- MQTT クライアントの種類C- MQTT 接続オプション型 (v5 または v3)
- 実装済みのインターフェース一覧:
org.reactivestreams.Subscriber<Message<?>>, Aware, BeanFactoryAware, BeanNameAware, DisposableBean, InitializingBean, ApplicationContextAware, ApplicationEventPublisherAware, Lifecycle, Ordered, ComponentSourceAware, ExpressionCapable, Orderable, IntegrationPattern, NamedComponent, IntegrationManagement, ManageableLifecycle, TrackableComponent, MessageHandler, reactor.core.CoreSubscriber<Message<?>>
- 既知の直属サブクラス
MqttPahoMessageHandler, Mqttv5PahoMessageHandler
public abstract class AbstractMqttMessageHandler<T,C>
extends AbstractMessageHandler
implements ManageableLifecycle, ApplicationEventPublisherAware
MQTT 送信・チャネルアダプターの抽象クラス。
- 導入:
- 4.0
- 作成者:
- Gary Russell, Artem Bilan, Artem Vozhdayenko
ネストされたクラスの概要
インターフェース IntegrationManagement から継承されたネストクラス / インターフェース
IntegrationManagement.ManagementOverridesフィールド概要
フィールド修飾子と型フィールド説明static final longミリ秒単位のデフォルトの完了タイムアウト。static final longミリ秒単位のデフォルトの切断完了タイムアウト。protected final LockSEクラス IntegrationObjectSupport から継承されたフィールド
EXPRESSION_PARSER, loggerインターフェース IntegrationManagement から継承されたフィールド
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEインターフェース Ordered から継承されたフィールド
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCEコンストラクター概要
コンストラクターコンストラクター説明AbstractMqttMessageHandler(@Nullable StringSE url, StringSE clientId) AbstractMqttMessageHandler(ClientManager<T, C> clientManager) 方法の概要
修飾子と型メソッド説明protected abstract voiddoStart()protected abstract voiddoStop()protected ApplicationEventPublisherintクライアントが接続されるたびに増加します。protected @Nullable ClientManager<T, C> protected longprotected MessageConverterprotected intprotected booleanprotected @Nullable StringSEprotected longprotected MessageProcessor<IntegerSE> protected MessageProcessor<BooleanSE> protected MessageProcessor<StringSE> protected @Nullable StringSEgetUrl()protected voidhandleMessageInternal(Message<?> message) protected voidprotected booleanisAsync()booleanprotected voidmessageSentEvent(Message<?> message, StringSE topic, int messageId) protected voidonInit()サブクラスは、初期化ロジック用にこれを実装できます。protected abstract voidprotected voidsendDeliveryCompleteEvent(int messageId) protected voidsendFailedDeliveryEvent(int messageId, ThrowableSE exception) voidsetApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) voidsetAsync(boolean async) メッセージを送信するときにブロックしない場合は、true に設定します。voidsetAsyncEvents(boolean asyncEvents) setAsync(boolean)が true の場合、これを true に設定すると、MqttMessageSentEventおよびMqttMessageDeliveredEventの発行が発行されます。voidsetCompletionTimeout(long completionTimeout) 非同期操作の完了タイムアウトを設定します。voidsetConverter(MessageConverter converter) 使用するメッセージコンバーターを設定します。これが指定されている場合、アダプターの QoS および保持されている設定は無視されます。voidsetDefaultQos(int defaultQos) qosExpressionが null と評価される場合、メッセージの qos を設定します。voidsetDefaultRetained(boolean defaultRetained) retainedExpressionが null と評価された場合、メッセージの保持ブール値を設定します。voidsetDefaultTopic(StringSE defaultTopic) topicExpressionが `null` と評価された場合にメッセージが公開されるトピックを設定します。voidsetDisconnectCompletionTimeout(long completionTimeout) 切断時の完了タイムアウトを設定します。voidsetQosExpression(Expression qosExpression) qos 式を設定します。デフォルトは "headers ['mqtt_qos' ]" です。voidsetQosExpressionString(StringSE qosExpression) qos 式を設定します。デフォルトは "headers ['mqtt_qos' ]" です。voidsetRetainedExpression(Expression retainedExpression) 保持された式を設定します。デフォルトは "headers ['mqtt_retained' ]" です。voidsetRetainedExpressionString(StringSE retainedExpression) 保持された式を設定します。デフォルトは "headers ['mqtt_retained' ]" です。voidsetTopicExpression(Expression topicExpression) トピック式を設定します。デフォルトは "headers ['mqtt_topic' ]" です。voidsetTopicExpressionString(StringSE topicExpression) トピック式を設定します。デフォルトは "headers ['mqtt_topic' ]" です。final voidstart()final voidstop()クラス AbstractMessageHandler から継承されたメソッド
handleMessage, onComplete, onError, onNext, onSubscribe, setObservationConventionクラス MessageHandlerSupport から継承されたメソッド
buildSendTimer, destroy, getIntegrationPatternType, getManagedName, getManagedType, getMetricsCaptor, getObservationRegistry, getOrder, getOverrides, isLoggingEnabled, isObserved, registerMetricsCaptor, registerObservationRegistry, sendTimer, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, shouldTrackクラス 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インターフェース reactor.core.CoreSubscriber から継承されたメソッド
currentContextインターフェース IntegrationManagement から継承されたメソッド
getThisAsインターフェース NamedComponent から継承されたメソッド
getBeanName, getComponentName
フィールドの詳細
DISCONNECT_COMPLETION_TIMEOUT
public static final long DISCONNECT_COMPLETION_TIMEOUTミリ秒単位のデフォルトの切断完了タイムアウト。- 関連事項:
DEFAULT_COMPLETION_TIMEOUT
public static final long DEFAULT_COMPLETION_TIMEOUTミリ秒単位のデフォルトの完了タイムアウト。- 関連事項:
lock
コンストラクターの詳細
AbstractMqttMessageHandler
AbstractMqttMessageHandler
方法の詳細
setApplicationEventPublisher
- 次で指定:
- インターフェース
ApplicationEventPublisherAware内のsetApplicationEventPublisher
getApplicationEventPublisher
setDefaultTopic
topicExpressionが `null` と評価された場合にメッセージが公開されるトピックを設定します。- パラメーター:
defaultTopic- デフォルトのトピック。
getDefaultTopic
setTopicExpression
トピック式を設定します。デフォルトは "headers ['mqtt_topic' ]" です。- パラメーター:
topicExpression- 表現。- 導入:
- 5.0
setTopicExpressionString
トピック式を設定します。デフォルトは "headers ['mqtt_topic' ]" です。- パラメーター:
topicExpression- 表現。- 導入:
- 5.0
getTopicProcessor
setDefaultQos
public void setDefaultQos(int defaultQos) qosExpressionが null と評価される場合、メッセージの qos を設定します。メッセージコンバーターが提供されていない場合にのみ適用されます。- パラメーター:
defaultQos- デフォルトの QoS。- 関連事項:
getDefaultQos
protected int getDefaultQos()setQosExpression
qos 式を設定します。デフォルトは "headers ['mqtt_qos' ]" です。メッセージコンバーターが提供されていない場合にのみ適用されます。- パラメーター:
qosExpression- 表現。- 導入:
- 5.0
- 関連事項:
setQosExpressionString
qos 式を設定します。デフォルトは "headers ['mqtt_qos' ]" です。メッセージコンバーターが提供されていない場合にのみ適用されます。- パラメーター:
qosExpression- 表現。- 導入:
- 5.0
- 関連事項:
getQosProcessor
setDefaultRetained
public void setDefaultRetained(boolean defaultRetained) retainedExpressionが null と評価された場合、メッセージの保持ブール値を設定します。メッセージコンバーターが提供されていない場合にのみ適用されます。- パラメーター:
defaultRetained- デフォルトの defaultRetained。- 関連事項:
getDefaultRetained
protected boolean getDefaultRetained()setRetainedExpression
保持された式を設定します。デフォルトは "headers ['mqtt_retained' ]" です。メッセージコンバーターが提供されていない場合にのみ適用されます。- パラメーター:
retainedExpression- 表現。- 導入:
- 5.0
- 関連事項:
setRetainedExpressionString
保持された式を設定します。デフォルトは "headers ['mqtt_retained' ]" です。メッセージコンバーターが提供されていない場合にのみ適用されます。- パラメーター:
retainedExpression- 表現。- 導入:
- 5.0
- 関連事項:
getRetainedProcessor
setConverter
使用するメッセージコンバーターを設定します。これが指定されている場合、アダプターの QoS および保持されている設定は無視されます。- パラメーター:
converter- コンバーター。
getConverter
getUrl
getClientId
getClientInstance
public int getClientInstance()クライアントが接続されるたびに増加します。- 戻り値:
- インスタンス。
- 導入:
- 4.1
getComponentType
- 次で指定:
- インターフェース
NamedComponent内のgetComponentType - オーバーライド:
- クラス
MessageHandlerSupportのgetComponentType
incrementClientInstance
protected void incrementClientInstance()setCompletionTimeout
getCompletionTimeout
protected long getCompletionTimeout()setDisconnectCompletionTimeout
getDisconnectCompletionTimeout
protected long getDisconnectCompletionTimeout()getClientManager
setAsync
public void setAsync(boolean async) メッセージを送信するときにブロックしない場合は、true に設定します。デフォルトは false。true の場合、メッセージ送信 / 配信イベントは、適切に構成された "ApplicationListener" またはイベント inbound-channel-adapter による受信のために公開されます。- パラメーター:
async- 非同期の場合は true。- 関連事項:
isAsync
protected boolean isAsync()setAsyncEvents
public void setAsyncEvents(boolean asyncEvents) setAsync(boolean)が true の場合、これを true に設定すると、MqttMessageSentEventおよびMqttMessageDeliveredEventの発行が発行されます。デフォルトは false。- パラメーター:
asyncEvents- asyncEvents。
onInit
protected void onInit()クラスからコピーされた説明:IntegrationObjectSupportサブクラスは、初期化ロジック用にこれを実装できます。- オーバーライド:
- クラス
IntegrationObjectSupportのonInit
start
public final void start()- 次で指定:
- インターフェース
Lifecycle内のstart - 次で指定:
- インターフェース
ManageableLifecycle内のstart
doStart
protected abstract void doStart()stop
public final void stop()- 次で指定:
- インターフェース
Lifecycle内のstop - 次で指定:
- インターフェース
ManageableLifecycle内のstop
doStop
protected abstract void doStop()isRunning
public boolean isRunning()- 次で指定:
- インターフェース
Lifecycle内のisRunning - 次で指定:
- インターフェース
ManageableLifecycle内のisRunning
handleMessageInternal
- 次で指定:
- クラス
AbstractMessageHandlerのhandleMessageInternal
messageSentEvent
sendDeliveryCompleteEvent
protected void sendDeliveryCompleteEvent(int messageId) sendFailedDeliveryEvent
publish