Пример #1
0
    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
Пример #2
0
 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),
         )
Пример #3
0
 def handler(message):
     raise SkipMessage("ignorance is bliss")
Пример #4
0
def skipping_handler(message):
    raise SkipMessage("Failed")