access-token-create, atc Creates an Artifactory access token. By default an user-scoped token will be created, unless the --groups and/or --grant-admin options are specified.
build-add-dependencies, bad Adds dependencies from the local file-system to the build info.
build-add-git, bag Collect VCS details from git and add them to a build.
build-append, ba Append published build to the build info.
build-clean, bc This command is used to clean (remove) build info collected locally.
build-collect-env, bce Collect environment variables. Environment variables can be excluded using the build-publish command.
build-discard, bdi Discard builds by setting retention parameters.
build-docker-create, bdc Add a published docker image to the build-info.
build-promote, bpr This command is used to promote build in Artifactory.
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
<dependency> | |
<groupId>org.testcontainers</groupId> | |
<artifactId>kafka</artifactId> | |
<scope>test</scope> | |
</dependency> | |
<dependency> | |
<groupId>org.testcontainers</groupId> | |
<artifactId>spock</artifactId> | |
<scope>test</scope> | |
</dependency> |
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
class TestEventConsumerSpec extends AbstractEmbeddedKafkaSpec { | |
def "Test message gets routed"() { | |
given: | |
TestConsumer consumer = embeddedServer.getApplicationContext().getBean(TestConsumer) | |
TestKafkaClient client = embeddedServer.getApplicationContext().getBean(TestKafkaClient) | |
when: | |
SomeAvroData event = ...//create test data here |
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
class KafkaStreamsHealthDisabledSpec extends AbstractTestContainersSpec { | |
def "health check disabled"() { | |
when: | |
def bean = context.findBean(KafkaStreamsHealth) | |
then: | |
!bean.isPresent() | |
} |
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 groovy.util.logging.Slf4j | |
import io.micronaut.context.ApplicationContext | |
import io.micronaut.core.util.CollectionUtils | |
import io.micronaut.runtime.server.EmbeddedServer | |
import org.apache.kafka.clients.admin.AdminClient | |
import org.apache.kafka.clients.admin.NewTopic | |
import org.testcontainers.containers.KafkaContainer | |
import spock.lang.AutoCleanup | |
import spock.lang.Shared | |
import spock.lang.Specification |
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
/** | |
* Generates a lot of code which fits with a class that is a representation of an immutable entity. | |
* <p> | |
* Equivalent to {@code @Getter @FieldDefaults(makeFinal=true, level=AccessLevel.PRIVATE) @AllArgsConstructor @ToString @EqualsAndHashCode}. | |
* <p> | |
* Complete documentation is found at <a href="https://projectlombok.org/features/Value">the project lombok features page for @Value</a>. | |
* | |
* @see lombok.Getter | |
* @see lombok.experimental.FieldDefaults | |
* @see lombok.AllArgsConstructor |
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
# https://projectlombok.org/features/configuration | |
config.stopBubbling = true | |
lombok.addLombokGeneratedAnnotation = true | |
lombok.anyConstructor.addConstructorProperties = true | |
lombok.copyableAnnotations += javax.inject.Named | |
lombok.copyableAnnotations += io.micronaut.http.client.annotation.Client | |
lombok.copyableAnnotations += io.micronaut.context.annotation.Parameter | |
lombok.copyableAnnotations += io.micronaut.context.annotation.Value | |
lombok.copyableAnnotations += io.micronaut.configuration.hibernate.jpa.scope.CurrentSession |
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
package com.foo.http.client; | |
import io.micronaut.http.MediaType; | |
import io.micronaut.http.annotation.Get; | |
import io.micronaut.http.client.annotation.Client; | |
import io.reactivex.Flowable; | |
import reactor.core.publisher.Flux; | |
@Client("/streaming") | |
public interface HeadlineClient { |
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
package com.foo.event.client; | |
import io.micronaut.configuration.kafka.annotation.KafkaClient; | |
import io.micronaut.configuration.kafka.annotation.KafkaKey; | |
import io.micronaut.configuration.kafka.annotation.Topic; | |
@KafkaClient(id = "foo-kafka-client") | |
public interface FooEventKafkaClient { | |
void publishEvent(@Topic String topic, @KafkaKey final String key, final Foo foo); |
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
package com.company.project.event.client; | |
import com.company.project.event.v1.FooEvent; | |
import io.micronaut.configuration.kafka.annotation.KafkaClient; | |
import io.micronaut.configuration.kafka.annotation.KafkaKey; | |
import io.micronaut.configuration.kafka.annotation.Topic; | |
import io.micronaut.context.annotation.Requires; | |
import io.micronaut.retry.annotation.Retryable; | |
@KafkaClient(id = "foo-events-kafka-client") |
NewerOlder