https://documentation.red-gate.com/fd/baseline-184127456.html
spring:
flyway:
baselineVersion: 3.6
baselineOnMigrate: true| import lombok.RequiredArgsConstructor; | |
| import lombok.extern.slf4j.Slf4j; | |
| import org.apache.kafka.clients.consumer.ConsumerRecord; | |
| import org.springframework.kafka.annotation.KafkaListener; | |
| import org.springframework.messaging.MessageHeaders; | |
| @RequiredArgsConstructor | |
| @Slf4j | |
| public class AvroDataConsumer { |
https://documentation.red-gate.com/fd/baseline-184127456.html
spring:
flyway:
baselineVersion: 3.6
baselineOnMigrate: true| import com.fasterxml.jackson.annotation.JsonAutoDetect; | |
| import org.apache.avro.generic.GenericContainer; | |
| import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer; | |
| import org.springframework.context.annotation.Bean; | |
| import org.springframework.context.annotation.Configuration; | |
| import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; | |
| @Configuration | |
| public class ObjectMapperConfiguration { |
| @Getter | |
| private final KafkaTemplate<String, T> kafkaTemplate; | |
| public CompletableFuture<SendResult<String, T>> sendMessage(String key, T message, Integer partition) { | |
| try { | |
| return getKafkaTemplate().send(getTopicName(), partition, key, message); | |
| } catch (Exception e) { | |
| throw new RuntimeException("Failed to send a message to topic: " + getTopicName(), e); | |
| } |
Download the audio only
utlink='https://www.youtube.com/watch?v=bn9F19Hi1Lk'youtube-dl -F "$utlink"audio=$(youtube-dl -f 140 -g "$utlink")ffmpeg -i "$audio" -t 300 -c:a libmp3lame waves300.mp3using git branch -r --no-merge) which is especially useful for release/* deployment strategiesHowever, there is definitely a case for squashing PRs when individual commits do not provide extra value and just create more "noise".
Things I don't like about java records
@Builder becomes preferable
@Builder with java recordI don't see any major advantages with using record other than its immutable nature.
| import com.google.api.client.http.HttpHeaders | |
| import com.google.api.client.http.HttpResponseException | |
| import com.google.cloud.storage.StorageException | |
| import org.spockframework.spring.SpringBean | |
| import org.springframework.test.web.servlet.ResultActions | |
| import static org.hamcrest.Matchers.is | |
| import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get | |
| import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print | |
| import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content |
| def "fetch file info"() { | |
| given: | |
| UUID fileId = UUID.randomUUID() | |
| FileMetadata response = new FileMetadata(fileId, "/somePath", "someFileName.xls", 100) | |
| wireMockServer.stubFor( | |
| get(urlPathTemplate(uri)) | |
| .withPathParam("fileId", equalTo(fileId.toString())) | |
| .withHeader(AUTHORIZATION_HEADER, expectedAuthorization) |