title: Spring Integration Header Enricher Null check
body: <p>I have the below header enricher in my configuration.     </p>
  
  <pre><code>&lt;int:header-enricher input-channel="" output-channel="" id="" &gt;
      &lt;int:header name="OrderNo" expression="@gateway.exchange(#root).payload"/&gt; 
  &lt;/int:header-enricher&gt;
  </code></pre>
  
  <p>When the payload is null, I am getting the exception</p>
  
  <pre><code>java.lang.IllegalArgumentException: payload must not be null
  at org.springframework.util.Assert.notNull(Assert.java:112)
  at org.springframework.integration.support.MessageBuilder.&lt;init&gt;(MessageBuilder.java:56) ~[spring-integration-core-4.0.5.RELEASE.jar:na]
  </code></pre>
  
  <p>Is there a way to check for null payload from gateway and set some dummy value in header, if payload is null?</p>
  
  <pre><code>&lt;int:gateway id="gateway" default-request-channel="defReqChannel" /&gt;
  &lt;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"&gt;
          &lt;int-jdbc:sql-parameter-definition name="param1" direction="IN" /&gt;
          &lt;int-jdbc:sql-parameter-definition name="param2" direction="IN" /&gt;
          &lt;int-jdbc:sql-parameter-definition name="param3" direction="INOUT" /&gt;    
          &lt;int-jdbc:sql-parameter-definition name="param4" direction="IN" /&gt; 
  
          &lt;int-jdbc:parameter name="param1" expression="exp1" /&gt;
          &lt;int-jdbc:parameter name="param2" expression="exp2" /&gt;
          &lt;int-jdbc:parameter name="param3" value="0"/&gt;  
          &lt;int-jdbc:parameter name="param4" value="0"/&gt;
  &lt;/int-jdbc:stored-proc-outbound-gateway&gt;
  </code></pre>
  
  <p>The stored procedure that I am invoking can return a null value. (param3). The failure happens in those scenarios</p>