Skip to content

Instantly share code, notes, and snippets.

View ctoestreich's full-sized avatar

Christian Oestreich ctoestreich

View GitHub Profile
@ctoestreich
ctoestreich / FooEventKafkaClient.java
Created February 20, 2020 16:25
FooEventKafkaClient.java
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")
@ctoestreich
ctoestreich / PersonObjectClient.java
Created February 25, 2019 15:33
PersonObjectClient.java
package com.company.kafka.client;
import com.company.avro.PersonObject;
import io.micronaut.configuration.kafka.annotation.KafkaClient;
import io.micronaut.configuration.kafka.annotation.KafkaKey;
import io.micronaut.configuration.kafka.annotation.Topic;
@KafkaClient(id = "person-object-client")
public interface PersonObjectClient {
@ctoestreich
ctoestreich / KafkaClientSpec.groovy
Created February 25, 2019 15:31
KafkaClientSpec.groovy
/*
* Copyright 2017-2019 original authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@ctoestreich
ctoestreich / application-test.yml
Created February 25, 2019 15:27
application-test.yml
micronaut:
server:
port: 8080
kafka:
embedded.enabled: true
schema:
registry:
url: ${SCHEMA_REGISTRY_URL:`http://localhost:8080`}
client.id: ${random.uuid}
@ctoestreich
ctoestreich / SchemaRegistryStubController.java
Last active November 22, 2019 23:18
SchemaRegistryStubController.java
/*
* Copyright 2017-2019 original authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@ctoestreich
ctoestreich / datadog.sh
Created April 25, 2018 15:50
Start Datadog
nohup datadog-agent start -c /etc/datadog-agent/datadog.yaml > /logs/datadog-agent.log 2>&1&
if [ "$DATADOG_APM_ENABLED" = "true" ]; then
nohup trace-agent -config /etc/datadog-agent/datadog.yaml > /logs/trace-agent.log 2>&1&
fi
if [ "$DATADOG_PROCESS_ENABLED" = "true" ]; then
nohup process-agent -config /etc/datadog-agent/datadog.yaml > /logs/process-agent.log 2>&1&
fi
[supervisorctl]
serverurl = unix:///opt/datadog-agent/run/datadog-supervisor.sock
[unix_http_server]
file=/opt/datadog-agent/run/datadog-supervisor.sock
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[supervisord]
@ctoestreich
ctoestreich / datadog.yml
Created April 17, 2018 18:14
Datadog Agent 6.x Config Rootless
dd_url: %DD_URL%
api_key: %DD_API_KEY%
tags: %DD_TAGS%
non_local_traffic: yes
dogstatsd_non_local_traffic: yes
log_to_syslog: no
@ctoestreich
ctoestreich / datadog.conf
Created November 7, 2017 15:53
datadog.conf
[Main]
dd_url = %DD_URL%
api_key = %API_KEY%
gce_updated_hostname = yes
hostname = %DD_HOSTNAME%
tags = %DD_TAGS%
non_local_traffic = yes
log_to_syslog = no
[trace.sampler]
var base = ['springboot', 'spring-test', 'logging', 'spock'];
var common = [].concat(base);
var data = ['dbsync', 'mysql', 'jdbc'];
var data_jpa = ['data-jpa'];
var web = ['web', 'actuator', 'payload-client', 'sba-client', 'cloud-hystrix', 'cloud-hystrix-dashboard', 'springfox', 'springfoxui', 'springfoxbean', 'restdocs', 'cloud-starter-zipkin'];
var all = [].concat(web, _toConsumableArray(common), data, data_jpa);
$("#archetype").on("change", function () {
$("#starters div").remove();
$("#dependencies input").prop('checked', false);