• 胡侃

    Would all screens in cars just like the screen in Tesla 5 years later?

    Back in 2007, when first iPhone released it’s totally different with any other phones with only one big screen in the middle and a button at the bottom. After 15 years, the outlook of iPhone really don’t change that much, with removing button and bigger screen. that’s it. The thing changed most in the past 15 years is all other phones look much more similar now.. Maybe the only difference is how they layout their cameras.. So the first generation of Tesla Model S released in 2012, 5 years after the first generation of iPhone, which has a big screen in the middle and that’s it. Nowadays, more modern cars…

  • Spring,  技术

    Spring Cloud – Bootstrapping Version 2

    This article is based on https://www.baeldung.com/spring-cloud-bootstrapping. Which was written on January 21, 2021. Even it’s only one year ago it’s a little bit out of dated and there are some errors in the doc. If you still want to refer to the original doc, here are some corrections you need to do: When you setup discovery service, you need to add server.port=8082 into the application.properties Also in discovery service, you need to add following dependency otherwise it would report a exception when you start the service: No spring.config.import property has been defined In Gateway service, the plugin zuul has been deprecated already, use Spring Cloud Gateway instead. (https://stackoverflow.com/questions/65924096/spring-boot-2-4-2-gateway-api-with-zuul) TODO: new…

  • Docker,  技术

    How to generate docker image

    Fabric8 maven plugin The first way to do is using fabric8 maven plugin (https://dmp.fabric8.io/) . We have something like this to define the image in pom.xml: And assembly file: Framework build-in target If you are using Sprint boot, it has the maven docker image target mvn spring-boot:build-image. Based on the doc here it has some benefit like using exploded folder other than fat jar; but I guess it may not flexible enough. Write your own dockerfile This is more direct and I guess it has most flexibility. Here is one example:

  • Others,  技术

    All technical articles will be written in English

    A couple reasons: In the end, I hope, at some point, my article can really help more people. I feel more and more it’s more nature to write technical articles in English since all articles I have read are english written. If you do need Chinese Version, yes, I can do that. just leave comment and I am more than happy to spend mins to transform it.

  • Java,  工具,  技术

    如何在本地环境同时用多个jdk版本

    如果工作在不同的项目,可能需要不同的jdk版本。如果用mvn的话默认只是用系统设置的版本。这时候如果想在命令行编译就会比较麻烦。最简单的做法是把系统的java版本设置成最常用的,然后设置别名分别对应不同的版本。 下面是例子: 这样就可以了。 另一个方法通常IDE的mvn都可以用单独的配置,比如说用Intellij,我们可以在不同的Intellij的project设置不同的版本:

  • 技术,  网站

    调整Ashe Theme的标题图片高度

    WordPress有一个很好的免费插件Ashe。有一个很大的问题是免费版本的不能调整高度,默认高度500pt实在是太大了。不放那个header图片网站又显得太空荡。 研究后发现可以在目录/wp-content/themes/ashe/assets/css/responsive.css 里面搜索下面字段: 把高度更改了就好了。 注意的是浏览器通常有缓存,需要清除缓存才可以生效。

  • 技术,  网络

    网站无法访问问题的解决 (This Site Can’t Be Reached)

    今天网站忽然无法访问,显示“the site cannot be reached”. 然后试图用局域网ip直接访问,发现时可以的,当然图片无法显示,因为图片的链接都是带域名的。 查看服务器的剩余硬盘空间,内存,发现都正常。 接下来重启apache,service apache2 restart。 还是不行。 去google domain查看域名跳转,貌似也没问题。然后 ping liangqi.org, 解析的域名还是没问题。 在mac下用. traceroute liangqi.org 貌似也没啥问题。 最后试了一下 telnet liangqi.org 443 发现被reject. 试了一下其他域名是可以telnet的。于是想着是不是路由器的动态域名跳转有问题。去路由器删了端口转发,重新建了一个,发现已经可以telnet 443了。 不要问为什么路由器的端口转发忽然出问题了,我也不知道。应该就是软件bug吧。产品环境总是问题千差万别。 再重新连接网站,恢复! 😁

  • Design,  技术

    为什么迁移Z公司的monolithic system到microservices如此困难

    最近在读DDD (Domain Driven Design)的内容,以前的monolithic没有遵循一些基本的DDD的原则。 As a reference 这个是另一篇DDD的文章: Domain Driven Design. Aggregate必须遵循的三个rule的最后一个在一般的应用开发中很难遵守。我觉得基本上没有monolothic的程序开发真的遵守。一般都是把跨aggregate的操作放在一个事务里面,因为分开的话就太麻烦了,在写monolithic的时候也没人知道saga的design pattern,那如果分开的话如何保证事物一致性?很难想象有人会自找麻烦去把每一个aggregate分开成不同的事物。 分拆microservices的时候,把一个事务分开成多个事务,其实某种程度上不可避免的会影响用户体验。比如说一个大的同步call,如果分成多个事务,采用异步处理,那么用户体验会不一样。如果想要用户体验一样,所有的microservice其实最终还是要采用同步(或者异步等待)的方式,这样availability还是会受影响,各个micro service深度耦合。 这种拆开对于面向客户的应用应该还好,每个客户适应新的流程就好了。但是对于B2B来讲,客户的集成通常都是前一发动全身。而且拆分过后对于性能的影响也是不可忽略。可能觉得最后风险太大,就只能放弃。 有一个可行的方法可能是保持老的系统使用的同时,让新的用户迁移到新的系统里面。但是这里又会有新的问题,新的系统是不是完全功能兼容,而且新的系统也在不断演进,比如说拆分了一部分内容,迭代出入,然后再次拆分,迭代的时候新的客户的行为又变了。所以这种也只能是把所有行为改变的系统一起release。 他们曾经试图拆分product catalog,也失败了。Notification相对来讲是成功的,是通过新客户用新的系统,老客户用老的系统的方式来做的。比如说Order相关的notification全部都是新的架构。因为有一些东西还不完全兼容。