csantanapr closed pull request #229: verify trigger fire responds with any 
successful status code
URL: https://github.com/apache/incubator-openwhisk-package-kafka/pull/229
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/provider/consumer.py b/provider/consumer.py
index b3af4b4..f28c524 100644
--- a/provider/consumer.py
+++ b/provider/consumer.py
@@ -353,8 +353,12 @@ def __fireTrigger(self, messages):
 
                     # Manually commit offset if the trigger was fired 
successfully. Retry firing the trigger
                     # for a select set of status codes
-                    if status_code == 200:
-                        logging.info("[{}] Fired trigger with activation 
{}".format(self.trigger, response.json()['activationId']))
+                    if status_code in range(200, 300):
+                        response_json = response.json()
+                        if 'activationId' in response_json and 
response_json['activationId'] is not None:
+                            logging.info("[{}] Fired trigger with activation 
{}".format(self.trigger, response_json['activationId']))
+                        else:
+                            logging.info("[{}] Successfully fired 
trigger".format(self.trigger))
                         # the consumer may have consumed messages that did not 
make it into the messages array.
                         # be sure to only commit to the messages that were 
actually fired.
                         
self.consumer.commit(offsets=self.__getOffsetList(messages), async=False)


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to