title: Spring Integration : Remove Jms and Http Headers from Message
body: <p>I have a integration flow like this</p>
  
  <p><strong>Subscriber &amp; Publisher</strong></p>
  
  <pre><code>Broker-&gt;queue1-&gt;Transform-&gt;HTTP CALL-&gt;HTTP Response-&gt;JMS Message-&gt;Broker-&gt;queue2
  </code></pre>
  
  <p>This my integration flow DSL </p>
  
  <pre><code>@Bean
  public IntegrationFlow orchestrationFlow() {
      return IntegrationFlows.from(Jms.messageDrivenChannelAdapter(connectionFactory).destination("MAILBOX"))
              //destination("amq.outbound1"))
              .&lt;String, String&gt;transform(s -&gt; {
                  return s.toLowerCase();
              }).log()
              .transform(new PojoTransformer())
              //.headerFilter("^(jms?|JMS)://.*$", true)
              .log()
              // HTTP part goes here
              .&lt;String, HttpEntity&lt;String&gt;&gt;transform(HttpEntity::new).handle(
  
                      Http.outboundGateway("http://localhost:8080/uppsercase").httpMethod(HttpMethod.POST)
                              .extractPayload(true).expectedResponseType(String.class))
              .log()
              .headerFilter("(.*?)", true)
              .log()
              //.&lt;HttpEntity&lt;String&gt;,String&gt;transform(HttpEntity&lt;String&gt;::getBody)
              // and here HTTP part ends
              .handle(Jms.outboundAdapter(connectionFactory).destination("MAILBOXX")).get();
  }
  
  public static class PojoTransformer {
  
      @Transformer
      public String transform(@Payload String email, @Headers MessageHeaders headers) {
          return  email;
      }
  
  }
  </code></pre>
  
  <p>I want remove Jms Headers from the message before making http call
  Also want to remove the HTTP headers before sending it to JMS</p>
  
  <p>I tried to different approaches using  <code>@Transformer</code>  and  <code>headerFilter</code></p>
  
  <p>But nothing work, 
  Since clearing of headers is not happening  , unwanted headers are send to JMS and HTTP requests</p>
  
  <p>I pasting the logs here</p>
  
  <pre><code> GenericMessage [payload=something, headers={JMS_IBM_Character_Set=UTF-8, JMS_IBM_MsgType=8, jms_destination=queue:///MAILBOX, JMSXUserID=admin       , JMS_IBM_Encoding=273, priority=4, jms_timestamp=1532706892455, JMSXAppID=SpringIntegrationDemoApplica, JMS_IBM_PutApplType=28, JMS_IBM_Format=MQSTR   , jms_redelivered=false, JMS_IBM_PutDate=20180727, JMSXDeliveryCount=1, JMS_IBM_PutTime=15545246, id=5f5fe393-42e3-9ab9-3170-739bf7e4f72b, jms_messageId=ID:414d5120514d31202020202020202020872a5b5b02781521, timestamp=1532706892732}]
   GenericMessage [payload=something, headers={JMS_IBM_Character_Set=UTF-8, JMS_IBM_MsgType=8, jms_destination=queue:///MAILBOX, JMSXUserID=admin       , JMS_IBM_Encoding=273, priority=4, jms_timestamp=1532706892455, JMSXAppID=SpringIntegrationDemoApplica, JMS_IBM_PutApplType=28, JMS_IBM_Format=MQSTR   , jms_redelivered=false, JMS_IBM_PutDate=20180727, JMSXDeliveryCount=1, JMS_IBM_PutTime=15545246, id=d81f301b-7033-65be-9dd2-6bda3a200b3a, jms_messageId=ID:414d5120514d31202020202020202020872a5b5b02781521, timestamp=1532706892737}]
   GenericMessage [payload=SOMETHING IS CONVERTED TO UPPERCASE, headers={JMS_IBM_Character_Set=UTF-8, JMS_IBM_MsgType=8, jms_destination=queue:///MAILBOX, JMSXUserID=admin       , JMS_IBM_Encoding=273, priority=4, jms_timestamp=1532706892455, http_statusCode=201, Date=1532706892000, JMSXAppID=SpringIntegrationDemoApplica, JMS_IBM_PutApplType=28, JMS_IBM_Format=MQSTR   , jms_redelivered=false, JMS_IBM_PutDate=20180727, JMSXDeliveryCount=1, JMS_IBM_PutTime=15545246, id=e464d287-b32b-0bdc-e008-c3d5bf70e45a, Content-Length=35, contentType=text/plain;charset=UTF-8, jms_messageId=ID:414d5120514d31202020202020202020872a5b5b02781521, timestamp=1532706892783}]
   GenericMessage [payload=SOMETHING IS CONVERTED TO UPPERCASE, headers={JMS_IBM_Character_Set=UTF-8, JMS_IBM_MsgType=8, jms_destination=queue:///MAILBOX, JMSXUserID=admin       , JMS_IBM_Encoding=273, priority=4, jms_timestamp=1532706892455, http_statusCode=201, Date=1532706892000, JMSXAppID=SpringIntegrationDemoApplica, JMS_IBM_PutApplType=28, JMS_IBM_Format=MQSTR   , jms_redelivered=false, JMS_IBM_PutDate=20180727, JMSXDeliveryCount=1, JMS_IBM_PutTime=15545246, id=e464d287-b32b-0bdc-e008-c3d5bf70e45a, Content-Length=35, contentType=text/plain;charset=UTF-8, jms_messageId=ID:414d5120514d31202020202020202020872a5b5b02781521, timestamp=1532706892783}]
  : failed to map Message header 'Content-Length' to JMS property
  </code></pre>
  
  <p>could somebody tell me why my transformations is not working properly</p>