This file contains hidden or 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
| server: | |
| port: 9001 | |
| spring: | |
| cloud: | |
| stream: | |
| function: | |
| definition: fizzBuzzProducer;fizzBuzzProcessor;fizzBuzzConsumer |
This file contains hidden or 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
| package com.kafka.sample.kafka; | |
| import lombok.extern.slf4j.Slf4j; | |
| import reactor.core.publisher.Flux; | |
| import org.springframework.context.annotation.Bean; | |
| import org.springframework.context.annotation.Configuration; | |
| import java.time.Duration; | |
| import java.util.Random; |
This file contains hidden or 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
| package com.eresh.outbox; | |
| import org.apache.kafka.common.config.ConfigDef; | |
| import org.apache.kafka.connect.connector.ConnectRecord; | |
| import org.apache.kafka.connect.data.Schema; | |
| import org.apache.kafka.connect.data.Struct; | |
| import org.apache.kafka.connect.header.Headers; | |
| import org.apache.kafka.connect.transforms.Transformation; | |
| import java.util.Map; |
This file contains hidden or 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
| version: "3.5" | |
| services: | |
| # Install postgres and setup the user service database | |
| postgres: | |
| build: users-service/postgres | |
| restart: always | |
| ports: | |
| - '5432:5432' | |
| environment: |
This file contains hidden or 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
| { | |
| "name": "elastic-sink", | |
| "config": { | |
| "connector.class": "io.confluent.connect.elasticsearch.ElasticsearchSinkConnector", | |
| "tasks.max": "1", | |
| "topics": "users", | |
| "connection.url": "http://elastic:9200", | |
| "transforms": "unwrap,key", | |
| "transforms.unwrap.type": "io.debezium.transforms.ExtractNewRecordState", | |
| "transforms.unwrap.drop.tombstones": "false", |
This file contains hidden or 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
| { | |
| "name": "pg_user_data-connector", | |
| "config": { | |
| "connector.class": "io.debezium.connector.postgresql.PostgresConnector", | |
| "tasks.max": "1", | |
| "database.hostname": "postgres", | |
| "database.port": "5432", | |
| "database.user": "postgres", | |
| "database.password": "postgres", | |
| "database.server.id": "184055", |
This file contains hidden or 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
| create extension uuid-ossp; | |
| create table user_details ( | |
| id text primary key DEFAULT uuid_generate_v4(), | |
| name text not null, | |
| email text, | |
| mobile_number text, | |
| created_at timestamp not null default now(), | |
| updated_at timestamp | |
| ); |
This file contains hidden or 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
| package com.spring.hibernate.entity; | |
| import lombok.Data; | |
| import lombok.NoArgsConstructor; | |
| import org.hibernate.annotations.CreationTimestamp; | |
| import org.hibernate.annotations.GenericGenerator; | |
| import org.hibernate.annotations.UpdateTimestamp; | |
| import org.springframework.core.annotation.Order; |
This file contains hidden or 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
| package com.spring.hibernate.entity; | |
| import lombok.Getter; | |
| import lombok.Setter; | |
| import org.hibernate.annotations.CreationTimestamp; | |
| import org.hibernate.annotations.GenericGenerator; | |
| import org.hibernate.annotations.UpdateTimestamp; | |
| import javax.persistence.CascadeType; |
This file contains hidden or 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
| func TestTransferTxDeadlock(t *testing.T) { | |
| store := NewStore(testDB) | |
| sourceAccount := CreateRandomAccount(t) | |
| targetAccount := CreateRandomAccount(t) | |
| fmt.Println(">> before:", sourceAccount.Balance, targetAccount.Balance) | |
| n := 10 | |
| amount := int64(10) | |
| errs := make(chan error) |