3 Replies Latest reply on Sep 28, 2010 12:19 AM by davsclaus

    camel http in spring

    guest

      Hello, i'm trying to set the Content-Type before posting using camel http in spring.  In the camel docs it mentions setting the header Exchange.CONTENT_TYPE.  This header name is only valid in DSL or used as an exchange header within a processor.

       

      I would like to set the content type in my spring bean.  I tried this but obviously it doesn't work.

       

       

       

      Thanks.

        • 1. Re: camel http in spring
          njiang

          I'm afraid you had to use the "Content-Type" directly as current Spring DSL doesn't support to reference the constance from class directly.

          • 2. Re: camel http in spring
            davsclaus

            Maybe we could introduce some syntax for that, so Camel can evaluate on startup the header name is spelt correctly?

             

            <setHeader headerName="Exchange.CONTENT_TYPE">
               ...
            </setHeader>
            

             

            Either Camel detects that you have typed a constant field name from the Exchange interface and will lookup the value of that constant and use it.

             

            However what about other constants? Maybe we need a special syntax to tell Camel that it's a constant?

             

            Or maybe we don't need it if Camel can resolve that into a constant on an interface/class and just use it?

            • 3. Re: camel http in spring
              davsclaus

              I created a ticket at Apache about this idea

              https://issues.apache.org/activemq/browse/CAMEL-3167