This file contains hidden or 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
streamsBuilder.addStateStore( | |
Stores.keyValueStoreBuilder( | |
Stores.persistentKeyValueStore("storeName"), | |
Serdes.StringSerde(), | |
JsonSerde<OrderV2>() | |
) | |
.withCachingEnabled() | |
.withLoggingEnabled( | |
mapOf( | |
RETENTION_MS_CONFIG to Duration.ofDays(30).toMillis().toString(), |
This file contains hidden or 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
package org.example.profiles | |
import org.apache.kafka.clients.consumer.ConsumerConfig | |
import org.apache.kafka.common.serialization.Serdes | |
import org.apache.kafka.streams.KafkaStreams | |
import org.apache.kafka.streams.StreamsBuilder | |
import org.apache.kafka.streams.StreamsConfig | |
import org.apache.kafka.streams.kstream.Consumed | |
import org.apache.kafka.streams.kstream.JoinWindows | |
import org.apache.kafka.streams.kstream.ValueJoiner |
This file contains hidden or 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
@KafkaListener(topics = KafkaSpringBootHelloWorldApplication.TOPIC_USERS, groupId = "${groupId}", | |
topicPartitions = { | |
@TopicPartition( | |
topic = KafkaSpringBootHelloWorldApplication.TOPIC_USERS, | |
partitionOffsets = @PartitionOffset(partition = "0", initialOffset = "0")) | |
}) |
This file contains hidden or 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
private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); |
This file contains hidden or 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 java.lang.reflect.Method; | |
import java.util.logging.Logger; | |
import org.junit.jupiter.api.extension.AfterTestExecutionCallback; | |
import org.junit.jupiter.api.extension.BeforeTestExecutionCallback; | |
import org.junit.jupiter.api.extension.ExtensionContext; | |
import org.junit.jupiter.api.extension.ExtensionContext.Namespace; | |
import org.junit.jupiter.api.extension.ExtensionContext.Store; | |
public class TimingExtension implements BeforeTestExecutionCallback, AfterTestExecutionCallback { |
This file contains hidden or 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
DateTimeFormatter timeFormatter = new DateTimeFormatterBuilder() | |
.appendValue(HOUR_OF_DAY, 2) | |
.appendLiteral(':') | |
.appendValue(MINUTE_OF_HOUR, 2) | |
.optionalStart() | |
.appendLiteral(':') | |
.appendValue(SECOND_OF_MINUTE, 2) | |
.toFormatter(); | |
return LocalTime.now().format(timeFormatter); |
This file contains hidden or 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
private String readContentFromFileInJarOnClasspath() { | |
try { | |
return StreamUtils.copyToString(new ClassPathResource("/lol.txt").getInputStream(), Charset.defaultCharset()); | |
} catch (IOException e) { | |
throw new RuntimeException(e); | |
} | |
} |
This file contains hidden or 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
package no.vegvesen.kjoretoy.registrering.forhandler.web.config; | |
import java.util.concurrent.Executor; | |
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.context.annotation.Import; | |
import org.springframework.core.task.SimpleAsyncTaskExecutor; | |
import org.springframework.scheduling.annotation.AsyncConfigurer; | |
import org.springframework.scheduling.annotation.EnableAsync; |
This file contains hidden or 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
<plugin> | |
<groupId>org.codehaus.mojo</groupId> | |
<artifactId>flatten-maven-plugin</artifactId> | |
<configuration> | |
<updatePomFile>true</updatePomFile> | |
<outputDirectory>${project.build.directory}</outputDirectory> | |
<pomElements> | |
<repositories>remove</repositories> | |
</pomElements> | |
</configuration> |
This file contains hidden or 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 javax.persistence.EntityManager; | |
import javax.persistence.PersistenceContext; | |
import javax.persistence.Table; | |
import java.util.List; | |
import java.util.stream.Collectors; | |
import org.springframework.beans.factory.InitializingBean; | |
import org.springframework.context.annotation.Profile; | |
import org.springframework.stereotype.Service; |
NewerOlder