File tree Expand file tree Collapse file tree 6 files changed +12
-11
lines changed
Expand file tree Collapse file tree 6 files changed +12
-11
lines changed Original file line number Diff line number Diff line change 11wrapperVersion =3.3.4
22distributionType =only-script
3- distributionUrl =https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.12 /apache-maven-3.9.12 -bin.zip
3+ distributionUrl =https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/4.0.0-rc-4 /apache-maven-4.0.0-rc-4 -bin.zip
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ COPY ./src src/
1616RUN --mount=type=bind,source=pom.xml,target=pom.xml \
1717 --mount=type=cache,target=/root/.m2 \
1818 ./mvnw package -DskipTests && \
19- mv target/$(./mvnw help:evaluate -Dexpression=project.artifactId -q -DforceStdout)-$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout) .jar target/app.jar
19+ mv target/* .jar target/app.jar
2020
2121FROM package as extract
2222
Original file line number Diff line number Diff line change 77 <parent >
88 <groupId >org.springframework.boot</groupId >
99 <artifactId >spring-boot-starter-parent</artifactId >
10- <version >3.5.10 </version >
10+ <version >4.0.2 </version >
1111 <relativePath />
1212 </parent >
1313
1919
2020 <properties >
2121 <java .version>21</java .version>
22- <spring .boot.version>3.5.10 </spring .boot.version>
23- <maven .plugin.version>3.15.0 </maven .plugin.version>
22+ <spring .boot.version>4.0.2 </spring .boot.version>
23+ <maven .plugin.version>4.0.0-beta-4 </maven .plugin.version>
2424 <spring .cloud.kafka>5.0.1</spring .cloud.kafka>
2525 <lombok .version>1.18.42</lombok .version>
2626 <springwolf .version>2.0.0</springwolf .version>
Original file line number Diff line number Diff line change 55import io .github .springwolf .bindings .kafka .annotations .KafkaAsyncOperationBinding ;
66import io .github .springwolf .core .asyncapi .annotations .AsyncListener ;
77import io .github .springwolf .core .asyncapi .annotations .AsyncOperation ;
8- import lombok .RequiredArgsConstructor ;
98import lombok .extern .slf4j .Slf4j ;
9+ import org .springframework .messaging .Message ;
1010import org .springframework .stereotype .Component ;
1111import java .util .function .Consumer ;
1212
1313import static org .springframework .kafka .support .mapping .AbstractJavaTypeMapper .DEFAULT_CLASSID_FIELD_NAME ;
1414
1515@ Slf4j
16- @ Component
17- public class KafkaConsumer implements Consumer <KafkaDto > {
16+ @ Component ( "kafkaConsumer" )
17+ public class KafkaConsumer implements Consumer <Message < KafkaDto > > {
1818
1919 @ KafkaAsyncOperationBinding (bindingVersion = "1.0.0" )
2020 @ AsyncListener (operation = @ AsyncOperation (
@@ -31,7 +31,8 @@ public class KafkaConsumer implements Consumer<KafkaDto> {
3131 })
3232 ))
3333 @ Override
34- public void accept (KafkaDto kafkaDto ) {
34+ public void accept (Message <KafkaDto > message ) {
35+ var kafkaDto = message .getPayload ();
3536 log .info ("receive: {}" , kafkaDto .message ());
3637 }
3738
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ public class KafkaProducer {
3636 @ KafkaAsyncOperationBinding (bindingVersion = "1.0.0" )
3737 public void send (String text ) {
3838 KafkaDto message = new KafkaDto (text );
39- bridge .send ("sendMessage -out-0" , message );
39+ bridge .send ("kafkaV2Producer -out-0" , message );
4040 }
4141
4242}
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ spring:
1414 bindings :
1515
1616 # PRODUCER
17- sendMessage -out-0 :
17+ kafkaProducer -out-0 :
1818 destination : ${kafka.topics.simple-topic}
1919
2020 # CONSUMER
You can’t perform that action at this time.
0 commit comments