示例#1
0
          logging.info('CronPullFromTopicHandler invoked pull from subscription %s' % subscription)

          #find the subscription details for this subscription in the DS
          subsDS = get_subscription_dsentry_matched_to_subscription(subscription)
          
          exclude_filters = ''
          if subsDS !=None:
            #get any exclude filters
            exclude_filters = subsDS.exclude_filters.encode('utf8').split(",")
            #get destination topic
            destination_topic = buildDestinationTopic(subsDS.destination_project, subsDS.destination_topic)
            #process messages for this subscription
            subscription_pull_messages(subscription, exclude_filters, destination_topic)  
          else:
            logging.info('Could not find entry in DS matching subscription %s' % subscription)
      

Subscriptions.init()

check_and_create_subscriptions()

logging.getLogger().setLevel(logging.DEBUG)

app = webapp2.WSGIApplication([
    ('/cron_pullfromtopic', CronPullFromTopicHandler),
    ('/.*', PubSubHandler)    
    
], debug=True)