Example #1
0
 def __init__(self):
     # logging.info("[InventoryConsumer] - Initializing the consumer")
     print("[InventoryConsumer] - Initializing the consumer")
     self.cloudEvent_schema = avroUtils.getCloudEventSchema()
     self.store = InventoryDataStore()
     self.kafkaconsumer = KafkaAvroConsumer(
         'InventoryConsumer', json.dumps(self.cloudEvent_schema.to_json()),
         EventBackboneConfig.getInventoryTopicName(),
         EventBackboneConfig.getConsumerGroup(), AUTO_COMMIT)
 def __init__(self, inventoryStore, reeferStore, transportationStore):
     print("[OrderConsumer] - Initializing the consumer")
     self.debugOptimization = self.debugOptimization()
     self.orderStore = OrderDataStore.getInstance()
     self.reeferStore = reeferStore
     self.inventoryStore = inventoryStore
     self.transporationStore = transportationStore
     self.kafkaconsumer = KafkaAvroCDCConsumer(
         'OrderConsumer', EventBackboneConfig.getOrderTopicName(),
         EventBackboneConfig.getConsumerGroup(), AUTO_COMMIT)
     # Avro data schemas location
     self.schemas_location = "/app/data/avro/schemas/"
     # CloudEvent Schema
     self.cloudEvent_schema = avroUtils.getCloudEventSchema()
     # Build the Kafka Avro Producers
     self.kafkaproducer = KafkaAvroProducer(
         "OrderConsumer", json.dumps(self.cloudEvent_schema.to_json()),
         "VOO-ShipmentPlan")