Is it possible for message offset to occur after production?

In most queuing systems, a class that acts as a producer cannot do this; its role is to trigger and forget the message. The broker does the rest of the work, such as proper metadata processing with ids, offsets, and so on.

As a message user, you can download from Kafka

Compensation is obtained in the broker. If you look at the SimpleConsumer class, you’ll notice that it gets the MultiFetchResponse object that includes the offsets as a list. In addition, when you iterate over a Kafka message, you have a MessageAndOffset object that includes offsets and message sending.