|
7 | 7 | from confluent_kafka import Message |
8 | 8 |
|
9 | 9 | from app.dlq.models import ( |
10 | | - DLQBatchRetryResult, |
11 | 10 | DLQFields, |
12 | 11 | DLQMessage, |
13 | 12 | DLQMessageFilter, |
14 | 13 | DLQMessageStatus, |
15 | 14 | DLQMessageUpdate, |
16 | | - DLQRetryResult, |
17 | 15 | ) |
18 | 16 | from app.events.schema.schema_registry import SchemaRegistryManager |
19 | 17 | from app.infrastructure.kafka.events import BaseEvent |
@@ -147,44 +145,6 @@ def from_kafka_message(message: Message, schema_registry: SchemaRegistryManager) |
147 | 145 | dlq_partition=partition if partition >= 0 else None, |
148 | 146 | ) |
149 | 147 |
|
150 | | - @staticmethod |
151 | | - def to_response_dict(message: DLQMessage) -> dict[str, object]: |
152 | | - return { |
153 | | - "event_id": message.event_id, |
154 | | - "event_type": message.event_type, |
155 | | - "event": message.event.to_dict(), |
156 | | - "original_topic": message.original_topic, |
157 | | - "error": message.error, |
158 | | - "retry_count": message.retry_count, |
159 | | - "failed_at": message.failed_at, |
160 | | - "status": message.status, |
161 | | - "age_seconds": message.age_seconds, |
162 | | - "producer_id": message.producer_id, |
163 | | - "dlq_offset": message.dlq_offset, |
164 | | - "dlq_partition": message.dlq_partition, |
165 | | - "last_error": message.last_error, |
166 | | - "next_retry_at": message.next_retry_at, |
167 | | - "retried_at": message.retried_at, |
168 | | - "discarded_at": message.discarded_at, |
169 | | - "discard_reason": message.discard_reason, |
170 | | - } |
171 | | - |
172 | | - @staticmethod |
173 | | - def retry_result_to_dict(result: DLQRetryResult) -> dict[str, object]: |
174 | | - d: dict[str, object] = {"event_id": result.event_id, "status": result.status} |
175 | | - if result.error: |
176 | | - d["error"] = result.error |
177 | | - return d |
178 | | - |
179 | | - @staticmethod |
180 | | - def batch_retry_result_to_dict(result: DLQBatchRetryResult) -> dict[str, object]: |
181 | | - return { |
182 | | - "total": result.total, |
183 | | - "successful": result.successful, |
184 | | - "failed": result.failed, |
185 | | - "details": [DLQMapper.retry_result_to_dict(d) for d in result.details], |
186 | | - } |
187 | | - |
188 | 148 | # Domain construction and updates |
189 | 149 | @staticmethod |
190 | 150 | def from_failed_event( |
|
0 commit comments