Need cloud computing? Get started now

What Is an Event Consumer?

An event consumer is a component of event-driven architecture (EDA). Event consumers are applications, services, devices, or people that subscribe to a channel that provides immediate information about events. Events are a change in state of information, processes, or key business systems. They are actions that may happen inside, outside, or to an organization, including things like new customer transactions, changes in inventory, security breaches, emails received, items added to a shopping cart, the completion of a workflow, and many more.

When event consumers are notified about an event, they can respond by performing some kind of action. Responses may range from sending an email alert or processing user inputs to triggering workflows or initiating new events. A single EDA application can have multiple event consumers waiting to receive information about a wide range of events. Common event consumers include billing systems, notification engines, CRM platforms, microservices, and banking systems.

What is event-driven architecture?

Diagram illustrating event-driven architecture and the event consumer component. Diagram illustrating event-driven architecture and the event consumer component.

Event-driven architecture is a software design pattern that makes it possible for systems to detect, process, respond to and share information about events in real time. The greatest benefit of EDA systems is their ability to communicate data as soon as an event happens, enabling event consumers to take immediate action.

One of the most important aspects of event-driven architecture is that the systems that generate and act on events are decoupled or loosely coupled. A system that consumes events, for example, is not interdependent with systems that produce events and does not need to know where the information is coming from. This means that the failure of one service will not cause problems or disruption to other services.

Asynchronous messaging is another important characteristic of EDA. Rather than communicating with a “request and response” model — in which systems must wait for a response before taking action — the components in event-driven architecture communicate asynchronously, moving forward without waiting to hear from other components. This enables EDA systems to excel at real-time processing and at handling massive amounts of data rapidly, since components can react to events and process data immediately.

What is the role of an event consumer in EDA?

An event consumer is one of several key elements of event-driven architecture. EDA components include:

  • Events: Events are a signal that something has happened, or a change in state.
  • Event producers: Event producers are systems like IoT devices, user interfaces, databases, external APIs, workflow engines, cloud services, application monitors, and other technologies that generate and communicate events.
  • Event messages: Event messages, or event notifications, contain information about an event. They are typically in JSON or YAML.
  • Event consumers: Also known as event subscribers, event consumers “listen to” or receive information about events and initiate actions based on information received. Event consumers may perform tasks like alerting security teams to potential breaches, updating inventory levels, sending confirmation emails to customers, or triggering a workflow.
  • Event routers: Event routers enable asynchronous messaging and loosely coupled architecture by acting as an intermediary between producers and consumers. Routers may be event buses, message queues, event brokers, or event streams that receive event data from producers and pass it on to consumers that have subscribed to specific event channels.
  • Event processors: Event processors manage the event data received by event consumers, applying rules that initiate new events, launch tasks, or perform actions. Event processors also route, filter, and transform event data.

What is the benefit of using event consumers?

Every organization, business operation, and business process is driven by and impacted by events. The sooner that organizations can be notified and respond to events, the greater their gains are in efficiency, productivity, and competitiveness. Using event consumers and event-driven architecture enables organizations to instantly be notified of events and immediately take action that can benefit a business and its customers.

Event-driven architecture enables organizations to:

  • Process data in real time. In EDA, asynchronous messaging means that components can communicate and process events as soon as they occur without having to wait for responses.
  • Respond quickly to real-life events. Event-driven architecture improves responsiveness by automatically and instantly performing actions when events occur.
  • Scale easily. Because EDA components are decoupled or loosely coupled, individual components can scale up or down independently as workloads demand.
  • Reduce downtime. EDA increases resiliency and fault tolerance by enabling other components to continue functioning even when one service or system is experiencing issues.
  • Improve integration and interoperability. The decoupled or loosely coupled nature of event-based communication makes it easier for diverse systems to work together and share information.
  • Increase speed. EDA can speed up your systems because different components don’t have to wait for each other.

How do event consumers receive events?

There are two primary models for publishing and consuming events.

Publish/subscribe (pub/sub)

In this model, also known as the event messaging model, event consumers subscribe to various topics, electing to receive information about specific events. When an event producer publishes an event, the information is sent to an event broker that translates or transforms the information if needed, queues and stores the data, and sends messages onto event consumers. After messages are received by consumers, they are deleted by the broker.

Well-known pub/sub services include Apache Kafka, Confluent, Amazon’s Simple Notification Service (SNS), Amazon’s Simple Queue Service (SQS), Azure Web Pub/Sub, and GCP’s Pub/Sub.

 

Event streaming model

In this approach, event consumers subscribe to streaming event messages sent to brokers by event producers. In contrast to pub/sub, messages are persistent, meaning they are stored and kept for a period of time. This means consumers can enter a stream at any time and access event messages retroactively. Consumers may also be configured to receive just certain events from the stream, rather than receiving all published messages as is the case with pub/sub. The event streaming model also enables complex event processing, in which event consumers ingest and initiate actions based on information in a series of events.

Companies that provide event streaming include AWS EventBridge, AWS Kinesis, Azure Stream Analytics, GCP Dataflow, and Apache Beam.

What kinds of events do event consumers subscribe to?

Event consumers ingest and act upon a wide range of event data.

  • Ecommerce: Event-driven architecture is a pillar of ecommerce systems in which immediate responses to customer actions are essential to providing a seamless experience.
  • Cybersecurity: Event consumers can process security events in real time to provide security teams with alerts, block malicious files, or quarantine suspicious traffic.
  • Microservices: EDA is an ideal architecture for communication between microservices because of its decoupled communication, modularity, scalability, and fault tolerance.
  • Data analytics: Many event consumers process and analyze real-time data to uncover patterns and derive insight from massive amounts of data. Fraud detection systems are a common example of EDA technology that’s designed to flag anomalies in financial transactions.
  • Monitoring: EDA systems are ideal for monitoring the health of system resources and alerting system administrators when predictive maintenance or urgent intervention is needed.
  • Internet of Things (IoT): The massive amounts of data produced by IoT devices can be easily ingested and monitored by EDA systems to provide real-time monitoring and analysis.
  • Stock market: Event consumers in the trading industry are critical to automated trading strategies that execute buy/sell orders based on rapidly changing conditions and events within the stock market.
  • Workflow: EDA systems enable automated workflows by triggering processes and tasks based on a broad range of events.

Frequently Asked Questions (FAQ)

The terms “event consumer,” “event listener,” and “event subscriber” are often considered synonymous. However, some consider “event consumer” to be a broader term that applies to any system that processes events, while “event subscriber” is typically used when describing event brokers and event channels, and “event listener” is often used in connection with programming frameworks or libraries.

Event consumers are configured in a variety of ways, depending on the specific technology stack, messaging platform, or framework that is deployed. Organizations may configure event consumers in middleware and messaging systems like Apache Kafka, RabbitMQ, and AWS SNS/SQS; in programming frameworks like Spring, .NET, or node.JS libraries; in cloud platforms like AWS Lambda and Azure Functions; in container orchestration platforms like Kubernetes; or in platforms like Drupal, Symfony, and Microsoft Dynamics 365 Business Central.

Why customers choose Akamai

Akamai is the cybersecurity and cloud computing company that powers and protects business online. Our market-leading security solutions, superior threat intelligence, and global operations team provide defense in depth to safeguard enterprise data and applications everywhere. Akamai’s full-stack cloud computing solutions deliver performance and affordability on the world’s most distributed platform. Global enterprises trust Akamai to provide the industry-leading reliability, scale, and expertise they need to grow their business with confidence.

Explore all Akamai security solutions