|
1 | 1 | import logging
|
2 | 2 |
|
3 | 3 | import msgpack
|
4 |
| -import sentry_kafka_schemas |
5 | 4 | from arroyo.backends.kafka.consumer import KafkaPayload
|
6 | 5 | from arroyo.dlq import InvalidMessage
|
7 | 6 | from arroyo.types import BrokerValue, Message
|
@@ -71,23 +70,12 @@ def process_simple_event_message(
|
71 | 70 | if isinstance(exc, Retriable):
|
72 | 71 | raise
|
73 | 72 |
|
74 |
| - # If no retriable exception was raised, check the schema to decide whether to DLQ |
| 73 | + # TODO: Remove this line once all topics (transactions, attachments, |
| 74 | + # user feedback) also have DLQs |
75 | 75 | default_topic = consumer_type_to_default_topic[consumer_type].value
|
76 |
| - |
77 |
| - # TODO: Currently, there is only a schema for ingest-events, so just continue to re-raise |
78 |
| - # the exception if it's a different topic. This can be removed once attachments and transactions |
79 |
| - # have schemas too. |
80 | 76 | if default_topic != "ingest-events":
|
81 | 77 | raise
|
82 | 78 |
|
83 |
| - codec = sentry_kafka_schemas.get_codec(default_topic) |
84 |
| - |
85 |
| - try: |
86 |
| - codec.decode(raw_payload, validate=True) |
87 |
| - except Exception: |
88 |
| - raw_value = raw_message.value |
89 |
| - assert isinstance(raw_value, BrokerValue) |
90 |
| - |
91 |
| - raise InvalidMessage(raw_value.partition, raw_value.offset) |
92 |
| - |
93 |
| - raise |
| 79 | + raw_value = raw_message.value |
| 80 | + assert isinstance(raw_value, BrokerValue) |
| 81 | + raise InvalidMessage(raw_value.partition, raw_value.offset) from exc |
0 commit comments