Não use UUID
como PK nas tabelas do seu banco de dados.
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 javax.persistence.*; | |
import javax.validation.constraints.NotBlank; | |
import javax.validation.constraints.Size; | |
import org.hibernate.validator.constraints.ISBN; | |
import java.util.Objects; | |
import static org.hibernate.validator.constraints.ISBN.Type.ISBN_13; |
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 br.com.zup.edu.app2.xxx.samples.aws.sqs; | |
import br.com.zup.edu.app2.xxx.samples.aws.sqs.model.Customer; | |
import br.com.zup.edu.app2.xxx.samples.aws.sqs.model.CustomerRepository; | |
import io.awspring.cloud.messaging.listener.SqsMessageDeletionPolicy; | |
import io.awspring.cloud.messaging.listener.annotation.SqsListener; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; | |
import org.springframework.messaging.handler.annotation.Header; |
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
## | |
# Reverting a range of commits | |
# | |
# git --pretty=oneline --abbrev-commit older_commit..newer_commit # not includes the oldest commit | |
# git --pretty=oneline --abbrev-commit older_commit^..newer_commit # includes the oldest commit | |
## | |
# just to be sure about the commits, list them | |
git log --pretty=oneline --abbrev-commit 1f80548^..4b293d5 |
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
@Inherited | |
@InterceptorBinding | |
@Retention(RetentionPolicy.RUNTIME) | |
@Target({ElementType.METHOD,ElementType.TYPE}) | |
public @interface Lock { | |
LockType value() default LockType.WRITE; | |
} |
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 br.com.triadworks.rponte.util; | |
import java.text.Normalizer; | |
public class StringUtils { | |
/** | |
* Remove toda a acentuação da string substituindo por caracteres simples sem acento. | |
*/ | |
public static String unaccent(String src) { |
- Modern technologies won't support it (RabbitMQ, Kafka, etc.);
- This is a form of using Inter-Process Communication in a synchronized way and this reduces availability;
- All participants of the distributed transaction need to be avaiable for a distributed commit, again: reduces availability.
Implementing business transactions that span multiple services is not straightforward. Distributed transactions are best avoided because of the CAP theorem. Moreover, many modern (NoSQL) databases don’t support them. The best solution is to use the Saga Pattern.
[...]
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
"Be conservative in what you send; be liberal in what you accept." | |
http://en.wikipedia.org/wiki/Robustness_principle | |
- Tolerant Reader by Martin Fowler | |
http://martinfowler.com/bliki/TolerantReader.html |
Gloogle Cloud: Rate-limiting strategies and techniques
- Even in the cases where the rate limiting is implemented entirely on the server side, the client should be engineered to react appropriately.
- Decisions about failing open or failing closed are mostly relevant on the server side, but knowledge of what retry techniques the clients use on a failed request might influence your decisions made about server behavior.
- In HTTP services, the most common way that services signal that they are applying rate limiting is by returning a 429 status code in the HTTP response. A 429 response can provide additional details about why the limit is applied (for example, a freemium user has a lower quota, or the system is undergoing maintenance).
- Build your system with robust error handling in case some part of your rate-limiting strategy fails, and understand what users of your service will receive in those situations. [...] U
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
# The command finds the most recent tag that is reachable from a commit. | |
# If the tag points to the commit, then only the tag is shown. | |
# Otherwise, it suffixes the tag name with the number of additional commits on top of the tagged object | |
# and the abbreviated object name of the most recent commit. | |
git describe | |
# With --abbrev set to 0, the command can be used to find the closest tagname without any suffix: | |
git describe --abbrev=0 | |
# other examples |
NewerOlder