-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add concurrent environment for testing with multiple instances and
logging improvements
- Loading branch information
Showing
14 changed files
with
407 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
COMPOSE_PROJECT_NAME=evdobe-event-listener | ||
TIME_ZONE=Europe/Athens | ||
HTTP_PORT=9501 | ||
MESSAGE_BROKER_HOST=kafka | ||
MESSAGE_BROKER_PORT=29092 | ||
MESSAGE_CONSUMER_GROUP=my-event-listener | ||
EVENT_CHANNEL_1=my-event-channel | ||
EVENT_CHANNEL_2=another-channel | ||
EVENT_CHANNEL_3=third-channel | ||
EVENT_CHANNELS=" | ||
${EVENT_CHANNEL_1};\Application\Messaging\Impl\HeaderNameFilter|submitted|deleted;\Application\Messaging\Plugin\ExampleTranslator1 | ||
${EVENT_CHANNEL_2};\Application\Messaging\Plugin\InvalidFilter;\Application\Messaging\Plugin\ExampleTranslator2 | ||
${EVENT_CHANNEL_3} | ||
" | ||
INVALID_CHANNEL=global.invalid | ||
MESSAGE_TOPICS=" | ||
${EVENT_CHANNEL_1}:1:1 | ||
${EVENT_CHANNEL_2}:1:1 | ||
${INVALID_CHANNEL}:1:1 | ||
${EVENT_CHANNEL_3}:1:1 | ||
" | ||
STORE_DB_USER=adbuser | ||
STORE_DB_PASSWORD=adbpass | ||
STORE_DB_NAME=eventstore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,196 @@ | ||
services: | ||
event-listener-1: | ||
build: ../cont/event-listener | ||
environment: | ||
HOST_GID: ${HOST_UID} | ||
HOST_UID: ${HOST_UID} | ||
HTTP_PORT: ${HTTP_PORT} | ||
TZ: ${TIME_ZONE} | ||
AUTORELOAD_PROGRAMS: "swoole" | ||
AUTORELOAD_ANY_FILES: 0 | ||
MESSAGE_BROKER_HOST: kafka-1 | ||
MESSAGE_BROKER_PORT: ${MESSAGE_BROKER_PORT} | ||
MESSAGE_CONSUMER_GROUP: ${MESSAGE_CONSUMER_GROUP} | ||
EVENT_CHANNELS: ${EVENT_CHANNELS} | ||
INVALID_CHANNEL: ${INVALID_CHANNEL} | ||
STORE_DB_HOST: db | ||
STORE_DB_USER: ${STORE_DB_USER} | ||
STORE_DB_PASSWORD: ${STORE_DB_PASSWORD} | ||
STORE_DB_NAME: ${STORE_DB_NAME} | ||
expose: | ||
- ${HTTP_PORT} | ||
ports: | ||
- 9501:${HTTP_PORT} | ||
volumes: | ||
- ../../../../dev:/var/www | ||
depends_on: | ||
- kafka-1 | ||
- db | ||
event-listener-2: | ||
build: ../cont/event-listener | ||
environment: | ||
HOST_GID: ${HOST_UID} | ||
HOST_UID: ${HOST_UID} | ||
HTTP_PORT: ${HTTP_PORT} | ||
TZ: ${TIME_ZONE} | ||
AUTORELOAD_PROGRAMS: "swoole" | ||
AUTORELOAD_ANY_FILES: 0 | ||
MESSAGE_BROKER_HOST: kafka-2 | ||
MESSAGE_BROKER_PORT: ${MESSAGE_BROKER_PORT} | ||
MESSAGE_CONSUMER_GROUP: ${MESSAGE_CONSUMER_GROUP} | ||
EVENT_CHANNELS: ${EVENT_CHANNELS} | ||
INVALID_CHANNEL: ${INVALID_CHANNEL} | ||
STORE_DB_HOST: db | ||
STORE_DB_USER: ${STORE_DB_USER} | ||
STORE_DB_PASSWORD: ${STORE_DB_PASSWORD} | ||
STORE_DB_NAME: ${STORE_DB_NAME} | ||
expose: | ||
- ${HTTP_PORT} | ||
ports: | ||
- 9502:${HTTP_PORT} | ||
volumes: | ||
- ../../../../dev:/var/www | ||
depends_on: | ||
- kafka-2 | ||
- db | ||
event-listener-3: | ||
build: ../cont/event-listener | ||
environment: | ||
HOST_GID: ${HOST_UID} | ||
HOST_UID: ${HOST_UID} | ||
HTTP_PORT: ${HTTP_PORT} | ||
TZ: ${TIME_ZONE} | ||
AUTORELOAD_PROGRAMS: "swoole" | ||
AUTORELOAD_ANY_FILES: 0 | ||
MESSAGE_BROKER_HOST: kafka-3 | ||
MESSAGE_BROKER_PORT: ${MESSAGE_BROKER_PORT} | ||
MESSAGE_CONSUMER_GROUP: ${MESSAGE_CONSUMER_GROUP} | ||
EVENT_CHANNELS: ${EVENT_CHANNELS} | ||
INVALID_CHANNEL: ${INVALID_CHANNEL} | ||
STORE_DB_HOST: db | ||
STORE_DB_USER: ${STORE_DB_USER} | ||
STORE_DB_PASSWORD: ${STORE_DB_PASSWORD} | ||
STORE_DB_NAME: ${STORE_DB_NAME} | ||
expose: | ||
- ${HTTP_PORT} | ||
ports: | ||
- 9503:${HTTP_PORT} | ||
volumes: | ||
- ../../../../dev:/var/www | ||
depends_on: | ||
- kafka-3 | ||
- db | ||
|
||
zookeeper-1: | ||
image: evdobe/kafka:strimzi-0.27.0-kafka-3.0.0-ev2 | ||
command: [ | ||
"sh", "-c", | ||
"/opt/scripts/zookeeper-entrypoint.sh" | ||
] | ||
expose: | ||
- 2181 | ||
- 2888 | ||
- 3888 | ||
environment: | ||
LOG_DIR: /tmp/logs | ||
ZOOKEEPER_ID: 1 | ||
ZOOKEEPER_SERVERS: 1=zookeeper-1:2888:3888;2=zookeeper-2:2888:3888;3=zookeeper-3:2888:3888 | ||
zookeeper-2: | ||
image: evdobe/kafka:strimzi-0.27.0-kafka-3.0.0-ev2 | ||
command: [ | ||
"sh", "-c", | ||
"/opt/scripts/zookeeper-entrypoint.sh" | ||
] | ||
expose: | ||
- 2181 | ||
- 2888 | ||
- 3888 | ||
environment: | ||
LOG_DIR: /tmp/logs | ||
ZOOKEEPER_ID: 2 | ||
ZOOKEEPER_SERVERS: 1=zookeeper-1:2888:3888;2=zookeeper-2:2888:3888;3=zookeeper-3:2888:3888 | ||
zookeeper-3: | ||
image: evdobe/kafka:strimzi-0.27.0-kafka-3.0.0-ev2 | ||
command: [ | ||
"sh", "-c", | ||
"/opt/scripts/zookeeper-entrypoint.sh" | ||
] | ||
expose: | ||
- 2181 | ||
- 2888 | ||
- 3888 | ||
environment: | ||
LOG_DIR: /tmp/logs | ||
ZOOKEEPER_ID: 3 | ||
ZOOKEEPER_SERVERS: 1=zookeeper-1:2888:3888;2=zookeeper-2:2888:3888;3=zookeeper-3:2888:3888 | ||
kafka-1: | ||
image: evdobe/kafka:strimzi-0.27.0-kafka-3.0.0-ev2 | ||
command: [ | ||
"/opt/scripts/entrypoint.sh" | ||
] | ||
depends_on: | ||
- zookeeper-1 | ||
expose: | ||
- 9092 | ||
- 29092 | ||
environment: | ||
LOG_DIR: "/tmp/logs" | ||
KAFKA_BROKER_ID: 1 | ||
KAFKA_ADVERTISED_LISTENERS: EXTERNAL://kafka-1:29092,INTERNAL://kafka-1:9092 | ||
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: EXTERNAL:PLAINTEXT,INTERNAL:PLAINTEXT | ||
KAFKA_LISTENERS: EXTERNAL://:29092,INTERNAL://:9092 | ||
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL | ||
KAFKA_ZOOKEEPER_CONNECT: zookeeper-1:2181,zookeeper-2:2181,zookeeper-3:2181 | ||
KAFKA_CREATE_TOPICS_SEPARATOR: "$$'\n'" | ||
KAFKA_CREATE_TOPICS: ${MESSAGE_TOPICS} | ||
kafka-2: | ||
image: evdobe/kafka:strimzi-0.27.0-kafka-3.0.0-ev2 | ||
command: [ | ||
"/opt/scripts/entrypoint.sh" | ||
] | ||
depends_on: | ||
- zookeeper-2 | ||
expose: | ||
- 9092 | ||
- 29092 | ||
environment: | ||
LOG_DIR: "/tmp/logs" | ||
KAFKA_BROKER_ID: 2 | ||
KAFKA_ADVERTISED_LISTENERS: EXTERNAL://kafka-2:29092,INTERNAL://kafka-2:9092 | ||
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: EXTERNAL:PLAINTEXT,INTERNAL:PLAINTEXT | ||
KAFKA_LISTENERS: EXTERNAL://:29092,INTERNAL://:9092 | ||
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL | ||
KAFKA_ZOOKEEPER_CONNECT: zookeeper-2:2181,zookeeper-3:2181,zookeeper-1:2181 | ||
KAFKA_CREATE_TOPICS_SEPARATOR: "$$'\n'" | ||
KAFKA_CREATE_TOPICS: ${MESSAGE_TOPICS} | ||
kafka-3: | ||
image: evdobe/kafka:strimzi-0.27.0-kafka-3.0.0-ev2 | ||
command: [ | ||
"/opt/scripts/entrypoint.sh" | ||
] | ||
depends_on: | ||
- zookeeper-3 | ||
expose: | ||
- 9092 | ||
- 29092 | ||
environment: | ||
LOG_DIR: "/tmp/logs" | ||
KAFKA_BROKER_ID: 3 | ||
KAFKA_ADVERTISED_LISTENERS: EXTERNAL://kafka-3:29092,INTERNAL://kafka-3:9092 | ||
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: EXTERNAL:PLAINTEXT,INTERNAL:PLAINTEXT | ||
KAFKA_LISTENERS: EXTERNAL://:29092,INTERNAL://:9092 | ||
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL | ||
KAFKA_ZOOKEEPER_CONNECT: zookeeper-3:2181,zookeeper-1:2181,zookeeper-2:2181 | ||
KAFKA_CREATE_TOPICS_SEPARATOR: "$$'\n'" | ||
KAFKA_CREATE_TOPICS: ${MESSAGE_TOPICS} | ||
|
||
db: | ||
build: ../cont/db/ | ||
environment: | ||
POSTGRES_PASSWORD: "${STORE_DB_PASSWORD}" | ||
POSTGRES_USER: "${STORE_DB_USER}" | ||
POSTGRES_DB: "${STORE_DB_NAME}" | ||
POSTGRES_HOST_AUTH_METHOD: trust | ||
expose: | ||
- 5432 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
FROM postgres:9.6.24 | ||
RUN localedef -i el_GR -c -f UTF-8 -A /usr/share/locale/locale.alias el_GR.UTF-8 | ||
ENV LANG el_GR.utf8 | ||
COPY target / |
85 changes: 85 additions & 0 deletions
85
ops/envs/concurrent/cont/db/target/docker-entrypoint-initdb.d/event_table.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
|
||
-- | ||
-- PostgreSQL database dump | ||
-- | ||
|
||
-- Dumped from database version 9.6.24 | ||
-- Dumped by pg_dump version 9.6.24 | ||
|
||
SET statement_timeout = 0; | ||
SET lock_timeout = 0; | ||
SET idle_in_transaction_session_timeout = 0; | ||
SET client_encoding = 'UTF8'; | ||
SET standard_conforming_strings = on; | ||
SELECT pg_catalog.set_config('search_path', '', false); | ||
SET check_function_bodies = false; | ||
SET xmloption = content; | ||
SET client_min_messages = warning; | ||
SET row_security = off; | ||
|
||
SET default_tablespace = ''; | ||
|
||
SET default_with_oids = false; | ||
|
||
-- | ||
-- Name: event; Type: TABLE; Schema: public; Owner: adbuser | ||
-- | ||
|
||
CREATE TABLE public.event ( | ||
id integer NOT NULL, | ||
"name" text NOT NULL, | ||
channel text NOT NULL, | ||
correlation_id text NOT NULL, | ||
aggregate_id integer NOT NULL, | ||
aggregate_version integer NOT NULL, | ||
data jsonb NOT NULL, | ||
"timestamp" timestamp(3) without time zone DEFAULT now() NOT NULL, | ||
dispatched boolean DEFAULT false NOT NULL, | ||
dispatched_at timestamp(3) without time zone, | ||
received_at timestamp(3) without time zone, | ||
projected boolean DEFAULT false NOT NULL | ||
); | ||
|
||
|
||
ALTER TABLE public.event OWNER TO adbuser; | ||
|
||
-- | ||
-- Name: event_id_seq; Type: SEQUENCE; Schema: public; Owner: adbuser | ||
-- | ||
|
||
CREATE SEQUENCE public.event_id_seq | ||
START WITH 1 | ||
INCREMENT BY 1 | ||
NO MINVALUE | ||
NO MAXVALUE | ||
CACHE 1; | ||
|
||
|
||
ALTER TABLE public.event_id_seq OWNER TO adbuser; | ||
|
||
-- | ||
-- Name: event_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: adbuser | ||
-- | ||
|
||
ALTER SEQUENCE public.event_id_seq OWNED BY public.event.id; | ||
|
||
|
||
-- | ||
-- Name: event id; Type: DEFAULT; Schema: public; Owner: adbuser | ||
-- | ||
|
||
ALTER TABLE ONLY public.event ALTER COLUMN id SET DEFAULT nextval('public.event_id_seq'::regclass); | ||
|
||
|
||
-- | ||
-- Name: event event_pkey; Type: CONSTRAINT; Schema: public; Owner: adbuser | ||
-- | ||
|
||
ALTER TABLE ONLY public.event | ||
ADD CONSTRAINT event_pkey PRIMARY KEY (id); | ||
|
||
|
||
-- | ||
-- PostgreSQL database dump complete | ||
-- | ||
|
Oops, something went wrong.