1 Reply Latest reply on Nov 7, 2016 9:59 AM by stephenwallen

    RecipientList return error on the second call

    s.sairlao

      The recipientList get error code after the 2nd call; e.g

       

      <!-- 1st call -->

        <recipientList>

           <simple>https://google.com</simple>

        </recipientList>

       

      <!-- 2nd call -->

        <recipientList >

        <simple>jetty:https://www.paypal.com/</simple>

        </recipientList>

       

      Can you assist me with the error?

       

      below are the error output and sample Blueprint code:

       

      thanks.

       

      <data contentType="text/plain;charset=ISO-8859-1" contentLength="1614"><![CDATA[org.apache.camel.component.http.HttpOperationFailedException: HTTP operation failed invoking https://www.paypal.com:443/?gzip with statusCode: 411

        at org.apache.camel.component.jetty.DefaultJettyHttpBinding.populateHttpOperationFailedException(DefaultJettyHttpBinding.java:161)

        at org.apache.camel.component.jetty.DefaultJettyHttpBinding.populateResponse(DefaultJettyHttpBinding.java:66)

        at org.apache.camel.component.jetty8.JettyContentExchange8.doTaskCompleted(JettyContentExchange8.java:188)

        at org.apache.camel.component.jetty8.JettyContentExchange8.onResponseComplete(JettyContentExchange8.java:122)

        at org.apache.camel.component.jetty8.JettyContentExchange8$1.onResponseComplete(JettyContentExchange8.java:81)

        at org.eclipse.jetty.client.HttpExchange.setStatus(HttpExchange.java:315)

        at org.eclipse.jetty.client.AbstractHttpConnection$Handler.messageComplete(AbstractHttpConnection.java:340)

        at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:870)

        at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)

        at org.eclipse.jetty.client.AsyncHttpConnection.handle(AsyncHttpConnection.java:135)

        at org.eclipse.jetty.io.nio.SslConnection.handle(SslConnection.java:196)

        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:696)

        at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:53)

        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)

        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)

        at java.lang.Thread.run(Thread.java:745)

      ]]></data>

       

       

      <?xml version="1.0" encoding="UTF-8"?>

      <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"

        xmlns:camel="http://camel.apache.org/schema/blueprint" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

        xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd

             http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd">

       

       

        <routeContext id="routeContextEventsByIdentity"

        xmlns="http://camel.apache.org/schema/blueprint">

        <route id="1stHttpCall" streamCache="true">

        <from uri="direct:getEventsByIdentity" />

       

        <log message="headers before 1st call = \n${headers}\n"/>

       

           <removeHeaders pattern="CamelHttp*" />

        <log message="jetty:https://google.com" />

        <recipientList>

           <simple>https://google.com</simple>

        </recipientList>

       

        <log message="body of 1st call= \n${body}"/>

        <log message="headers before 2nd call = \n${headers}\n"/>

       

        <log message="2nd url call"/>

        <removeHeaders pattern="CamelHttp*" />

        <to uri="direct:2ndHttpCall"/>

       

        </route>

        <route id="2ndHttpCall">

        <from uri="direct:2ndHttpCall"/>

        <log message="httpOut = ${body}"/>

        <log

        message="jetty:https://www.paypal.com/" />

        <recipientList >

        <simple>jetty:https://www.paypal.com/</simple>

        </recipientList>

        <log message="body 2nd call= \n${body}"/>

        <log message="headers after 2nd call = \n${headers}\n"/>

        </route>

        </routeContext>

      </blueprint>

        • 1. Re: RecipientList return error on the second call
          stephenwallen

          Have you tried a range of different urls in the second recipientList?  Or even swapping the url with the first one?

           

          I noticed a 411 error in your output which is an error returned by a server when it doesn't like your headers, specifically it thinks you're missing a Content-Length header. This might be an issue with the target website being too strict with the tests it runs on http requests to it.

           

          I'm not sure if you can add custom headers to your url directly, I suspect you might need to create a new Endpoint to do this, but I think generally speaking the issue is with the 411 error itself, and not in how you're using RecipientList.