title: Spring Integration - transformer and header enricher
body: <p>My case is like this: I need to route a message based on the zipcode to three different stores.</p>
  
  <p>For that I need to look at the message header to find the customer's zipcode, and do the following calculation:</p>
  
  <pre><code>    if(zip &lt; 5000)
      {
          store = "SJ";
      }
      else if(zip &gt;= 6000)
      {
          store = "JY";
      }
      else
      {
          store = "FY";
      }
  </code></pre>
  
  <p>I have managed to get it done using the following custom Transformer which I use to enrich the message header:</p>
  
  <pre><code>public class HeaderEnricher {
      public Message&lt;?&gt; transform(Message&lt;?&gt; message) 
      {
          int zip = message.getHeaders().get("Customer Zip", Integer.class);
          String store;
  
          if (zip &lt; 5000) 
          {
              store = "SJ";
          } 
          else if (zip &gt;= 6000) 
          {
              store = "JY";
          } 
          else 
          {
              store = "FY";
          }
  
          Message&lt;?&gt; messageOut = MessageBuilder
                  .withPayload(message.getPayload())
                  .copyHeadersIfAbsent(message.getHeaders())
                  .setHeaderIfAbsent("store", store).build();
  
          return messageOut;
      }
  }
  </code></pre>
  
  <p>As I said this is working, but I was wondering how to do the same using a header-enricher. I'm asking because I would like my integration-graph to illustrate it as a header-enricher, because that is my intention with the above transformer-code.</p>
  
  <p>Is that possible?</p>