クラス 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
ネストされたクラスのサマリー
インターフェース org.springframework.integration.support.management.IntegrationManagement から継承されたネストクラス / インターフェース
IntegrationManagement.ManagementOverrides
フィールドのサマリー
フィールド修飾子と型フィールド説明static final long
ミリ秒単位のデフォルトの完了タイムアウト。static final long
ミリ秒単位のデフォルトの切断完了タイムアウト。protected final LockSE
クラス org.springframework.integration.context.IntegrationObjectSupport から継承されたフィールド
EXPRESSION_PARSER, logger
インターフェース org.springframework.integration.support.management.IntegrationManagement から継承されたフィールド
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME
インターフェース org.springframework.core.Ordered から継承されたフィールド
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
コンストラクターの概要
コンストラクターコンストラクター説明AbstractMqttMessageHandler
(StringSE url, StringSE clientId) AbstractMqttMessageHandler
(ClientManager<T, C> clientManager) メソッドのサマリー
修飾子と型メソッド説明protected abstract void
doStart()
protected abstract void
doStop()
protected ApplicationEventPublisher
int
クライアントが接続されるたびに増加します。protected ClientManager
<T, C> protected long
サブクラスはこのメソッドを実装して、コンポーネント型情報を提供できます。protected MessageConverter
protected int
protected boolean
protected StringSE
protected long
protected MessageProcessor
<IntegerSE> protected MessageProcessor
<BooleanSE> protected MessageProcessor
<StringSE> protected StringSE
getUrl()
protected void
handleMessageInternal
(Message<?> message) protected void
protected boolean
isAsync()
boolean
protected void
messageSentEvent
(Message<?> message, StringSE topic, int messageId) protected void
onInit()
サブクラスは、初期化ロジック用にこれを実装できます。protected abstract void
protected void
sendDeliveryCompleteEvent
(int messageId) protected void
sendFailedDeliveryEvent
(int messageId, ThrowableSE exception) void
setApplicationEventPublisher
(ApplicationEventPublisher applicationEventPublisher) void
setAsync
(boolean async) メッセージを送信するときにブロックしない場合は、true に設定します。void
setAsyncEvents
(boolean asyncEvents) setAsync(boolean)
が true の場合、これを true に設定すると、MqttMessageSentEvent
およびMqttMessageDeliveredEvent
の発行が発行されます。void
setCompletionTimeout
(long completionTimeout) 非同期操作の完了タイムアウトを設定します。void
setConverter
(MessageConverter converter) 使用するメッセージコンバーターを設定します。これが指定されている場合、アダプターの QoS および保持されている設定は無視されます。void
setDefaultQos
(int defaultQos) qosExpression
が null と評価される場合、メッセージの qos を設定します。void
setDefaultRetained
(boolean defaultRetained) retainedExpression
が null と評価された場合、メッセージの保持ブール値を設定します。void
setDefaultTopic
(StringSE defaultTopic) topicExpression
が `null` と評価された場合にメッセージが公開されるトピックを設定します。void
setDisconnectCompletionTimeout
(long completionTimeout) 切断時の完了タイムアウトを設定します。void
setQosExpression
(Expression qosExpression) qos 式を設定します。デフォルトは "headers ['mqtt_qos' ]" です。void
setQosExpressionString
(StringSE qosExpression) qos 式を設定します。デフォルトは "headers ['mqtt_qos' ]" です。void
setRetainedExpression
(Expression retainedExpression) 保持された式を設定します。デフォルトは "headers ['mqtt_retained' ]" です。void
setRetainedExpressionString
(StringSE retainedExpression) 保持された式を設定します。デフォルトは "headers ['mqtt_retained' ]" です。void
setTopicExpression
(Expression topicExpression) トピック式を設定します。デフォルトは "headers ['mqtt_topic' ]" です。void
setTopicExpressionString
(StringSE topicExpression) トピック式を設定します。デフォルトは "headers ['mqtt_topic' ]" です。final void
start()
final void
stop()
クラス org.springframework.integration.handler.AbstractMessageHandler から継承されたメソッド
handleMessage, onComplete, onError, onNext, onSubscribe, setObservationConvention
クラス org.springframework.integration.handler.MessageHandlerSupport から継承されたメソッド
buildSendTimer, destroy, getIntegrationPatternType, getManagedName, getManagedType, getMetricsCaptor, getObservationRegistry, getOrder, getOverrides, isLoggingEnabled, isObserved, registerMetricsCaptor, registerObservationRegistry, sendTimer, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, shouldTrack
クラス org.springframework.integration.context.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
クラス java.lang.ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, wait, waitSE, waitSE
インターフェース reactor.core.CoreSubscriber から継承されたメソッド
currentContext
インターフェース org.springframework.integration.support.management.IntegrationManagement から継承されたメソッド
getThisAs
インターフェース org.springframework.integration.support.context.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
クラスからコピーされた説明:IntegrationObjectSupport
サブクラスはこのメソッドを実装して、コンポーネント型情報を提供できます。- 次で指定:
- インターフェース
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