Skip to content

Wrong message ordering through proxy with encryption enabled #838

@giacomoa

Description

@giacomoa

Consuming messages through proxy with encryption enabled results in random ordered messages and also seems to be some issues with timestamp in decrypted messages.

To Reproduce
Steps to reproduce the behavior:

  1. Run the example described here: https://github.com/kroxylicious/kroxylicious/blob/main/kubernetes-examples/envelope-encryption/README.md until step 6:
echo "ibm: 99" | kaf -b minikube:30192 produce trades
  1. Send some other message through proxy
echo "ibm: 88" | kaf -b minikube:30192 produce trades
echo "ibm: 77" | kaf -b minikube:30192 produce trades
  1. Consume messages through proxy:
# kaf -b minikube:30192 consume trades
Partition:   0
Offset:      0
Timestamp:   2023-12-20 17:17:35.829 +0100 CET
ibm: 99
Partition:   0
Offset:      1
Timestamp:   2023-12-20 17:18:34.859 +0100 CET
ibm: 77  # **wrong order, it's actually at offset 2**
Partition:   0
Offset:      2
Timestamp:   2023-12-20 17:18:29.44 +0100 CET
ibm: 88   # **wrong order, it's actually at offset 1**
  1. Repeat step 2. and 3.

Expected behavior
Consumed messaged are ordered like produced with correct timestamp (i have only 1 partition in Kafka topic).

Actual behavior
Each consume action results in a different order (often wrong) and if I send two times the same message (with different timestamp) they appear with the same timestamp (and wrong order) when consuming through proxy

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions