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
@ControllerAdvice | |
public class PageResponseAdvice implements ResponseBodyAdvice<Object> { | |
@Override | |
public boolean supports(MethodParameter returnType, Class<? extends HttpMessageConverter<?>> converterType) { | |
return PageResponse.class.isAssignableFrom(returnType.getParameterType()); | |
} | |
@Override | |
public Object beforeBodyWrite(Object body, |
delay-exchange
: Geciktirilecek mesajın bırakıldığı exchange.delay-queue
:delay-exchange
'e bağlı. Herhangi bir tüketicisi olmamalı.ana-exchange
: Geciktirilmeden tüketilmek istenen mesajların bırakılabileceği exchange.ana-queue
:ana-exchange
'e bağlı kuyruk. Tüketicisi var.
delay-queue
şu parametrelerle oluşturulur:
x-dead-letter-exchange
: -- boşx-message-ttl
:3000
-- mesajın bekletileceği milisaniye
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
for index_name in `curl -XGET "$ES_HOST/products_*" | jq -r 'keys[]'`; do | |
curl -XDELETE "$ES_HOST/$index_name" | |
done |
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
public class ThreadPoolTaskExecutorWithMdcPropagation extends ThreadPoolExecutor { | |
private static final Logger LOGGER = LoggerFactory.getLogger(ThreadPoolTaskExecutorWithMdcPropagation.class); | |
private final Map<String, String> parentMdcContextMap; | |
public ThreadPoolTaskExecutorWithMdcPropagation(int corePoolSize, int maxPoolSize, long keepAliveTime, TimeUnit keepAliveTimeUnit) { | |
super(corePoolSize, maxPoolSize, keepAliveTime, keepAliveTimeUnit, new LinkedBlockingQueue<>()); | |
parentMdcContextMap = MDC.getCopyOfContextMap(); | |
} |
In Vim, use command below to format text as json in current buffer.
:%!python -m json.tool
Source: https://blog.realnitro.be/2010/12/20/format-json-in-vim-using-pythons-jsontool-module/
Alternative approach using jq
:
:%! jq '.'
on macOS
default
folder in /Users/USERNAME/Library/Preferences/DataGrip2018.1/projects
contains database connection properties.
DataGrip2018.1 states your DataGrip version
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
pyenv shell 3.6.4 # Shell specific Python version | |
/usr/local/var/pyenv/versions/3.6.4/bin/python -m pip install -U PACKAGE_NAME |
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
docker logs -f --since 2s $(docker ps -qa --filter "name=CONTAINER_NAME") | pv -l -c > /dev/null |
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
curl -XGET "http://ES_CLUSTER/_search" -H 'Content-Type: application/json' -d' | |
{ | |
"query": { | |
"range" : { | |
"@timestamp" : { | |
"gte" : "now-15m", | |
"lt" : "now" | |
} | |
} | |
} |