How to verify Kafkachannel persistence?

46 Views Asked by At

I am investigating the benefits of changing the channel implementation from inmemory to Kafka. I understand that inmemorychannel is not persistent and Kafkachannel is.

So I hypothesized that Kafkachannel would work like this:.

  1. When a channelPod (kafka- ch- dispatcher Pod) goes down before events registered through Kafkachannel are delivered to sink, the events registered before going down remain in Kafkatopic.
  2. When the kafka-ch-dispatcher recovers, any events in Kafkatopic that are not delivered to sink will be sent to sink.

To test this hypothesis, I killed the kafka-ch-dispatcher Pod after confirming that the events registered with Kafkatopic had not yet been delivered. As expected, Kafkatopic still had events. After waiting, however, the event was never delivered to sink.

Is my hypothesis wrong?

Or is the confirmation method wrong? (Is there a good way to verify Kafkachannel persistence?)

The channel and subsciption I use are as follows. I run them in knativetorial namespace.

# kubectl get cm -n knative-eventing default-ch-webhook -ojsonpath='{.data.default-ch-c
onfig}'
clusterDefault:
  apiVersion: messaging.knative.dev/v1alpha1
  kind: InMemoryChannel
namespaceDefaults:
  knativetutorial:
    apiVersion: messaging.knative.dev/v1alpha1
    kind: KafkaChannel
    spec:
      numPartitions: 1
      replicationFactor: 1

# cat channel_svc.yaml
apiVersion: messaging.knative.dev/v1beta1
kind: Channel
metadata:
  name: event-display-ch

# cat event-display-sub-retry_svc.yaml
apiVersion: messaging.knative.dev/v1beta1
kind: Subscription
metadata:
  name: event-display-sub
spec:
  channel:
    apiVersion: messaging.knative.dev/v1beta1
    kind: Channel
    name: event-display-ch
  delivery:
    backoffDelay: PT1.0S
    backoffPolicy: linear
    retry: 10
    deadLetterSink:
      ref:
        apiVersion: v1
        kind: Service
        name: event-dead
  subscriber:
    ref:
      apiVersion: v1
      kind: Service
      name: event-display
0

There are 0 best solutions below