Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-19077

Not able to get HttpMessage from exchange after HttpCopoment

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Not A Bug
    • 3.20.1, 3.20.2, 3.x
    • None
    • came-core
    • None
    • Unknown

    Description

      I open this as bug ticket 

      according to suggestion from (3442) #camel > How to get HttpRequest and HttpReponse from exchange - camel - Zulip (zulipchat.com) 

       

       

       

      Problem: 

      Not able to get HttpMessage  from exchange after HttpCopoment

      I used debugger it shows message Tpye is JMSMessage instead of HttpMessage

       

       

      Example Code: 

              from("jms:topic:my.topicname")
                      .to("direct:restendpoint");

              from("direct:restendpoint").routeId("direct_restendpoint")
                      .to("https://<URL_SERVICE>")
                      .process(exchange -> {
                          String responseCode = exchange.getIn().getHeader("CamelHttpResponseCode").toString();
                          //responseCode is 200
                          LOG.info("responseCode->{}",responseCode);
                          // httpMessages are all NULL
                          LOG.info("httpMessage1->{}",exchange.getIn(org.apache.camel.http.common.HttpMessage.class));
                          LOG.info("httpMessage2->{}",exchange.getIn(org.apache.http.HttpMessage.class));
                          LOG.info("httpMessage3->{}",exchange.getIn(io.netty.handler.codec.http.HttpMessage.class));
                          LOG.info("httpMessage4->{}",exchange.getIn(org.springframework.http.HttpMessage.class));

                      }

       

      Affected version 

      I tried 3.11.2 & 3.20.2 assumption it is for all 3.x 

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            Y.W WangYan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: