Hi

You can try with setting a Camel header with the Exchange.HTTP_STATUS_CODE
to the 3xx value for redirect, and another header with the location (using
the standard name for that).
And then an empty body.



On Tue, Jun 27, 2023 at 3:44 PM Fyodor Kravchenko <feddkr...@hotmail.com>
wrote:

> Hello,
>
> one of my producers runs a custom script that is allowed to get access
> to the HttpServletRequest and to invoke sendRedirect method on it. It
> used to work on Camel 2 but with Camel 3.20.4 Jetty tells this:
>
> 16:19:38.178 [qtp987805552-43] ERROR
> o.a.camel.component.jetty.CamelContinuationServlet - Error processing
> request
> org.eclipse.jetty.io.EofException: Closed
>      at
> org.eclipse.jetty.server.HttpOutput.checkWritable(HttpOutput.java:771)
>      at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:795)
>      at org.apache.camel.util.IOHelper.copy(IOHelper.java:206)
>      at org.apache.camel.util.IOHelper.copy(IOHelper.java:161)
>      at
>
> org.apache.camel.http.common.DefaultHttpBinding.copyStream(DefaultHttpBinding.java:500)
>      at
>
> org.apache.camel.http.common.DefaultHttpBinding.doWriteDirectResponse(DefaultHttpBinding.java:566)
>      at
>
> org.apache.camel.http.common.DefaultHttpBinding.doWriteResponse(DefaultHttpBinding.java:439)
>      at
>
> org.apache.camel.http.common.DefaultHttpBinding.writeResponse(DefaultHttpBinding.java:362)
>
> A quick look at the DefaultHttpBinding.writeResponse shows it doesn't
> check for HttpServletRequest.isCommitted(), only for the body to be blanc.
>
> Is there any solution to allow users to send redirects in their scripts
> in the processors? Couldn't find a dedicated Camel HttpMessage method
> for that.
>
> --fedd
>
>

-- 
Claus Ibsen
-----------------
@davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Reply via email to