Skip to content

Instantly share code, notes, and snippets.

@anny0739
anny0739 / fluent.conf
Last active September 21, 2017 06:47
<source>
@type kafka_group
brokers "#{ENV['KAFKA_BROKERS']}"
consumer_group "#{ENV['KAFKA_CONSUMER_GROUP']}"
topics "#{ENV['KAFKA_TOPIC']}"
</source>
<filter search>
@type mysql_json
</filter>
spring.profiles: local
app:
url: localhost:8801
---
spring.profiles: dev
app:
url: dev:8801
---
spring.profiles: stage
app:
@anny0739
anny0739 / bootstrap.yml
Created February 8, 2020 08:38
bootstrap.yml
spring:
application:
name: app_name
profiles:
active: local
aws:
secretsmanager:
name: app_name
cloud:
aws:
import javax.crypto.Mac
import javax.crypto.spec.SecretKeySpec
import kotlin.experimental.and
fun main(args: Array<String>) {
val hmacFromKomoju = "06cb40bd7c630613e41f874296eddd0153d023857a76a9de52daad5da6c2bbe4"
val algorithm = "HmacSHA256"
@anny0739
anny0739 / ConcurrentTest.java
Created April 27, 2020 05:58
ConcurrentTest.java
package com.benx.weply.core.spring.jpa;
import com.benx.weply.core.SpringTest;
import com.benx.weply.core.domain.enums.Shop;
import com.benx.weply.core.domain.user.User;
import com.benx.weply.core.domain.user.UserService;
import lombok.extern.slf4j.Slf4j;
import org.hibernate.StaleObjectStateException;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import javax.persistence.EntityManager;
@anny0739
anny0739 / Assertion.java
Created May 12, 2020 04:51
Assertion.java
@Entity
public class Goods {
private int goodsId;
}
@Entity
public class GoodsDetail {
private Assertion<Goods> goodsId;
}
@anny0739
anny0739 / SyncTest.java
Created June 5, 2020 15:08
SyncTest.java
@Inject
private RedissonClient redissonClient;
private Exception exception;
private final CountDownLatch latch = new CountDownLatch(2);
@Test
public void syncTest() {
List<Thread> threads = IntStream.range(0, 2)
.mapToObj(i -> new Thread1())
@anny0739
anny0739 / CircularReferenceTest.java
Created June 19, 2020 10:17
CircularReferenceTest.java
@Service
public class AService {
@Autowired
private BService bService;
public void doSomething() {
bService.doSomething();
}
}
@anny0739
anny0739 / KubernetesLabels.java
Last active June 24, 2020 05:46
KubernetesLabels.java
public class KubernetesLables {
@JsonProperty("beta.kubernetes.io/arch")
private String betaArch;
@JsonProperty("beta.kubernetes.io/os")
private String betaOs;
@JsonProperty("kubernetes.io/arch")
private String arch;
@JsonProperty("kubernetes.io/hostname")
private String hostname;
@JsonProperty("kubernetes.io/os")
@anny0739
anny0739 / TransactionService.java
Last active July 9, 2020 02:31
TransactionTest.java
public AService {
@Autowired private ARepository repository;
@Transactional
public void save(A a) {
repository.save(a);
// update(a); // update 트랜잭션 적용안됨 XXX
}
@Trnasaction(propagation = Propagation.REQURIES_NEW)