This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | |
import org.jetbrains.kotlin.util.parseSpaceSeparatedArgs | |
plugins { | |
application | |
id("org.springframework.boot") version "2.5.2" | |
id("io.spring.dependency-management") version "1.0.11.RELEASE" | |
kotlin("jvm") version "1.5.20" | |
kotlin("plugin.spring") version "1.5.20" | |
id("com.google.cloud.tools.jib") version "3.1.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component | |
class NotificationPostFilter : AbstractGatewayFilterFactory<NotificationPostFilter.Config>(Config::class.java) { | |
private val logger = LoggerFactory.getLogger(javaClass) | |
class Config | |
override fun apply(config: Config?): GatewayFilter { | |
return GatewayFilter { exchange: ServerWebExchange?, chain: GatewayFilterChain -> | |
chain.filter(exchange) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@EnableConfigServer | |
@SpringBootApplication | |
class ConfigServerApplication | |
fun main(args: Array<String>) { | |
runApplication<ConfigServerApplication>(*args) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component | |
class Consumer(private val mapper: ObjectMapper, private val notificationService: NotificationService) { | |
private val logger = LoggerFactory.getLogger(javaClass) | |
@KafkaListener(groupId = "\${spring.kafka.consumer.group-id}", topics = ["notification-event"]) | |
fun onMessage(@Payload payload: String, meta: ConsumerRecordMetadata, acknowledgment: Acknowledgment) { | |
val event = mapper.readValue(payload, NotificationEvent::class.java) | |
val notification = when (event.type) { | |
EventType.CREATE_NOTIFICATION -> notificationService.create(event.notification) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spring: | |
application: | |
name: producer-service | |
cloud: | |
config: | |
enabled: false | |
main: | |
lazy-initialization: false | |
web-application-type: servlet | |
banner-mode: off |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
stages: | |
- semver | |
- build | |
- test | |
- linting | |
- version-push | |
- docker | |
- security | |
- deploy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ci | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
- 'feature/**' | |
jobs: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server: | |
port: 8080 | |
shutdown: graceful | |
undertow: | |
threads: | |
worker: 24 | |
io: 3 | |
error: | |
whitelabel: | |
enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const config = require('../config'); | |
const Datastore = require("@google-cloud/datastore"); | |
const datastore = Datastore({ | |
projectId: config.get('GCLOUD_PROJECT') | |
}); | |
const kind = 'Question'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const Storage = require('@google-cloud/storage'); | |
const config = require('../config'); | |
const GCLOUD_BUCKET = config.get('GCLOUD_BUCKET'); | |
const storage = Storage({ | |
projectId: config.get('GCLOUD_PROJECT') | |
}); |
OlderNewer