<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[Michaeles的博客]]></title><description><![CDATA[]]></description><link>https://blog.csdn.net/Michaeles</link><language>zh-cn</language><generator>https://blog.csdn.net/</generator><copyright><![CDATA[Copyright &copy; Michaeles]]></copyright><item><title><![CDATA[Assert断言的使用]]></title><link>https://blog.csdn.net/Michaeles/article/details/100582632</link><guid>https://blog.csdn.net/Michaeles/article/details/100582632</guid><author>Michaeles</author><pubDate>Fri, 06 Sep 2019 16:48:31 +0800</pubDate><description><![CDATA[断言方法说明：
单元测试中，常用的断言方法介绍：
Assert.AreEqual() 测试指定的值是否相等，如果相等，则测试通过；
Assert.Inconclusive() 表示一个未验证的测试；
Assert.IsTrue() 测试指定的条件是否为True，如果为True，则测试通过；
Assert.IsFalse() 测试指定的条件是否为False，如果为False，则测试通过；
Asser...]]></description><category></category></item><item><title><![CDATA[mock服务搭建-papi接口管理平台]]></title><link>https://blog.csdn.net/Michaeles/article/details/90897236</link><guid>https://blog.csdn.net/Michaeles/article/details/90897236</guid><author>Michaeles</author><pubDate>Wed, 05 Jun 2019 09:54:55 +0800</pubDate><description><![CDATA[内网部署（以RHEL/CentOS为例）

环境要求


nodejs（7.6+)

mongodb（2.6+）


1.安装nodejs


curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -

yum -y install nodejs

***如果没有编译环境，则需要yum install g...]]></description><category></category></item><item><title><![CDATA[Mock服务搭建——mongo的连接]]></title><link>https://blog.csdn.net/Michaeles/article/details/90800055</link><guid>https://blog.csdn.net/Michaeles/article/details/90800055</guid><author>Michaeles</author><pubDate>Tue, 04 Jun 2019 18:46:31 +0800</pubDate><description><![CDATA[一、安装 mongodb

1.install 之前，iTerm2 下用 brew 查看已安装软件、搜索 mongodb：


			1

			2
			
			
			brew list

			brew search mongodb
			
		2.安装 mongodb :


			1
			
			
			brew install mongodb
			
		此处需要稍等一段时间，成功后...]]></description><category></category></item><item><title><![CDATA[事务回滚时的异常处理机制]]></title><link>https://blog.csdn.net/Michaeles/article/details/90025781</link><guid>https://blog.csdn.net/Michaeles/article/details/90025781</guid><author>Michaeles</author><pubDate>Thu, 09 May 2019 16:13:28 +0800</pubDate><description><![CDATA[一、Java异常

1.运行时异常和非运行时异常

（1）运行时异常特点是Java编译器不会检查它；

（2） 非运行时异常（编译期异常）：如果不处理，程序就不能编译通过。如IOException、SQLException；

二、使用事务时对异常的处理

1.声明式事务只对运行期异常RuntimeException做rollback，特殊情况下需要对编译器异常转换为运行期异常。

2.spri...]]></description><category></category></item><item><title><![CDATA[遍历中修改HashMap的Key]]></title><link>https://blog.csdn.net/Michaeles/article/details/89924404</link><guid>https://blog.csdn.net/Michaeles/article/details/89924404</guid><author>Michaeles</author><pubDate>Tue, 07 May 2019 16:49:01 +0800</pubDate><description><![CDATA[public static void main(String[] args) {
        HashMap&lt;String, String&gt; hashMap = new HashMap&lt;&gt;();
        for (int i = 0; i &lt; 6; i++) {
            hashMap.put("key-" + i, "valu...]]></description><category></category></item><item><title><![CDATA[分布式定时任务的异步处理]]></title><link>https://blog.csdn.net/Michaeles/article/details/89841721</link><guid>https://blog.csdn.net/Michaeles/article/details/89841721</guid><author>Michaeles</author><pubDate>Sun, 05 May 2019 11:20:13 +0800</pubDate><description><![CDATA[最近项目中遇到一个问题 , 在SpringBoot中设置了定时任务之后 , 在某个点总是没有执行 . 经过搜索研究发现 , spring 定时器任务scheduled-tasks默认配置是单线程串行执行的 . 即在当前时间点之内 . 如果同时有两个定时任务需要执行的时候 , 排在第二个的任务就必须等待第一个任务执行完毕执行才能正常运行.如果第一个任务耗时较久的话 , 就会造成第二个任务不能及时执行...]]></description><category></category></item><item><title><![CDATA[项目集群部署]]></title><link>https://blog.csdn.net/Michaeles/article/details/89475642</link><guid>https://blog.csdn.net/Michaeles/article/details/89475642</guid><author>Michaeles</author><pubDate>Tue, 23 Apr 2019 16:35:18 +0800</pubDate><description><![CDATA[目录
1.1 Nginx的安装1.2 Nginx的配置测试：

欢迎访问我的个人网站O(∩_∩)O哈哈~希望大佬们能给个star，个人网站网址：http://www.wenzhihuai.com，个人网站代码地址：https://github.com/Zephery/newblog。
洋洋洒洒的买了两个服务器，用来学习分布式、集群之类的东西，整来整去，感觉分布式这种东西没人指导一下真的是太抽象了...]]></description><category></category></item><item><title><![CDATA[Redis在高并发下常见的错误场景]]></title><link>https://blog.csdn.net/Michaeles/article/details/89414074</link><guid>https://blog.csdn.net/Michaeles/article/details/89414074</guid><author>Michaeles</author><pubDate>Sat, 20 Apr 2019 10:44:56 +0800</pubDate><description><![CDATA[在使用Redis场景下，很多同学在使用中不注意，一旦系统并发比较高的时候，往往请求还是直接打到数据库，并没有击中缓存。下面我说几种场景，已经解决方案。



第一种，看看自己是否已经入坑了。

//判断Redis缓存是否有数据
if(!jedis.exists("testlockListV_1")){
System.out.println("多线程情况下多次击穿缓存，直接访问数据库");
Str...]]></description><category></category></item><item><title><![CDATA[java8 lambada表达式使用]]></title><link>https://blog.csdn.net/Michaeles/article/details/89096360</link><guid>https://blog.csdn.net/Michaeles/article/details/89096360</guid><author>Michaeles</author><pubDate>Mon, 08 Apr 2019 16:59:24 +0800</pubDate><description><![CDATA[@Transactional
@Override
public void setMenuToRole(Long roleId, Set&lt;Long&gt; menuIds) {
    if (!CollectionUtils.isEmpty(menuIds)) {
        menuIds.forEach(menuId -&gt; {
            sysMenuRepos...]]></description><category></category></item><item><title><![CDATA[深入了解Kafka底层原理]]></title><link>https://blog.csdn.net/Michaeles/article/details/88652478</link><guid>https://blog.csdn.net/Michaeles/article/details/88652478</guid><author>Michaeles</author><pubDate>Mon, 18 Mar 2019 23:56:31 +0800</pubDate><description><![CDATA[一、Kafka基础

1.kafka的基本运行原理？kafka的架构部署？

（1）Kafka通过多副本机制实现故障自动转移；

2.kafka的文件存储机制？

3.kafka如何确保消息的精确传输？如何确保消息的准确存储？如何确保消息的正确消费？

4.kafka的常用名词？

（1）LEO(LogEndOffset):表示每个partititon中最后一条message的位置；

（2）HW...]]></description><category></category></item><item><title><![CDATA[微服务拆分]]></title><link>https://blog.csdn.net/Michaeles/article/details/85646170</link><guid>https://blog.csdn.net/Michaeles/article/details/85646170</guid><author>Michaeles</author><pubDate>Sun, 17 Mar 2019 22:12:52 +0800</pubDate><description><![CDATA[1.传统方式和微服务之间的区别



二、服务拆分



1.水平复制：将应用程序水平复制，通过负载均衡运行程序的多个副本，达到应用程序的伸缩性；

2.数据分区：每个服务器运行的代码是一样的；

3.功能解耦：将不同的模块分成不同的服务。

（1）单一职责，松耦合，高内聚

（2）关注点分离

三、项目实战


















...]]></description><category></category></item><item><title><![CDATA[浅谈分布式应用——基于zookeeper+kafka]]></title><link>https://blog.csdn.net/Michaeles/article/details/88563192</link><guid>https://blog.csdn.net/Michaeles/article/details/88563192</guid><author>Michaeles</author><pubDate>Thu, 14 Mar 2019 22:36:22 +0800</pubDate><description><![CDATA[1.实现分布式应用的基本要求是主备节点的切换。


]]></description><category></category></item><item><title><![CDATA[记录一次数据处理问题]]></title><link>https://blog.csdn.net/Michaeles/article/details/88530791</link><guid>https://blog.csdn.net/Michaeles/article/details/88530791</guid><author>Michaeles</author><pubDate>Wed, 13 Mar 2019 13:47:49 +0800</pubDate><description><![CDATA[1.数据处理

要求，向result中插入一条username的数据，数据结构如下图所示。



2.代码


//转换成json串
String response = HttpClientUtil.executeGet(interfaceUri.getUrl()+&quot;/trade/find&quot;, param, header, 2000);
       
//1.将string字符串转换为map
 ...]]></description><category></category></item><item><title><![CDATA[ftp账号使用]]></title><link>https://blog.csdn.net/Michaeles/article/details/88525859</link><guid>https://blog.csdn.net/Michaeles/article/details/88525859</guid><author>Michaeles</author><pubDate>Wed, 13 Mar 2019 09:53:19 +0800</pubDate><description><![CDATA[1.查看ftp账号信息

vim /etc/vsftpd/chroot_list

2.重置ftp账号密码

passwd username
]]></description><category></category></item><item><title><![CDATA[整合springboot父子项目时出现的一个问题]]></title><link>https://blog.csdn.net/Michaeles/article/details/88406875</link><guid>https://blog.csdn.net/Michaeles/article/details/88406875</guid><author>Michaeles</author><pubDate>Mon, 11 Mar 2019 20:00:27 +0800</pubDate><description><![CDATA[1.报错springboot版本2.1.3.RELEASE

解决：将tomcat更换为jetty就好了。


java.lang.NoSuchMethodError: javax.servlet.http.HttpServletRequest.getHttpServletMapping()Ljavax/servlet/http/HttpServletMapping;
	at org.apache...]]></description><category></category></item><item><title><![CDATA[详解hashmap底层原理]]></title><link>https://blog.csdn.net/Michaeles/article/details/88385462</link><guid>https://blog.csdn.net/Michaeles/article/details/88385462</guid><author>Michaeles</author><pubDate>Sun, 10 Mar 2019 23:48:00 +0800</pubDate><description><![CDATA[一、hashmap的源码问题，hashmap的底层结构？put操作？

1.底层结构（基于Java8）

性能：O（1）、O（n）、O(logn)



注：当链表大小超过8，会被改成红黑树；当低于6时，又会被改为链表；

2.put操作



流程：

（1）先调用putVal()方法，当table数组为空时调用resize()方法，进行初始化；

（2）对key进行求hash值（是hash方法...]]></description><category></category></item><item><title><![CDATA[关于net.sf.json的使用]]></title><link>https://blog.csdn.net/Michaeles/article/details/88351722</link><guid>https://blog.csdn.net/Michaeles/article/details/88351722</guid><author>Michaeles</author><pubDate>Fri, 08 Mar 2019 22:02:15 +0800</pubDate><description><![CDATA[一、关于net.sf.json的使用

1.将linkedHashmap先转成jsonarray

JSONArray list = JSONArray.fromObject(map);

2.然后把JSONArray转成Iterator

Iterator&amp;lt;Object&amp;gt; it = (Iterator&amp;lt;Object&amp;gt;) list.iterator();

3.将itera...]]></description><category></category></item><item><title><![CDATA[Java内存泄漏的排查总结]]></title><link>https://blog.csdn.net/Michaeles/article/details/87716493</link><guid>https://blog.csdn.net/Michaeles/article/details/87716493</guid><author>Michaeles</author><pubDate>Thu, 21 Feb 2019 11:18:53 +0800</pubDate><description><![CDATA[1.什么是内存泄漏？

（1）程序在申请内存后，无法释放已经申请的内存空间。内存泄漏是纯代码层的问题。主要是因为一些对象占用内存，却不会被GC回收。

（2）这些对象的特点是可达的、无用的。

二、内存泄漏的排查案例

1.确定频繁GC的对象

（1）使用jps找出正在运行的虚拟机进程；

（2）使用jstat监视虚拟机的各种运行状态信息；

2.找出频繁GC的原因

（1）使用jmap初步分析内...]]></description><category></category></item><item><title><![CDATA[如何处理高并发的问题？]]></title><link>https://blog.csdn.net/Michaeles/article/details/87691566</link><guid>https://blog.csdn.net/Michaeles/article/details/87691566</guid><author>Michaeles</author><pubDate>Tue, 19 Feb 2019 10:44:42 +0800</pubDate><description><![CDATA[1.前后端分离

（1）页面静态化处理+网站静态资源部署在CDN上

（2）文件服务器+图片服务器

2.服务器采用负载均衡+反向代理

3.增加缓存，使用nosql

4.数据库采用集群、读写分离、分库分表




...]]></description><category></category></item><item><title><![CDATA[单例的双重检测实现]]></title><link>https://blog.csdn.net/Michaeles/article/details/86702450</link><guid>https://blog.csdn.net/Michaeles/article/details/86702450</guid><author>Michaeles</author><pubDate>Wed, 30 Jan 2019 14:14:20 +0800</pubDate><description><![CDATA[

//改进

]]></description><category></category></item></channel></rss>