Пример #1
0
                def handlePreMessage(message, ackFunc=None):
                    try:
                        workflow.cancelTermination()
                        job = bxToObject(message)
                        if (workflow.getCache() != None
                                and workflow.getCache().hasCachedOutputs(job)):
                            workflow.setTaskInProgess(self.cacheManagerTask)
                            cachedOutputs = workflow.getCache(
                            ).getCachedOutputs(job)
                            workflow.setTaskWaiting(self.cacheManagerTask)
                            for outputJob in cachedOutputs:
                                if outputJob.getDestination() == 'Filtered':
                                    workflow.cancelTermination()
                                    workflow.getFiltered().send(
                                        outputJob, consumerId)
                        else:
                            self.sendMessage(
                                message, destQueue.getStompDestinationName())

                        if ackFunc != None:
                            ackFunc()

                    except Exception as ex:
                        traceback.print_exc()
                        exc_type, exc_value, exc_traceback = sys.exc_info()
                        stack = traceback.format_exception(
                            exc_type, exc_value, exc_traceback)
                        workflow.reportInternalException(ex, '', stack)
Пример #2
0
            def messageHandler(message, ackFunc=None):
                try:
                    line = bxToObject(message)
                    consumer.consumeLinesWithNotifications(line)

                    if ackFunc != None:
                        ackFunc()
                except Exception as ex:
                    traceback.print_exc()
                    exc_type, exc_value, exc_traceback = sys.exc_info()
                    stack = traceback.format_exception(exc_type, exc_value,
                                                       exc_traceback)
                    self.workflow.reportInternalException(ex, '', stack)
Пример #3
0
                def handleDestinationMessage(message, ackFunc=None):
                    try:
                        workflow.cancelTermination()
                        job = bxToObject(message)
                        if (workflow.getCache() !=
                                None) and (not job.isCached()):
                            if (job.isTransactional()):
                                workflow.getCache().cacheTransactionally(job)
                            else:
                                workflow.getCache().cache(job)
                        if (job.getIsTransactionSuccessMessage()):
                            return
                        self.sendMessage(message,
                                         postQueue.getStompDestinationName())

                        if ackFunc != None:
                            ackFunc()
                    except Exception as ex:
                        traceback.print_exc()
                        exc_type, exc_value, exc_traceback = sys.exc_info()
                        stack = traceback.format_exception(
                            exc_type, exc_value, exc_traceback)
                        workflow.reportInternalException(ex, '', stack)