shashank created CAMEL-26432:
--------------------------------
Summary: camel-chaos - error status= for netty-http
Key: CAMEL-26432
URL: https://issues.apache.org/jira/browse/CAMEL-26432
Project: Camel
Issue Type: Improvement
Components: camel-core, camel-netty-http
Reporter: shashank
Assignee: shashank
Follow-up of CAMEL-26418 (apache/camel#28754), under CAMEL-26330, asked for in
its review.
CAMEL-26418 added {{error status=<code>}} for the http components, so that a
fault looks like the HTTP status a real server would return: for http, https,
undertow and vertx-http the fault fails the send with the exception the real
producer throws (camel-http {{HttpOperationFailedException}}, undertow and
vertx-http theirs), or gives the response instead when the endpoint has
{{throwExceptionOnFailure=false}} or the status is in {{okStatusCodeRange}}.
For netty-http the rule is rejected for now ({noformat}status= is not supported
yet for netty-http{noformat}), because {{NettyHttpOperationFailedException}}
takes a Netty {{HttpContent}} for the body
({{NettyHttpOperationFailedException(String uri, int statusCode, String
statusText, String location, HttpContent content)}}), and camel-chaos had no
test with camel-netty-http on the classpath.
*Proposal*
* Support {{status=}} for {{component=netty-http}} /
{{endpoint=netty-http:...}}: build a {{NettyHttpOperationFailedException}} with
an {{HttpContent}} of the rule's body (or an empty one), the status code and
text, and the headers of the rule, as
{{NettyHttpHelper.populateNettyHttpOperationFailedException}} does; honour
{{throwExceptionOnFailure=false}} and {{okStatusCodeRange}} as for the other
http components. The netty-http types must stay optional in camel-chaos (loaded
only when netty-http is used).
* Tests with camel-netty-http on the test classpath (exception,
{{throwExceptionOnFailure=false}}, {{okStatusCodeRange}}, and a route with
{{onException(NettyHttpOperationFailedException.class)}}), and the docs
({{chaos.adoc}}: remove "not supported yet"; {{design/chaos.adoc}} already
names {{NettyHttpOperationFailedException}}).
_Filed with Claude Code on behalf of allthingssecurity._
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)