Skip to content

Instantly share code, notes, and snippets.

# docker compose file for services - DBs, kafka, elastic-search, other services
# https://gist.github.com/aditya-suripeddi/b1aa9211cf9562d961d0675322ecc74b
# refer 'Relevant Notes' section below
version: "3.8"
services:
mongo-db:
image: mongo:7-jammy
db = db.getSiblingDB('admin');
db.auth('root', 'secret');
db = db.getSiblingDB('webflux');
db.createUser({
user: "user",
pwd: "pwd",
roles: [
{
role: "readWrite",
//> using dep com.softwaremill.sttp.tapir::tapir-netty-server-sync:1.10.7
import ox.channels.{Actor, ActorRef, Channel, ChannelClosed, Default, DefaultResult, selectOrClosed}
import ox.{fork, releaseAfterScope, supervised}
import sttp.tapir.*
import sttp.tapir.CodecFormat.*
import sttp.tapir.server.netty.sync.{Id, NettySyncServer, OxStreams}
import java.util.UUID
@aditya-suripeddi
aditya-suripeddi / application.properties
Created July 1, 2023 12:48 — forked from sangdongvan/application.properties
Config Postgres Datasource for SpringBoot Application
# ===============================
# = DATA SOURCE
# ===============================
# Set here configurations for the database connection
spring.datasource.url=jdbc:postgresql://localhost:5432/springbootdb
spring.datasource.username=postgres
spring.datasource.password=postgres@123
spring.datasource.driver-class-name=org.postgresql.Driver
# Keep the connection alive if idle for a long time (needed in production)
spring.datasource.testWhileIdle=true
package com.example.demo;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.clients.producer.Producer;
import org.apache.kafka.clients.producer.ProducerRecord;
import org.apache.kafka.common.serialization.StringDeserializer;
import org.apache.kafka.common.serialization.StringSerializer;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;