原创 使用多線程處理邏輯

@GetMapping("/order") public Callable order(){ Callable callable = new Callable() { @Override public UserTest call(

原创 git安裝配置及使用

1.下載地址 git下載地址 win操作 mac linux 2.初始化配置 git config –-global user.name ‘賬號’ git config –-global user.email ‘郵箱’ ss

原创 關於org.apache.http包中的HttpClient報錯問題

轉:https://blog.csdn.net/u014740342/article/details/53057200           在前一段時間工作中接觸到了HttpClient,之前都沒聽過,也就不知道怎麼使用,是同事幫

原创 自定義字段驗證

1.定義@interface package com.jwt.jwt.inter; import javax.validation.Constraint; import javax.validation.Payload; im

原创 centos7 rpm安裝mysql

0、環境 本文操作系統: CentOS 7.2.1511 x86_64 MySQL 版本: 5.7.16 1、卸載系統自帶的 mariadb-lib [root@centos-linux ~]# rpm -qa|grep mari

原创 獲取本機ip

public InetAddress getLocalHostLANAddress() throws Exception { try { InetAddress candidateAddress = nul

原创 springboot 整合阿里 Druid 數據庫連接池

pom配置 <dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId>

原创 啓動ActiveMQ異常:java.net.URISyntaxException: Illegal character in hostname at index解決辦法

首先,我要吐槽一下網上對於這個問題的解決方案,抄過來抄過去都一個樣,連正確性都不測試一下......首先翻譯一下這個異常,就是:主機名中包含非法字符,那麼非法字符是什麼呢?是“_”下劃線;那麼解決辦法就很簡單了,改主機名:1、方

原创 MappedByteBuffer 高效讀寫文件

private static final int start = 0; public static void main(String[] args) throws IOException { Ra

原创 獲取集合中某個元素的上一個元素

List<String> list = new ArrayList<>(); list.add("001"); list.add("005"); list.add("003");

原创 curator實現分佈式鎖

轉https://blog.csdn.net/liyiming2017/article/details/83896169 [轉自](https://blog.csdn.net/liyiming2017/a

原创 java8根據兩個字段排序(一正序一倒敘)

List<Student> collect2 = list.stream() .sorted(Comparator.comparing(Student::getAge).reversed().thenComparing(Studen

原创 mvn控制不同的發佈環境

項目目錄 pom配置 在主pom中添加 <profiles> <profile> <id>dev</id> <properties>

原创 mvn插件

spotbugs 代碼檢查 <plugin> <groupId>com.github.spotbugs</groupId> <artifactId>spotbu

原创 設置linux在內存不足的時候,不會自動殺進程

cat /proc/version,查看linux內核版本 如果linux內核版本<3.5,那麼swapiness設置爲0,這樣系統寧願swap也不會oom killer(殺掉進程) 如果linux內核版本>=3.5,那麼swapin