File tree 5 files changed +28
-18
lines changed
java/com/sarya/graphql/service
5 files changed +28
-18
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ services.
24
24
- Create new service for GraphQL client using Apollo library
25
25
- Set up performance test for K6 in local and docker env
26
26
- Integration test with Karate and Wiremock
27
- -
27
+ - Retry and DLQ set up
28
28
29
29
### To build a docker image run below command:
30
30
``` shell
@@ -42,4 +42,4 @@ Import the project in IntelliJ and run
42
42
or
43
43
``` shell
44
44
mvnw springboot:run
45
- ```
45
+ ```
Original file line number Diff line number Diff line change 44
44
<artifactId >spring-boot-starter-web</artifactId >
45
45
</dependency >
46
46
47
- <dependency >
48
- <groupId >org.springframework.boot</groupId >
49
- <artifactId >spring-boot-devtools</artifactId >
50
- <scope >runtime</scope >
51
- <optional >true</optional >
52
- </dependency >
47
+ <!-- <dependency> -- >
48
+ <!-- <groupId>org.springframework.boot</groupId> -- >
49
+ <!-- <artifactId>spring-boot-devtools</artifactId> -- >
50
+ <!-- <scope>runtime</scope> -- >
51
+ <!-- <optional>true</optional> -- >
52
+ <!-- </dependency> -- >
53
53
54
54
<dependency >
55
55
<groupId >org.springframework.boot</groupId >
267
267
<url >https://packages.confluent.io/maven/</url >
268
268
</repository >
269
269
</repositories >
270
- </project >
270
+ </project >
Original file line number Diff line number Diff line change 1
1
package com .sarya .graphql .service .application .port .in ;
2
2
3
+ import com .sarya .graphql .service .ProductCreatedEvent ;
3
4
import lombok .extern .slf4j .Slf4j ;
4
- import org .apache .avro .generic .GenericRecord ;
5
5
import org .springframework .kafka .annotation .KafkaListener ;
6
6
import org .springframework .stereotype .Component ;
7
7
10
10
public class ProductConsumer {
11
11
12
12
@ KafkaListener (topics = {"create-product" }, groupId = "sample-service-group" )
13
- public void consumeProducts (GenericRecord event ) {
13
+ public void consumeProducts (ProductCreatedEvent event ) {
14
14
log .info ("message: {}" , event );
15
15
}
16
16
}
Original file line number Diff line number Diff line change 17
17
@ Slf4j
18
18
public class KafkaConsumerConfig {
19
19
20
- KafkaProperties kafkaProperties ;
21
-
22
20
@ Bean
23
21
@ ConditionalOnMissingBean (name = "kafkaListenerContainerFactory" )
24
- ConcurrentKafkaListenerContainerFactory <String , ProductCreatedEvent > kafkaListenerContainerFactory () {
22
+ ConcurrentKafkaListenerContainerFactory <String , ProductCreatedEvent > kafkaListenerContainerFactory (
23
+ KafkaProperties kafkaProperties
24
+ ) {
25
25
var consumerFactory = new DefaultKafkaConsumerFactory <String , ProductCreatedEvent >(
26
26
kafkaProperties .buildConsumerProperties ()
27
27
);
Original file line number Diff line number Diff line change @@ -14,11 +14,21 @@ spring:
14
14
bootstrap-servers : localhost:9092
15
15
group-id : sample-service-group
16
16
auto-offset-reset : earliest
17
- key-deserializer : org.apache .kafka.common.serialization.StringDeserializer
18
- value-deserializer : io.confluent .kafka.serializers.KafkaAvroDeserializer
17
+ key-deserializer : org.springframework .kafka.support.serializer.ErrorHandlingDeserializer
18
+ value-deserializer : org.springframework .kafka.support.serializer.ErrorHandlingDeserializer
19
19
properties :
20
20
schema.registry.url : http://localhost:8081
21
-
21
+ specific :
22
+ avro :
23
+ reader : true
24
+ spring :
25
+ deserializer :
26
+ key :
27
+ delegate :
28
+ class : org.apache.kafka.common.serialization.StringDeserializer
29
+ value :
30
+ delegate :
31
+ class : io.confluent.kafka.serializers.KafkaAvroDeserializer
22
32
dgs :
23
33
reload : true
24
34
graphql :
37
47
38
48
# app:
39
49
# topic:
40
- # product-topic: sample-topic
50
+ # product-topic: sample-topic
You can’t perform that action at this time.
0 commit comments