static Message<? extends com.google.protobuf.Message> fromKafka(com.google.protobuf.Message protoMessage, Envelope envelope, ConsumerRecord<String, byte[]> record) {
boolean wasReceived = true;
Topic topic = new Topic(record.topic());
String partitioningKey = record.key();
int partitionId = record.partition();
long offset = record.offset();
String messageId = envelope.getMessageId();
String correlationId = envelope.getCorrelationId();
MessageType type = MessageType.of(protoMessage);
String requestCorrelationId = envelope.getRequestCorrelationId();
Topic replyTo = new Topic(envelope.getReplyTo());
Metadata meta = new Metadata(wasReceived, topic, partitioningKey, partitionId, offset, messageId, correlationId, requestCorrelationId, replyTo, type);
return new Message<>(protoMessage, meta);
}