# What can i do if both write and read operations are in the same Kafka topic

**URL:** <https://discuss.aerospike.com/t/what-can-i-do-if-both-write-and-read-operations-are-in-the-same-kafka-topic/7814>\
**Category:** Kafka\
**Created:** [September 8, 2020, 4:58pm UTC](https://discuss.aerospike.com/t/what-can-i-do-if-both-write-and-read-operations-are-in-the-same-kafka-topic/7814 "2020-09-08T16:58:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ariel\_Roasso](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/ariel_roasso/32/1510_2.png) [@Ariel\_Roasso](https://discuss.aerospike.com/u/Ariel_Roasso)\
**Post date:** [September 8, 2020, 4:58pm UTC](https://discuss.aerospike.com/t/what-can-i-do-if-both-write-and-read-operations-are-in-the-same-kafka-topic/7814/1 "2020-09-08T16:58:16Z")

</div>

Is it possible to dynamically set operation type? [https://www.aerospike.com/docs/connectors/enterprise/kafka/inbound/configuration/topics.html#aerospike-operation-config](https://www.aerospike.com/docs/connectors/enterprise/kafka/inbound/configuration/topics.html#aerospike-operation-config)

---

<div class="post-metadata">

**Author:** ![meher](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/meher/32/1644_2.png) [@meher](https://discuss.aerospike.com/u/meher)\
**Post date:** [September 11, 2020, 10:13pm UTC](https://discuss.aerospike.com/t/what-can-i-do-if-both-write-and-read-operations-are-in-the-same-kafka-topic/7814/2 "2020-09-11T22:13:57Z")

</div>

I guess you meant write and delete operations (rather than write and read operations). I am not an expert, and not sure actually. It seems that it may require 2 configs for the same topic, one for writes and one for deletes. Did you try that?

---

<div class="post-metadata">

**Author:** ![Ariel\_Roasso](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/ariel_roasso/32/1510_2.png) [@Ariel\_Roasso](https://discuss.aerospike.com/u/Ariel_Roasso)\
**Post date:** [September 12, 2020, 6:08pm UTC](https://discuss.aerospike.com/t/what-can-i-do-if-both-write-and-read-operations-are-in-the-same-kafka-topic/7814/3 "2020-09-12T18:08:10Z")

</div>

You’r right i was talking about writes and deletes. I can also split the topic to two topics but the reason I’m using one topic (with one partition) is that the order is import For example if I’ve two operations

1. write 1 → "one
2. delete key 1

if the order is 1) and then 2) the end result will be no record. and if the order is 2) and than 1) the end result will be 1-\>“one”

---

<div class="post-metadata">

**Author:** ![meher](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/meher/32/1644_2.png) [@meher](https://discuss.aerospike.com/u/meher)\
**Post date:** [September 15, 2020, 10:51pm UTC](https://discuss.aerospike.com/t/what-can-i-do-if-both-write-and-read-operations-are-in-the-same-kafka-topic/7814/4 "2020-09-15T22:51:17Z")

</div>

Seems like indeed, at this point, one would have to use 2 topics. But I guess even with 1 topic, the ordering can be altered… but probably less likely than with 2 topics. This is something that may be improved in a future version, though, from what I understood when checking internally…
