In-memory channels are a best effort Channel. They should NOT be used in Production. They are useful for development.
They differ from most Channels in that they have:
- No persistence.
- If a Pod goes down, messages go with it.
- No ordering guarantee.
- There is nothing enforcing an ordering, so two messages that arrive at the same time may go downstream in any order.
- Different downstream subscribers may see different orders.
- No redelivery attempts.
- If downstream rejects a request, a log message is written, but that request is never sent again.
Setup Knative Eventing.
Apply the 'in-memory-channel' ClusterChannelProvisioner, Controller, and Dispatcher.
ko apply -f config/provisioners/in-memory-channel/in-memory-channel.yaml
Create Channels that reference the 'in-memory-channel'.
apiVersion: eventing.knative.dev/v1alpha1 kind: Channel metadata: name: foo spec: provisioner: apiVersion: eventing.knative.dev/v1alpha1 kind: ClusterChannelProvisioner name: in-memory-channel
The major components are:
- ClusterChannelProvisioner Controller
- Channel Controller
- Channel Dispatcher
- Channel Dispatcher Config Map.
The ClusterChannelProvisioner Controller and the Channel Controller are colocated in one Pod.
kubectl get deployment -n knative-eventing in-memory-channel-controller
The Channel Dispatcher receives and distributes all events. There is a single Dispatcher for all in-memory Channels.
kubectl get deployment -n knative-eventing in-memory-channel-dispatcher
The Channel Dispatcher Config Map is used to send information about Channels and Subscriptions from the Channel Controller to the Channel Dispatcher.
kubectl get configmap -n knative-eventing in-memory-channel-dispatcher-config-map