Skip to content

Commit 02b7edc

Browse files
committed
bugfix: handling when success properties not set
1 parent d7bdab7 commit 02b7edc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

emf/common/integrations/rabbit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ def _process_messages(self, basic_deliver, properties, body):
262262
try:
263263
logger.info(f"Handling message with handler: {message_handler.__class__.__name__}")
264264
body, properties = message_handler.handle(body, properties=properties, channel=None)
265-
if not properties.headers['success']: # stop processing next handlers if message success was set to false
265+
if not properties.headers.get('success', True): # stop processing next handlers if message success was set to false
266266
break
267267

268268
except Exception as error:
@@ -582,7 +582,7 @@ def _process_messages(self, basic_deliver, properties, body):
582582
for message_handler in self.message_handlers:
583583
logger.info(f"Handling message with handler: {message_handler.__class__.__name__}")
584584
body, properties = message_handler.handle(body, properties=properties, channel=self._channel)
585-
if not properties.headers['success']: # stop processing next handlers if message success was set to false
585+
if not properties.headers.get('success', True): # stop processing next handlers if message success was set to false
586586
break
587587
except Exception as error:
588588
logger.error(f"Message handling failed: {error}", exc_info=True)

0 commit comments

Comments
 (0)