def _receive_tile_requests_kafka(self, response, now, ttl):
        messages_decoded = []
        for item in response:
            offset, message = item
            message_decoded = self._codec.decode_channel(message.value)
            itempart = message_decoded.split(";")
            date = parse_date(itempart[0])
            if not date:
                print "Date is missing or invalid!"
            elif is_expired(date, now, ttl):
                # print "Tile expired!"
                continue
            else:
                messages_decoded.append(itempart[1])  # Covert to dict within client application

        return messages_decoded
Exemple #2
0
    def _receive_tile_requests_kafka(self, response, now, ttl):
        messages_decoded = []
        for item in response:
            offset, message = item
            message_decoded = self._codec.decode_channel(message.value)
            itempart = message_decoded.split(";")
            date = parse_date(itempart[0])
            if not date:
                print "Date is missing or invalid!"
            elif is_expired(date, now, ttl):
                # print "Tile expired!"
                continue
            else:
                messages_decoded.append(
                    itempart[1])  # Covert to dict within client application

        return messages_decoded
    def _receive_tile_requests_kinesis(self, response, now, ttl):
        self._channel._shard_it = response[u'NextShardIterator']
        messages_decoded = []
        for item in response[u'Records']:
            # partition_key = item[u'PartitionKey']
            message = item[u'Data']
            message_decoded = self._codec.decode_channel(message)
            itempart = message_decoded.split(";")
            date = parse_date(itempart[0])
            if not date:
                print "Date is missing or invalid!"
            elif is_expired(date, now, ttl):
                # print "Tile expired!"
                continue
            else:
                messages_decoded.append(itempart[1])  # Covert to dict within client application

        return messages_decoded
Exemple #4
0
    def _receive_tile_requests_kinesis(self, response, now, ttl):
        self._channel._shard_it = response[u'NextShardIterator']
        messages_decoded = []
        for item in response[u'Records']:
            # partition_key = item[u'PartitionKey']
            message = item[u'Data']
            message_decoded = self._codec.decode_channel(message)
            itempart = message_decoded.split(";")
            date = parse_date(itempart[0])
            if not date:
                print "Date is missing or invalid!"
            elif is_expired(date, now, ttl):
                # print "Tile expired!"
                continue
            else:
                messages_decoded.append(
                    itempart[1])  # Covert to dict within client application

        return messages_decoded