クラス AmqpInboundChannelAdapter
java.lang.ObjectSE
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.endpoint.AbstractEndpoint
org.springframework.integration.endpoint.MessageProducerSupport
org.springframework.integration.amqp.inbound.AmqpInboundChannelAdapter
- 実装済みのインターフェース一覧:
Aware, BeanFactoryAware, BeanNameAware, DisposableBean, InitializingBean, SmartInitializingSingleton, ApplicationContextAware, Lifecycle, Phased, SmartLifecycle, ComponentSourceAware, ExpressionCapable, OrderlyShutdownCapable, MessageProducer, IntegrationPattern, NamedComponent, IntegrationInboundManagement, IntegrationManagement, ManageableLifecycle, ManageableSmartLifecycle, TrackableComponent
public class AmqpInboundChannelAdapter
extends MessageProducerSupport
implements OrderlyShutdownCapable
AMQP キューからメッセージを受信し、それを Spring Integration メッセージに変換し、結果をメッセージチャネルに送信するアダプター。
- 導入:
- 2.1
- 作成者:
- Mark Fisher, Gary Russell, Artem Bilan, Ngoc Nhan
ネストされたクラスの概要
ネストされたクラス修飾子と型クラス説明protected classstatic enumリスナーコンテナーが consumerBatchEnabled で構成されている場合のペイロード型を定義します。protected classインターフェース IntegrationManagement から継承されたネストクラス / インターフェース
IntegrationManagement.ManagementOverridesフィールド概要
フィールド修飾子と型フィールド説明static final StringSEバッチモードがAmqpInboundChannelAdapter.BatchMode.EXTRACT_PAYLOADS_WITH_HEADERSの場合、List<Map<String, Object>ヘッダーを含むヘッダー。クラス AbstractEndpoint から継承されたフィールド
lifecycleLockクラス IntegrationObjectSupport から継承されたフィールド
EXPRESSION_PARSER, loggerインターフェース IntegrationManagement から継承されたフィールド
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEインターフェース SmartLifecycle から継承されたフィールド
DEFAULT_PHASEコンストラクター概要
コンストラクターコンストラクター説明AmqpInboundChannelAdapter(MessageListenerContainer listenerContainer) 提供されたコンテナーを使用してインスタンスを構築します。AmqpInboundChannelAdapter(MessageListenerContainer listenerContainer) 非推奨、削除予定: この API 要素は、将来のバージョンで削除される可能性があります。方法の概要
修飾子と型メソッド説明intスケジューラー、エグゼキューターなどの通常のシャットダウンの後、シャットダウン遅延が経過した後、残りのアクティブなスケジューラー / エグゼキュータースレッドの強制シャットダウンの前に呼び出されます。オプションで、まだ処理中のアクティブなメッセージの数を返すことができます。intシャットダウンが始まる前に呼び出されます。protected voiddoStart()デフォルトでは何もしません。protected voiddoStop()デフォルトでは何もしません。protected AttributeAccessorgetErrorMessageAttributes(@Nullable Message<?> message) errorMessageStrategyでエラーメッセージを作成するときに使用するAttributeAccessorを設定します。protected voidonInit()サブクラスは、初期化ロジック用にこれを実装できます。voidsetBatchingStrategy(BatchingStrategy batchingStrategy) バッチプロデューサー(BatchingRabbitTemplate など)によって作成されたメッセージをバッチ解除するときに使用するバッチ戦略を設定します。voidsetBatchMode(AmqpInboundChannelAdapter.BatchMode batchMode) リスナーコンテナーが consumerBatchEnabled で構成されている場合は、バッチ用に生成されるメッセージのペイロード型を設定します。voidsetBindSourceMessage(boolean bindSourceMessage) IntegrationMessageHeaderAccessor.SOURCE_DATAという名前のヘッダーのソースメッセージをバインドするには、true に設定します。voidsetHeaderMapper(AmqpHeaderMapper headerMapper) voidsetHeaderNameForBatchedHeaders(StringSE headerNameForBatchedHeaders) バッチモードがAmqpInboundChannelAdapter.BatchMode.EXTRACT_PAYLOADS_WITH_HEADERSの場合、List<Map<String, Object>ヘッダーを含むヘッダー名を設定します。voidsetMessageConverter(MessageConverter messageConverter) voidsetMessageRecoverer(MessageRecoverer messageRecoverer) 再試行操作用にMessageRecovererを構成します。voidsetRecoveryCallback(RecoveryCallback<?> recoveryCallback) アダプター内で再試行を使用する場合は、RecoveryCallbackを設定してください。voidsetRetryTemplate(RetryTemplate retryTemplate) アダプター内でメッセージ配信を再試行するために使用するRetryTemplateを設定します。クラス MessageProducerSupport から継承されたメソッド
afterSingletonsInstantiated, buildErrorMessage, getErrorChannel, getErrorMessageStrategy, getIntegrationPatternType, getMessagingTemplate, getOutputChannel, getOutputChannelName, getRequiredOutputChannel, isObserved, registerObservationRegistry, sendErrorMessageIfNecessary, sendMessage, setErrorChannel, setErrorChannelName, setErrorMessageStrategy, setObservationConvention, setOutputChannel, setOutputChannelName, setSendTimeout, setShouldTrack, subscribeToPublisherクラス AbstractEndpoint から継承されたメソッド
destroy, 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インターフェース IntegrationManagement から継承されたメソッド
destroy, getManagedName, getManagedType, getOverrides, getThisAs, isLoggingEnabled, registerMetricsCaptor, setLoggingEnabled, setManagedName, setManagedTypeインターフェース NamedComponent から継承されたメソッド
getBeanName, getComponentNameインターフェース SmartLifecycle から継承されたメソッド
isPauseable
フィールドの詳細
CONSOLIDATED_HEADERS
バッチモードがAmqpInboundChannelAdapter.BatchMode.EXTRACT_PAYLOADS_WITH_HEADERSの場合、List<Map<String, Object>ヘッダーを含むヘッダー。- 関連事項:
コンストラクターの詳細
AmqpInboundChannelAdapter
@DeprecatedSE(forRemoval=true, since="7.1") public AmqpInboundChannelAdapter(MessageListenerContainer listenerContainer) 非推奨、削除予定: この API 要素は、将来のバージョンで削除される可能性があります。提供されたコンテナーを使用してインスタンスを構築します。バイトコードの下位互換性のために必要です。- パラメーター:
listenerContainer- コンテナー。
AmqpInboundChannelAdapter
提供されたコンテナーを使用してインスタンスを構築します。- パラメーター:
listenerContainer- コンテナー。
方法の詳細
setMessageConverter
setHeaderMapper
setRetryTemplate
アダプター内でメッセージ配信を再試行するために使用するRetryTemplateを設定します。コンテナーレベルで再試行を追加する場合とは異なり、ErrorMessageSendingRecovererRecoveryCallbackと組み合わせて使用することで、再試行回数の上限に達した後にエラーチャネルにパブリッシュできます。通常、ここで再試行を使用する場合はエラーチャネルを設定せず、代わりにRecoveryCallbackを使用してください。- パラメーター:
retryTemplate- テンプレート。- 導入:
- 4.3.10.
- 関連事項:
setRecoveryCallback
アダプター内で再試行を使用する場合は、RecoveryCallbackを設定します。setMessageRecoverer(MessageRecoverer)とは排他的です。- パラメーター:
recoveryCallback- コールバック。- 導入:
- 4.3.10
- 関連事項:
setMessageRecoverer
再試行操作用にMessageRecovererを構成します。setRecoveryCallback(RecoveryCallback)の代わりに AMQP 固有の便利さ。- パラメーター:
messageRecoverer- 使用するMessageRecoverer。- 導入:
- 5.5
setBatchingStrategy
バッチプロデューサー(BatchingRabbitTemplate など)によって作成されたメッセージをバッチ解除するときに使用するバッチ戦略を設定します。デフォルトはSimpleBatchingStrategyです。- パラメーター:
batchingStrategy- 戦略。- 導入:
- 5.2
setBindSourceMessage
public void setBindSourceMessage(boolean bindSourceMessage) IntegrationMessageHeaderAccessor.SOURCE_DATAという名前のヘッダーのソースメッセージをバインドするには、true に設定します。- パラメーター:
bindSourceMessage- バインドする場合は true。- 導入:
- 5.1.6
setBatchMode
リスナーコンテナーが consumerBatchEnabled で構成されている場合は、バッチ用に生成されたメッセージのペイロード型を設定します。デフォルトはAmqpInboundChannelAdapter.BatchMode.MESSAGESです。- パラメーター:
batchMode- バッチモード。- 導入:
- 5.3
setHeaderNameForBatchedHeaders
バッチモードがAmqpInboundChannelAdapter.BatchMode.EXTRACT_PAYLOADS_WITH_HEADERSの場合、List<Map<String, Object>ヘッダーを含むヘッダー名を設定します。デフォルトはCONSOLIDATED_HEADERSです。- パラメーター:
headerNameForBatchedHeaders- バッチモードがAmqpInboundChannelAdapter.BatchMode.EXTRACT_PAYLOADS_WITH_HEADERSの場合のList<Map<String, Object>ヘッダーを含むヘッダーの名前。- 導入:
- 6.4
getComponentType
- 次で指定:
- インターフェース
NamedComponent内のgetComponentType - オーバーライド:
- クラス
MessageProducerSupportのgetComponentType
onInit
protected void onInit()クラスからコピーされた説明:IntegrationObjectSupportサブクラスは、初期化ロジック用にこれを実装できます。- オーバーライド:
- クラス
MessageProducerSupportのonInit
doStart
protected void doStart()クラスからコピーされた説明:MessageProducerSupportデフォルトでは何も実行されません。ライフサイクル管理された動作が必要な場合、サブクラスはこれをオーバーライドできます。'lifecycleLock' によって保護されています。- オーバーライド:
- クラス
MessageProducerSupportのdoStart
doStop
protected void doStop()クラスからコピーされた説明:MessageProducerSupportデフォルトでは何もしません。サブクラスは、ライフサイクル管理の動作が必要な場合、これをオーバーライドできます。- オーバーライド:
- クラス
MessageProducerSupportのdoStop
beforeShutdown
public int beforeShutdown()インターフェースからコピーされた説明:OrderlyShutdownCapableシャットダウンが始まる前に呼び出されます。実装は、新しいメッセージの受け入れを停止する必要があります。オプションで、処理中のアクティブなメッセージの数を返すことができます。- 次で指定:
- インターフェース
OrderlyShutdownCapable内のbeforeShutdown - 戻り値:
- 使用可能な場合、アクティブなメッセージの数。
afterShutdown
public int afterShutdown()インターフェースからコピーされた説明:OrderlyShutdownCapableスケジューラー、エグゼキューターなどの通常のシャットダウンの後、シャットダウン遅延が経過した後、残りのアクティブなスケジューラー / エグゼキュータースレッドの強制シャットダウンの前に呼び出されます。オプションで、まだ処理中のアクティブなメッセージの数を返すことができます。- 次で指定:
- インターフェース
OrderlyShutdownCapable内のafterShutdown - 戻り値:
- 使用可能な場合、アクティブなメッセージの数。
getErrorMessageAttributes
クラスからコピーされた説明:MessageProducerSupporterrorMessageStrategyでエラーメッセージを作成するときに使用するAttributeAccessorを設定します。- オーバーライド:
- クラス
MessageProducerSupportのgetErrorMessageAttributes - パラメーター:
message- メッセージ。- 戻り値:
- 属性。
AmqpInboundChannelAdapter(org.springframework.amqp.core.MessageListenerContainer)を推奨する 7.1 以降。