クラス CamelMessageHandler
java.lang.ObjectSE
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.handler.MessageHandlerSupport
org.springframework.integration.handler.AbstractMessageHandler
org.springframework.integration.handler.AbstractMessageProducingHandler
org.springframework.integration.handler.AbstractReplyProducingMessageHandler
org.springframework.integration.camel.outbound.CamelMessageHandler
- 実装済みのインターフェース一覧:
org.reactivestreams.Subscriber<Message<?>>, Aware, BeanClassLoaderAware, BeanFactoryAware, BeanNameAware, DisposableBean, InitializingBean, ApplicationContextAware, Ordered, ComponentSourceAware, ExpressionCapable, Orderable, MessageProducer, HeaderPropagationAware, IntegrationPattern, NamedComponent, IntegrationManagement, TrackableComponent, MessageHandler, reactor.core.CoreSubscriber<Message<?>>
Apache Camel を呼び出してルートし、(オプションで) 応答を生成するための
MessageHandler。 非同期モードでは、ProducerTemplate.asyncSend(Endpoint, Exchange) が使用されます。
リクエストと応答の動作は、ExchangePattern 構成またはメッセージごとに制御できます。デフォルトでは、このハンドラーは ExchangePattern.InOnly モードで動作します。
Spring Integration と Apache Camel メッセージ間のデフォルトの「すべてのヘッダーのマッピング」動作は、setHeaderMapper(HeaderMapper) オプションを使用してカスタマイズできます。
呼び出すターゲット Apache Camel エンドポイントは、endpointUriExpression によって決定できます。デフォルトでは、ProducerTemplate.getDefaultEndpoint() が使用されます。
- 導入:
- 6.0
- 作成者:
- Artem Bilan
- 関連事項:
ネストされたクラスの概要
クラス AbstractReplyProducingMessageHandler から継承されたネストクラス / インターフェース
AbstractReplyProducingMessageHandler.RequestHandlerインターフェース IntegrationManagement から継承されたネストクラス / インターフェース
IntegrationManagement.ManagementOverridesフィールド概要
クラス AbstractMessageProducingHandler から継承されたフィールド
messagingTemplateクラス IntegrationObjectSupport から継承されたフィールド
EXPRESSION_PARSER, loggerインターフェース IntegrationManagement から継承されたフィールド
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEインターフェース Ordered から継承されたフィールド
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCEコンストラクター概要
コンストラクター方法の概要
修飾子と型メソッド説明protected final voiddoInit()protected @Nullable ObjectSEhandleRequestMessage(Message<?> requestMessage) サブクラスはこのメソッドを実装して、リクエストメッセージを処理する必要があります。voidsetEndpointUri(StringSE endpointUri) Camel ルートのエンドポイント uri を設定して、メッセージを送信します。voidsetEndpointUriExpression(Expression endpointUriExpression) Camel ルートのエンドポイント uri を設定して、メッセージを送信します。voidsetExchangePattern(org.apache.camel.ExchangePattern exchangePattern) voidsetExchangePatternExpression(Expression exchangePatternExpression) voidsetExchangeProperties(MapSE<StringSE, ObjectSE> exchangeProperties) voidsetExchangePropertiesExpression(Expression exchangePropertiesExpression) ExchangeプロパティをMapSE として評価する SpEL 式を設定します。voidsetHeaderMapper(HeaderMapper<org.apache.camel.Message> headerMapper) リクエストと応答の交換パターンが使用されている場合は、リクエストメッセージヘッダーを Apache Camel メッセージヘッダーにマッピングし、元に戻すようにHeaderMapperを設定します。voidsetRoute(org.apache.camel.builder.LambdaRouteBuilder route) LambdaRouteBuilderを設定して、インライン Camel ルート定義を追加します。クラス AbstractReplyProducingMessageHandler から継承されたメソッド
doInvokeAdvisedRequestHandler, getBeanClassLoader, getIntegrationPatternType, getRequiresReply, handleMessageInternal, hasAdviceChain, onInit, setAdviceChain, setBeanClassLoader, setRequiresReplyクラス AbstractMessageProducingHandler から継承されたメソッド
addNotPropagatedHeaders, createOutputMessage, getNotPropagatedHeaders, getOutputChannel, isAsync, messageBuilderForReply, produceOutput, resolveErrorChannel, sendErrorMessage, sendOutput, sendOutputs, setAsync, setNotPropagatedHeaders, setOutputChannel, setOutputChannelName, setSendTimeout, setupMessageProcessor, shouldCopyRequestHeaders, shouldSplitOutput, updateNotPropagatedHeadersクラス AbstractMessageHandler から継承されたメソッド
handleMessage, onComplete, onError, onNext, onSubscribe, setObservationConventionクラス MessageHandlerSupport から継承されたメソッド
buildSendTimer, destroy, getComponentType, 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
コンストラクターの詳細
CamelMessageHandler
public CamelMessageHandler()CamelMessageHandler
public CamelMessageHandler(org.apache.camel.ProducerTemplate producerTemplate)
方法の詳細
setEndpointUri
Camel ルートのエンドポイント uri を設定して、メッセージを送信します。setEndpointUriExpression(Expression)およびsetRoute(LambdaRouteBuilder)とは相互に排他的です。- パラメーター:
endpointUri- メッセージを送信する Camel ルートエンドポイント。
setEndpointUriExpression
Camel ルートのエンドポイント uri を設定して、メッセージを送信します。setEndpointUri(String)およびsetRoute(LambdaRouteBuilder)とは相互に排他的です。- パラメーター:
endpointUriExpression- メッセージを送信する Camel ルートエンドポイントを決定する SpEL 式。
setRoute
public void setRoute(org.apache.camel.builder.LambdaRouteBuilder route) LambdaRouteBuilderを設定して、インライン Camel ルート定義を追加します。ラムダrb -> rb.from("direct:inbound").bean(MyBean.class)または外部インスタンスへの参照として使用できます。setEndpointUri(String)およびsetEndpointUriExpression(Expression)とは相互に排他的です。メッセージを送信するエンドポイントは、ターゲットRouteBuilderから抽出されます。- パラメーター:
route- 使用するLambdaRouteBuilder。
setExchangePattern
public void setExchangePattern(org.apache.camel.ExchangePattern exchangePattern) setExchangePatternExpression
setHeaderMapper
リクエストと応答の交換パターンが使用されている場合は、リクエストメッセージヘッダーを Apache Camel メッセージヘッダーにマッピングし、元に戻すようにHeaderMapperを設定します。- パラメーター:
headerMapper- 使用するHeaderMapper。
setExchangeProperties
setExchangePropertiesExpression
ExchangeプロパティをMapSE として評価する SpEL 式を設定します。- パラメーター:
exchangePropertiesExpression- 交換プロパティの式。
doInit
protected final void doInit()- オーバーライド:
- クラス
AbstractReplyProducingMessageHandlerのdoInit
handleRequestMessage
クラスからコピーされた説明:AbstractReplyProducingMessageHandlerサブクラスはこのメソッドを実装して、リクエストメッセージを処理する必要があります。戻り値は、メッセージ、MessageBuilder、任意のプレーンオブジェクトです。基本クラスは、これらの開始点のいずれかからの返信メッセージの最終的な作成を処理します。戻り値が null の場合、メッセージフローはここで終了します。- 次で指定:
- クラス
AbstractReplyProducingMessageHandlerのhandleRequestMessage - パラメーター:
requestMessage- リクエストメッセージ。- 戻り値:
- メッセージを処理した結果、または
null