CQRS Pattern - > implemented completed.
This commit is contained in:
@@ -9,6 +9,7 @@ order-service:
|
||||
payment-response-topic-name: payment-response-value
|
||||
restaurant-approval-request-topic-name: restaurant-approval-request-value
|
||||
restaurant-approval-response-topic-name: restaurant-approval-response-value
|
||||
customer-topic-name: customer
|
||||
outbox-scheduler-fixed-rate: 10000
|
||||
outbox-scheduler-initial-delay: 10000
|
||||
|
||||
@@ -54,6 +55,7 @@ kafka-consumer-config:
|
||||
value-deserializer: io.confluent.kafka.serializers.KafkaAvroDeserializer
|
||||
payment-consumer-group-id: payment-topic-consumer
|
||||
restaurant-approval-consumer-group-id: restaurant-approval-topic-consumer
|
||||
customer-group-id: customer-topic-consumer
|
||||
auto-offset-reset: earliest
|
||||
specific-avro-reader-key: specific.avro.reader
|
||||
specific-avro-reader: true
|
||||
|
||||
@@ -36,9 +36,9 @@ CREATE TABLE "order".order_items
|
||||
|
||||
ALTER TABLE "order".order_items
|
||||
ADD CONSTRAINT "FK_ORDER_ID" FOREIGN KEY (order_id)
|
||||
REFERENCES "order".orders (id) MATCH SIMPLE
|
||||
ON UPDATE NO ACTION
|
||||
ON DELETE CASCADE
|
||||
REFERENCES "order".orders (id) MATCH SIMPLE
|
||||
ON UPDATE NO ACTION
|
||||
ON DELETE CASCADE
|
||||
NOT VALID;
|
||||
|
||||
DROP TABLE IF EXISTS "order".order_address CASCADE;
|
||||
@@ -55,17 +55,16 @@ CREATE TABLE "order".order_address
|
||||
|
||||
ALTER TABLE "order".order_address
|
||||
ADD CONSTRAINT "FK_ORDER_ID" FOREIGN KEY (order_id)
|
||||
REFERENCES "order".orders (id) MATCH SIMPLE
|
||||
ON UPDATE NO ACTION
|
||||
ON DELETE CASCADE
|
||||
REFERENCES "order".orders (id) MATCH SIMPLE
|
||||
ON UPDATE NO ACTION
|
||||
ON DELETE CASCADE
|
||||
NOT VALID;
|
||||
|
||||
DROP TYPE IF EXISTS saga_status;
|
||||
CREATE TYPE saga_status AS ENUM ('STARTED','FAILED','SUCCEEDED','PROCESSING', 'COMPENSATING','COMPENSATED');
|
||||
CREATE TYPE saga_status AS ENUM ('STARTED', 'FAILED', 'SUCCEEDED', 'PROCESSING', 'COMPENSATING', 'COMPENSATED');
|
||||
|
||||
DROP TYPE IF EXISTS outbox_status;
|
||||
CREATE TYPE outbox_status AS ENUM ('STARTED','COMPLETED','FAILED');
|
||||
|
||||
CREATE TYPE outbox_status AS ENUM ('STARTED', 'COMPLETED', 'FAILED');
|
||||
|
||||
DROP TABLE IF EXISTS "order".payment_outbox CASCADE;
|
||||
|
||||
@@ -88,10 +87,9 @@ CREATE INDEX "payment_outbox_saga_status"
|
||||
ON "order".payment_outbox
|
||||
(type, outbox_status, saga_status);
|
||||
|
||||
CREATE UNIQUE INDEX "payment_outbox_saga_id"
|
||||
ON "order".payment_outbox
|
||||
(type, saga_id, saga_status);
|
||||
|
||||
--CREATE UNIQUE INDEX "payment_outbox_saga_id"
|
||||
-- ON "order".payment_outbox
|
||||
-- (type, saga_id, saga_status);
|
||||
|
||||
DROP TABLE IF EXISTS "order".restaurant_approval_outbox CASCADE;
|
||||
|
||||
@@ -114,6 +112,17 @@ CREATE INDEX "restaurant_approval_outbox_saga_status"
|
||||
ON "order".restaurant_approval_outbox
|
||||
(type, outbox_status, saga_status);
|
||||
|
||||
CREATE UNIQUE INDEX "restaurant_approval_outbox_saga_id"
|
||||
ON "order".restaurant_approval_outbox
|
||||
(type, saga_id, saga_status);
|
||||
--CREATE UNIQUE INDEX "restaurant_approval_outbox_saga_id"
|
||||
-- ON "order".restaurant_approval_outbox
|
||||
-- (type, saga_id, saga_status);
|
||||
|
||||
DROP TABLE IF EXISTS "order".customers CASCADE;
|
||||
|
||||
CREATE TABLE "order".customers
|
||||
(
|
||||
id uuid NOT NULL,
|
||||
username character varying COLLATE pg_catalog."default" NOT NULL,
|
||||
first_name character varying COLLATE pg_catalog."default" NOT NULL,
|
||||
last_name character varying COLLATE pg_catalog."default" NOT NULL,
|
||||
CONSTRAINT customers_pkey PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user