Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/worker-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- name: Build and Push Docker Image
uses: docker/build-push-action@v6
with:
context: ./worker-service
context: .
file: ./worker-service/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
Expand Down
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions auth-service/target/classes/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ spring:
flyway:
enabled: true
baseline-on-migrate: true
locations: filesystem:/app/database/migrations

mail:
host: flowforge-mailpit
Expand Down
3 changes: 3 additions & 0 deletions auth-service/target/maven-archiver/pom.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
artifactId=auth-service
groupId=com.flowforge
version=0.0.1-SNAPSHOT
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
com\flowforge\auth_service\AuthServiceApplicationTests.class
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
C:\Users\ceasw\OneDrive\Desktop\flowforge\auth-service\src\test\java\com\flowforge\auth_service\AuthServiceApplicationTests.java
Binary file not shown.
22 changes: 22 additions & 0 deletions database/migrations/V3__create_worker_tables.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
-- Create worker_tasks table
CREATE TABLE IF NOT EXISTS worker_tasks (
id UUID PRIMARY KEY,
type VARCHAR(50) NOT NULL,
payload TEXT,
status VARCHAR(20) NOT NULL DEFAULT 'PENDING',
result TEXT,
error TEXT,
workflow_execution_id UUID,
node_id UUID,
created_at TIMESTAMP NOT NULL DEFAULT NOW(),
updated_at TIMESTAMP NOT NULL DEFAULT NOW()
);

-- Create dead_letter_tasks table
CREATE TABLE IF NOT EXISTS dead_letter_tasks (
id UUID PRIMARY KEY,
original_topic VARCHAR(255) NOT NULL,
task_payload TEXT NOT NULL,
exception_message TEXT,
failed_at TIMESTAMP NOT NULL
);
9 changes: 6 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ services:
- ./database:/app/database

worker-service:
image: aswinrj/worker-service
build:
context: .
dockerfile: worker-service/Dockerfile
image: flowforge/worker-service:local
container_name: worker-service
restart: always
depends_on:
Expand All @@ -87,7 +90,7 @@ services:
KAFKA_NODE_ID: 1
KAFKA_PROCESS_ROLES: broker,controller
KAFKA_LISTENERS: PLAINTEXT://:9092,PLAINTEXT_HOST://:29092,CONTROLLER://:9093
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092,PLAINTEXT_HOST://localhost:29092
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://flowforge-kafka:9092,PLAINTEXT_HOST://localhost:29092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT,CONTROLLER:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
Expand All @@ -99,4 +102,4 @@ services:

volumes:
postgres_data:
kafka_data:
kafka_data:
6 changes: 4 additions & 2 deletions worker-service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ FROM eclipse-temurin:21-jre

WORKDIR /app

COPY target/*.jar app.jar
COPY worker-service/target/*.jar app.jar
COPY database/migrations /app/database/migrations

EXPOSE 8084

ENTRYPOINT ["java", "-jar", "app.jar"]
ENTRYPOINT ["java", "-jar", "app.jar"]

Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ public class TaskCreatedConsumer {
backoff = @Backoff(delay = 1000, multiplier = 2),
autoCreateTopics = "true",
topicSuffixingStrategy = TopicSuffixingStrategy.SUFFIX_WITH_INDEX_VALUE,
include = { WorkerExecutionException.class },
exclude = { JsonProcessingException.class }
include = { WorkerExecutionException.class }
)
@KafkaListener(
topics = "task-created",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class TaskCreatedDltHandler {
)
public void handleDlt(String message, @Header(KafkaHeaders.RECEIVED_TOPIC) String topic, @Header(KafkaHeaders.EXCEPTION_MESSAGE) String exceptionMessage) {

log.error("Task-created message sent to DLT from topic {}: {} | reason: {}",
log.error("Task-created message sent to DLT from topic {}: {} | reason: {}",
topic, message, exceptionMessage);

DeadLetterTaskEntity entity = DeadLetterTaskEntity.builder()
Expand Down
5 changes: 3 additions & 2 deletions worker-service/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ spring:

flyway:
enabled: true
locations: classpath:db/migration
locations: filesystem:/app/database/migrations
create-schemas: true

kafka:
bootstrap-servers: flowforge-kafka:29092
bootstrap-servers: flowforge-kafka:9092
producer:
key-serializer: org.apache.kafka.common.serialization.StringSerializer
value-serializer: org.springframework.kafka.support.serializer.JsonSerializer
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading