Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

p6spy changes #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
8 changes: 8 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This configuration file was automatically generated by Gitpod.
# Please adjust to your needs (see https://www.gitpod.io/docs/config-gitpod-file)
# and commit this file to your remote git repository to share the goodness with others.

tasks:
- init: mvn install -DskipTests=false


2 changes: 2 additions & 0 deletions common-model/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>

<dependencies>
Expand Down
6 changes: 6 additions & 0 deletions common-swagger/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@

<artifactId>common-swagger</artifactId>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>

<dependencies>
<dependency>
<groupId>io.springfox</groupId>
Expand Down
16 changes: 16 additions & 0 deletions customer-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,22 @@
<version>1.0-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-sleuth</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-zipkin</artifactId>
</dependency>

<dependency>
<groupId>com.github.gavlyukovskiy</groupId>
<artifactId>p6spy-spring-boot-starter</artifactId>
<version>1.8.0</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class ReceiverConfig {

private static final Logger LOGGER = LoggerFactory.getLogger(ReceiverConfig.class);

@Value("${spring.kafka.bootstrap-servers}")
@Value("localhost:9092")
private String bootstrapServers;

@Bean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class SenderConfig {

private static final Logger LOGGER = LoggerFactory.getLogger(SenderConfig.class);

@Value("${spring.kafka.bootstrap-servers}")
@Value("localhost:9092")
private String bootstrapServers;

@Bean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import com.uguraytekin.customerservice.api.service.CustomerService;
import javassist.NotFoundException;
import org.modelmapper.ModelMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

Expand All @@ -14,6 +16,8 @@
@RequestMapping("/customer")
public class CustomerController {

Logger log = LoggerFactory.getLogger(CustomerController.class);

private final CustomerService customerService;
private final ModelMapper modelMapper;

Expand All @@ -24,11 +28,13 @@ public CustomerController(CustomerService customerService, ModelMapper modelMapp

@PostMapping("/saveCustomer")
public ResponseEntity<SaveCustomerResponse> saveCustomer(@Valid @RequestBody SaveCustomerRequest request) {
log.info("inside saveCustomer");
return ResponseEntity.ok(modelMapper.map(customerService.saveCustomer(request), SaveCustomerResponse.class));
}

@GetMapping("/getCustomerById/{id}")
public ResponseEntity<SaveCustomerResponse> getCustomerById(@PathVariable Integer id) throws NotFoundException {
log.info("inside getCustomerById");
return ResponseEntity.ok(modelMapper.map(customerService.getCustomerById(id), SaveCustomerResponse.class));
}
}
8 changes: 8 additions & 0 deletions customer-service/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Register P6LogFactory to log JDBC events
#decorator.datasource.p6spy.enable-logging=false
# Use com.p6spy.engine.spy.appender.MultiLineFormat instead of com.p6spy.engine.spy.appender.SingleLineFormat
#decorator.datasource.p6spy.multiline=true
# Use logging for default listeners [slf4j, sysout, file, custom]
#decorator.datasource.p6spy.logging=slf4j

decorator.datasource.p6spy.tracing.include-parameter-values=true
44 changes: 19 additions & 25 deletions docker-compose-local-kafka.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,27 @@
version: '2.1'

---
version: '3'
services:
zoo1:
image: zookeeper:3.4.9
hostname: zoo1
ports:
- "2181:2181"
zookeeper:
image: confluentinc/cp-zookeeper:7.0.1
container_name: zookeeper
environment:
ZOO_MY_ID: 1
ZOO_PORT: 2181
ZOO_SERVERS: server.1=zoo1:2888:3888
volumes:
- ./zk-single-kafka-single/zoo1/data:/data
- ./zk-single-kafka-single/zoo1/datalog:/datalog
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000

kafka1:
image: confluentinc/cp-kafka:5.5.1
hostname: kafka1
broker:
image: confluentinc/cp-kafka:7.0.1
container_name: broker
ports:
# To learn about configuring Kafka for access across networks see
# https://www.confluent.io/blog/kafka-client-cannot-connect-to-broker-on-aws-on-docker-etc/
- "9092:9092"
depends_on:
- zookeeper
environment:
KAFKA_ADVERTISED_LISTENERS: LISTENER_DOCKER_INTERNAL://kafka1:19092,LISTENER_DOCKER_EXTERNAL://${DOCKER_HOST_IP:-127.0.0.1}:9092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LISTENER_DOCKER_INTERNAL:PLAINTEXT,LISTENER_DOCKER_EXTERNAL:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_DOCKER_INTERNAL
KAFKA_ZOOKEEPER_CONNECT: "zoo1:2181"
KAFKA_BROKER_ID: 1
KAFKA_LOG4J_LOGGERS: "kafka.controller=INFO,kafka.producer.async.DefaultEventHandler=INFO,state.change.logger=INFO"
KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_INTERNAL:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092,PLAINTEXT_INTERNAL://broker:29092
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
volumes:
- ./zk-single-kafka-single/kafka1/data:/var/lib/kafka/data
depends_on:
- zoo1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
@EnableKafka
public class ReceiverConfig {

@Value("${spring.kafka.bootstrap-servers}")
@Value("localhost:9092")
private String bootstrapServers;

@Bean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
@Configuration
public class SenderConfig {

@Value("${spring.kafka.bootstrap-servers}")
@Value("localhost:9092")
private String bootstrapServers;

@Bean
Expand Down
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
0
1
0 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0
0
5 changes: 5 additions & 0 deletions zk-single-kafka-single/kafka1/data/meta.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#
#Sat Jun 18 06:15:07 UTC 2022
cluster.id=mrzyZe3hSsysP7uIPCo6UQ
version=0
broker.id=1
Loading