## protocols.eventsub.DLQSubscriberProtocol

<span id="hexkit.protocols.eventsub.DLQSubscriberProtocol"></span>


A protocol for consuming events from an event broker with the header data included.


Usage

``` python
protocols.eventsub.DLQSubscriberProtocol()
```


In addition to the methods described below, implementations shall expose the the following attributes:


## Classes

| Name | Description |
|----|----|
| [MalformedPayloadError](#MalformedPayloadError) | Raised if the payload of a received event was not formatted as expected given |

<span id="MalformedPayloadError"></span>

<span id="hexkit.protocols.eventsub.DLQSubscriberProtocol.MalformedPayloadError"></span>


#### MalformedPayloadError


Raised if the payload of a received event was not formatted as expected given


Usage

``` python
MalformedPayloadError()
```


the type.


## Methods

| Name | Description |
|----|----|
| [consume()](#consume) | Receive an event of interest and process it according to its type. |

<span id="hexkit.protocols.eventsub.DLQSubscriberProtocol.consume"></span>


#### consume()


Receive an event of interest and process it according to its type.


Usage

``` python
consume(*, payload, type_, topic, key, event_id, timestamp, headers)
```


##### Parameters


`payload: JsonObject`  
The data/payload to send with the event.

`type_: Ascii`  
The type of the event.

`topic: Ascii`  
Name of the topic the event was published to.

`key: Ascii`  
A key used for routing the event.

`event_id: UUID4`  
The unique identifier of the event.

`timestamp: datetime`  
The timestamp assigned by either the publisher or the broker.

`headers: Mapping[str, str]`  
The event headers containing important metadata.
