def assert_order_ready_for_fulfillment(self, last_event_type, order_id): # Check if order in correct state if last_event_type == str(OrderEventType.OrderSubmitted): return # Order is already Fulfilled, so skip if last_event_type == str(OrderEventType.OrderFulfilled): raise SkipMessage(f"Order {order_id} already fulfilled") raise Nack(4) # TODO Move to a config var see dinos PR
def validate_processing_limit(self, message): if self.max_processing_attempts and message.approximate_receive_count > self.max_processing_attempts: raise SkipMessage( "Message exceeded maximum of {max} processing attempts. Skipping", extra=dict(max=self.max_processing_attempts), )
def handler(message): raise SkipMessage("ignorance is bliss")
def skipping_handler(message): raise SkipMessage("Failed")