Skip to content

Commit

Permalink
refactor kafka config
Browse files Browse the repository at this point in the history
  • Loading branch information
xcodeassociated committed Sep 17, 2024
1 parent 948c0d4 commit f49fac7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 82 deletions.
73 changes: 0 additions & 73 deletions .github/workflows/gradle.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ class KafkaConfig {
fun consumerFactory() = DefaultKafkaConsumerFactory<String, JsonNode>(consumerProps)

val consumerProps = mapOf(
ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG to "localhost:9094",
ConsumerConfig.GROUP_ID_CONFIG to "sample-group-jvm-jpa",
ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG to StringDeserializer::class.java,
ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG to JsonDeserializer::class.java,
JsonDeserializer.USE_TYPE_INFO_HEADERS to false,
Expand All @@ -46,7 +44,6 @@ class KafkaConfig {
fun producerFactory() = DefaultKafkaProducerFactory<String, KafkaMessage>(senderProps)

val senderProps = mapOf(
ProducerConfig.BOOTSTRAP_SERVERS_CONFIG to "localhost:9094",
ProducerConfig.LINGER_MS_CONFIG to 10,
ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG to StringSerializer::class.java,
ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG to JsonSerializer::class.java
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@ logging.level.org.springframework.jdbc.core.StatementCreatorUtils=TRACE
### keycloak realm config: http://localhost:8090/realms/master/.well-known/openid-configuration
spring.security.oauth2.resourceserver.jwt.issuer-uri=http://localhost:8090/realms/master
spring.security.oauth2.resourceserver.jwt.jwk-set-uri=http://localhost:8090/realms/master/protocol/openid-connect/certs

spring.security.oauth2.client.registration.keycloak.client-id=backend
spring.security.oauth2.client.registration.keycloak.client-secret=Jtn7eBkt5hU4E6oNy7iQ2YJPQR8po5oY
spring.security.oauth2.client.registration.keycloak.authorization-grant-type=client_credentials

spring.security.oauth2.client.provider.keycloak.authorization-uri=http://localhost:8090/realms/master/protocol/openid-connect/auth
spring.security.oauth2.client.provider.keycloak.token-uri=http://localhost:8090/realms/master/protocol/openid-connect/token
spring.security.oauth2.client.provider.keycloak.user-info-uri=http://localhost:8090/realms/master/protocol/openid-connect/userinfo
spring.security.oauth2.client.provider.keycloak.jwk-set-uri=http://localhost:8090/realms/master/protocol/openid-connect/certs

# kafka
spring.kafka.bootstrap-servers=localhost:9094
spring.kafka.consumer.group-id=another-group-jvm
spring.kafka.consumer.properties.spring.json.use.type.headers=false
spring.kafka.consumer.properties.spring.json.value.default.type=com.fasterxml.jackson.databind.JsonNode

Expand Down
8 changes: 4 additions & 4 deletions src/test/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@ spring.main.allow-bean-definition-overriding=true
spring.application.name=SoftenoJpaPostgresApp

### custom: external services

com.softeno.external.url=http://localhost:4500/sample
com.softeno.external.name=node-service

com.softeno.kafka.tx=sample_topic_2
com.softeno.kafka.rx=sample_topic_2
com.softeno.kafka.keycloak=keycloak-events

### jpa, hibernate & liquibase
### kafka
spring.kafka.bootstrap-servers=localhost:9094
spring.kafka.consumer.group-id=another-group-jvm

### jpa, hibernate & liquibase
spring.datasource.url=jdbc:tc:postgresql:15.2-alpine:///application
spring.datasource.username=admin
spring.datasource.password=admin
Expand Down Expand Up @@ -41,10 +43,8 @@ logging.level.org.springframework.jdbc.core.JdbcTemplate=DEBUG
logging.level.org.springframework.jdbc.core.StatementCreatorUtils=TRACE

# metrics, prometheus & actuator

management.endpoint.metrics.enabled=false
management.endpoint.prometheus.enabled=false

# swagger

springdoc.api-docs.enabled=false

0 comments on commit f49fac7

Please sign in to comment.