Skip to content

Commit

Permalink
Update springwolf-kafka version
Browse files Browse the repository at this point in the history
  • Loading branch information
stavshamir committed Dec 17, 2021
1 parent 54d3b1f commit 11c0cc7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
1 change: 1 addition & 0 deletions .github/workflows/springwolf-kafka.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
paths:
- '.github/workflows/springwolf-kafka.yml'
- 'springwolf-core/**'
- 'springwolf-plugins/springwolf-kafka-plugin/**'
- 'springwolf-examples/springwolf-kafka-example/**'

jobs:
Expand Down
14 changes: 3 additions & 11 deletions springwolf-plugins/springwolf-kafka-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,10 @@ plugins {
}

group 'io.github.springwolf'
version '0.2.0'
version '0.3.0'
sourceCompatibility = 1.8

repositories {
// For local development with snapshots
mavenLocal() {
content {
includeGroup "io.github.springwolf"
}
}

mavenCentral()
}

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

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

testCompile 'org.projectlombok:lombok:1.18.4'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.4'
Expand Down Expand Up @@ -81,7 +73,7 @@ def pomConfig = {
}

scm {
url 'https://github.com/springwolf/springwolf-kafka'
url 'https://github.com/springwolf/springwolf-core'
}
}

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

def pomFile = file("${project.buildDir}/generated-pom.xml")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import io.github.stavshamir.springwolf.producer.SpringwolfKafkaProducer;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.server.ResponseStatusException;

import java.util.Map;

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

@PostMapping("/publish")
public void publish(@RequestParam String topic, @RequestBody Map<String, Object> payload) {
if (!kafkaProducer.isEnabled()) {
log.debug("Kafka producer is not enabled - message will not be published");
throw new ResponseStatusException(HttpStatus.NOT_FOUND, "Kafka producer is not enabled");
}

log.info("Publishing to kafka topic {}: {}", topic, payload);
kafkaProducer.send(topic, payload);
}
Expand Down

0 comments on commit 11c0cc7

Please sign in to comment.