I am using Kafka AVRO + Schema registry and generating the pojo entities with the avro-maven-plugin to be able to take advantage of the deserialization of incoming messages. The problem I am having is that, in addition to the Message Producer being on a remote server, each environment (DEV, STG and PRD) has its own different Schema for the same topics, since the names of the topics also change per environment. So when consuming them I have my AVRO entities generated from the DEV schema, and it only works for that environment, since the namespace and name of the topics, as I said before, change by environment. How can I solve this without having to generate AVRO entities for each environment?
For example the names of the topics in the environments:
DEV:
kafka.finance.sourcedb.uutl3.credit-value
kafka.finance.sourcedb.uutl3.debit-value
STG:
kafka.finance.sourcedb.sual3.credit-value
kafka.finance.sourcedb.sual3.debit-value
PRD:
kafka.finance.sourcedb.puas2.CRD050-value
kafka.finance.sourcedb.puas2.DEB051-value
I hope it was understood.
Here I saw that you can define an alias to the .avsc files, but I don't know if this really solves the problem.