# Chaos Testing - Rest Proxy returns success but messages not written to Kafka

**URL:** <https://forum.confluent.io/t/chaos-testing-rest-proxy-returns-success-but-messages-not-written-to-kafka/1024>\
**Category:** REST Proxy\
**Created:** [25 February 2021 03:20 UTC](https://forum.confluent.io/t/chaos-testing-rest-proxy-returns-success-but-messages-not-written-to-kafka/1024 "2021-02-25T03:20:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sukalpo](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/sukalpo/32/539_2.png) [@sukalpo](https://forum.confluent.io/u/sukalpo)\
**Post date:** [25 February 2021 03:20 UTC](https://forum.confluent.io/t/chaos-testing-rest-proxy-returns-success-but-messages-not-written-to-kafka/1024/1 "2021-02-25T03:20:43Z")

</div>

Hi All,

We are doing some chaos testing where we are feeding data to Kafka brokers through rest proxy and then suddenly stopping the brokers etc and checking the failover time.

Some behaviour that I am observing is sometimes during the test we have missing messages. The rest proxy is giving us 200 but the messages are not produced in the topic.

We are using acks=all.

How can we change the behaviour of rest proxy where if it fails producing to topic it returns a non 200 status code so that the non Java producer can retry.

---

<div class="post-metadata">

**Author:** ![kaijunxu](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@kaijunxu](https://forum.confluent.io/u/kaijunxu)\
**Post date:** [1 March 2021 09:53 UTC](https://forum.confluent.io/t/chaos-testing-rest-proxy-returns-success-but-messages-not-written-to-kafka/1024/2 "2021-03-01T09:53:47Z")

</div>

Hi Sukalpo, if there are errors (e.g. produce errors), you will still get a HTTP 200 response but the response body will include an error code and message - see the “Response JSON Array of Objects” section at this link: [Confluent REST Proxy API Reference | Confluent Documentation](https://docs.confluent.io/platform/current/kafka-rest/api.html#post--topics-(string-topic_name))

---

<div class="post-metadata">

**Author:** ![sukalpo](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/sukalpo/32/539_2.png) [@sukalpo](https://forum.confluent.io/u/sukalpo)\
**Post date:** [1 March 2021 10:24 UTC](https://forum.confluent.io/t/chaos-testing-rest-proxy-returns-success-but-messages-not-written-to-kafka/1024/3 "2021-03-01T10:24:42Z")

</div>

Hi @kaijunxu, Thanks for the response. Makes sense. I will revert here after we retest and we change our script to parse the response.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/confluentcommunity/original/1X/c49438c90c9df282e9996fdf6971be890c71b65a.svg) [@system](https://forum.confluent.io/u/system)\
**Post date:** [8 March 2021 10:24 UTC](https://forum.confluent.io/t/chaos-testing-rest-proxy-returns-success-but-messages-not-written-to-kafka/1024/4 "2021-03-08T10:24:54Z")

</div>

Closed on 8 March 2021 10:24 UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
