1
私の設定には以下のヘッダーが豊富にあります。ペイロードがnullの場合はペイロードがnullの場合スプリング統合ヘッダーエンリッチャーヌルチェック
<int:header-enricher input-channel="" output-channel="" id="" >
<int:header name="OrderNo" expression="@gateway.exchange(#root).payload"/>
</int:header-enricher>
、私は、例外
java.lang.IllegalArgumentException: payload must not be null
at org.springframework.util.Assert.notNull(Assert.java:112)
at org.springframework.integration.support.MessageBuilder.<init>(MessageBuilder.java:56) ~[spring-integration-core-4.0.5.RELEASE.jar:na]
ヘッダー内のいくつかのダミーの値をゲートウェイからヌルペイロードをチェックし、設定する方法はあります取得していますか?
<int:gateway id="gateway" default-request-channel="defReqChannel" />
<int-jdbc:stored-proc-outbound-gateway request-channel="defReqChannel" data-source="dataSourceDD" expect-single-result="true" is-function="false" stored-procedure-name="SP_GET_CODE">
<int-jdbc:sql-parameter-definition name="param1" direction="IN" />
<int-jdbc:sql-parameter-definition name="param2" direction="IN" />
<int-jdbc:sql-parameter-definition name="param3" direction="INOUT" />
<int-jdbc:sql-parameter-definition name="param4" direction="IN" />
<int-jdbc:parameter name="param1" expression="exp1" />
<int-jdbc:parameter name="param2" expression="exp2" />
<int-jdbc:parameter name="param3" value="0"/>
<int-jdbc:parameter name="param4" value="0"/>
</int-jdbc:stored-proc-outbound-gateway>
私が呼び出しているストアドプロシージャは、NULL値を返すことができます。 (param3)。これらのシナリオでエラーが発生します
元のコードスニペットを更新しました –
私の答えで更新を見つけてください –