# 1 Schema 2 ids. Is it possible?

**URL:** <https://forum.confluent.io/t/1-schema-2-ids-is-it-possible/4610>\
**Category:** Schema Registry\
**Created:** [28 March 2022 13:30 UTC](https://forum.confluent.io/t/1-schema-2-ids-is-it-possible/4610 "2022-03-28T13:30:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![meirs84](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/meirs84/32/1743_2.png) [@meirs84](https://forum.confluent.io/u/meirs84)\
**Post date:** [28 March 2022 13:30 UTC](https://forum.confluent.io/t/1-schema-2-ids-is-it-possible/4610/1 "2022-03-28T13:30:38Z")

</div>

We currently have an issue where because of a surge in the kafka broker, schema registry has returned an id for a message to the serializer even though it failed publishing it to the \_schemas topic.  
afterwards another publisher published the schema and gained a successfully stored schema id.  
so currently we have messages in kafka topics where the same schema message contains 2 different ids.  
1 which doesn’t exist in the schema registry (which means it keeps failing the consumer on the other side) and 1 that doesn’t.  
what i want to do is to publish the same schema with the failed id so it will be fetched by the deserializer but it seems like we can’t do that.

`io.confluent.rest.exceptions.RestException: Schema already registered with id 52 instead of input id 28; error code: 42207`

the schema registry even when using the schema client register with a designated id still checks the schema for an existing saved schema record and aborts the register command.

is there anything we can do about that?

i even tried storing it to a different subject and it was futile.

Any assistance would be greatly appreciated  
Meir Shmaiovitch.

---

<div class="post-metadata">

**Author:** ![ryokota](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/ryokota/32/3901_2.png) [@ryokota](https://forum.confluent.io/u/ryokota)\
**Post date:** [29 March 2022 19:14 UTC](https://forum.confluent.io/t/1-schema-2-ids-is-it-possible/4610/2 "2022-03-29T19:14:02Z")

</div>

It sounds like you are using IMPORT mode to register the schema. You can try altering the schema slightly in a way that it is still semantically the same. For example, if it is Avro, add or modify a doc field. If it is JSON, add or modify a title field. If it is Protobuf, reorder the imports, etc.

---

<div class="post-metadata">

**Author:** ![meirs84](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/meirs84/32/1743_2.png) [@meirs84](https://forum.confluent.io/u/meirs84)\
**Post date:** [30 March 2022 09:02 UTC](https://forum.confluent.io/t/1-schema-2-ids-is-it-possible/4610/3 "2022-03-30T09:02:51Z")

</div>

@ryokota thanks for your reply  
we use protobuff and the question is would it break backwards compatibility if we reorder the fields?  
Also any idea why does schema registry do not allow writing a schema with 2 different ids?

---

<div class="post-metadata">

**Author:** ![OneCricketeer](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.confluent.io/onecricketeer/32/1551_2.png) [@OneCricketeer](https://forum.confluent.io/u/OneCricketeer)\
**Post date:** [31 March 2022 19:54 UTC](https://forum.confluent.io/t/1-schema-2-ids-is-it-possible/4610/4 "2022-03-31T19:54:11Z")

</div>

> writing a schema with 2 different ids

The schema text is hashed when compared, and therefore has a unique fingerprint, separate from the ID. Uploading the same schema should generate the same ID.
