Skip to content

Commit 11c0cc7

Browse files
committed
Update springwolf-kafka version
1 parent 54d3b1f commit 11c0cc7

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

.github/workflows/springwolf-kafka.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
paths:
88
- '.github/workflows/springwolf-kafka.yml'
99
- 'springwolf-core/**'
10+
- 'springwolf-plugins/springwolf-kafka-plugin/**'
1011
- 'springwolf-examples/springwolf-kafka-example/**'
1112

1213
jobs:

springwolf-plugins/springwolf-kafka-plugin/build.gradle

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,10 @@ plugins {
99
}
1010

1111
group 'io.github.springwolf'
12-
version '0.2.0'
12+
version '0.3.0'
1313
sourceCompatibility = 1.8
1414

1515
repositories {
16-
// For local development with snapshots
17-
mavenLocal() {
18-
content {
19-
includeGroup "io.github.springwolf"
20-
}
21-
}
22-
2316
mavenCentral()
2417
}
2518

@@ -35,7 +28,6 @@ dependencies {
3528
annotationProcessor 'org.projectlombok:lombok:1.18.4'
3629

3730
testImplementation('org.springframework.boot:spring-boot-starter-test')
38-
testImplementation('org.springframework.kafka:spring-kafka-test')
3931

4032
testCompile 'org.projectlombok:lombok:1.18.4'
4133
testAnnotationProcessor 'org.projectlombok:lombok:1.18.4'
@@ -81,7 +73,7 @@ def pomConfig = {
8173
}
8274

8375
scm {
84-
url 'https://github.com/springwolf/springwolf-kafka'
76+
url 'https://github.com/springwolf/springwolf-core'
8577
}
8678
}
8779

@@ -106,7 +98,7 @@ publishing {
10698
def root = asNode()
10799
root.appendNode('description', 'Automated JSON API documentation for Kafka Listeners built with Spring')
108100
root.appendNode('name', 'springwolf-kafka')
109-
root.appendNode('url', 'https://github.com/springwolf/springwolf-kafka')
101+
root.appendNode('url', 'https://github.com/springwolf/springwolf-core')
110102
root.children().last() + pomConfig
111103

112104
def pomFile = file("${project.buildDir}/generated-pom.xml")

springwolf-plugins/springwolf-kafka-plugin/src/main/java/io/github/stavshamir/springwolf/asyncapi/SpringwolfKafkaController.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
import io.github.stavshamir.springwolf.producer.SpringwolfKafkaProducer;
44
import lombok.RequiredArgsConstructor;
55
import lombok.extern.slf4j.Slf4j;
6+
import org.springframework.http.HttpStatus;
67
import org.springframework.web.bind.annotation.*;
8+
import org.springframework.web.server.ResponseStatusException;
79

810
import java.util.Map;
911

@@ -17,6 +19,11 @@ public class SpringwolfKafkaController {
1719

1820
@PostMapping("/publish")
1921
public void publish(@RequestParam String topic, @RequestBody Map<String, Object> payload) {
22+
if (!kafkaProducer.isEnabled()) {
23+
log.debug("Kafka producer is not enabled - message will not be published");
24+
throw new ResponseStatusException(HttpStatus.NOT_FOUND, "Kafka producer is not enabled");
25+
}
26+
2027
log.info("Publishing to kafka topic {}: {}", topic, payload);
2128
kafkaProducer.send(topic, payload);
2229
}

0 commit comments

Comments
 (0)