Pub/Sub

Pattern 1: Consumer.on(payload)

This pattern focuses on Consumer only. This pattern is mostly recommended in detailed design as when we do detailed design, we rarely care about how the data was published or pulled from the Queue.

The main points here are:

  1. hide the Queue (e.g. Kafka) from the diagram. You will find it difficult to place Kafka in this diagram.

  2. model Consumer instead of payload as the entry participant.

Pattern 2: Kafka.pull()

Sometimes we want to show the details around how data is made available to the consumer. Some Queues push data to consumers, some are using pulling model. Kafka use the latter pattern.