<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Andrei Chernyshev on Medium]]></title>
        <description><![CDATA[Stories by Andrei Chernyshev on Medium]]></description>
        <link>https://medium.com/@andrei.chernyshev?source=rss-3d5d9acf17e6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ES6B5E4u6tlZ4ofN1pcpZQ.jpeg</url>
            <title>Stories by Andrei Chernyshev on Medium</title>
            <link>https://medium.com/@andrei.chernyshev?source=rss-3d5d9acf17e6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 09:45:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@andrei.chernyshev/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Dockerizing Java 10 Spring Boot app]]></title>
            <link>https://itnext.io/dockerizing-java-10-spring-boot-app-d21e95a348f6?source=rss-3d5d9acf17e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/d21e95a348f6</guid>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Andrei Chernyshev]]></dc:creator>
            <pubDate>Wed, 25 Apr 2018 20:42:54 GMT</pubDate>
            <atom:updated>2018-06-29T08:00:26.053Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OwL2-B5tBq-hkuQkt0l1YQ.png" /></figure><p>In my previous <a href="https://medium.com/@andrei.chernyshev/java-10-migration-story-cdc65c05bb5a">article</a> I’ve been talking about using <strong>Java 10</strong> to build and run your <a href="https://projects.spring.io/spring-boot/"><strong>Spring Boot</strong></a> app. Now it is time to talk how to put it in Docker container. Better support of containerization was one of the main features of Java 10 release. So, let’s go!</p><p>That is fairly simple process, so just take a look on following code snippet:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fca86b4a5aa946fe8c2bc4f68d0b3b63/href">https://medium.com/media/fca86b4a5aa946fe8c2bc4f68d0b3b63/href</a></iframe><p>Here, as you can see, I use multi-stage Docker build file. Quick note: multi-stage builds are supported with <strong>Docker 17.05</strong> or higher but result image is backward compatible(at least from my experience). On the first stage it downloads <strong>JDK</strong> from Oracle’s, but it can make sense to store your own copy somewhere closer to your build server since it isn’t that small — a little bit less then 200mb. So, it is downloaded, unziped and ready to be used. But not so quick.</p><p>As you probably remember, <strong>Java 9</strong> gave us module system and <strong>JDK</strong> itself is also modularized. That means we don’t have to bring whole <strong>JDK</strong> to production but we could build our own striped version specifically for our app’s needs. There is jlink tool provided for that. Just take a look how it is used in the build process. The modules listed there should be enough to run a typical <strong>Spring Boot</strong> application. In my production case I had to put java.scripting, jdk.scripting.nashorn to the list as well.</p><p>On the second stage it copies results from previous one, defines some environment variables, exposes port, copy launch.sh and app’s artifact. Not a rocket science at all.</p><p>And here is launch.sh script I’ve just mentioned:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/85f991a72df5db9edfe51b7d096d6649/href">https://medium.com/media/85f991a72df5db9edfe51b7d096d6649/href</a></iframe><p>That is just a small helper to ensure that there are all important things provided, etc. But, sure, it is optional.</p><p>And that should be enough to put your app to the production. Please, put some comments down if you have some thoughts how to make it better!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d21e95a348f6" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/dockerizing-java-10-spring-boot-app-d21e95a348f6">Dockerizing Java 10 Spring Boot app</a> was originally published in <a href="https://itnext.io/">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Java 10 — migration story]]></title>
            <link>https://itnext.io/java-10-migration-story-cdc65c05bb5a?source=rss-3d5d9acf17e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/cdc65c05bb5a</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[java10]]></category>
            <dc:creator><![CDATA[Andrei Chernyshev]]></dc:creator>
            <pubDate>Mon, 26 Mar 2018 21:56:57 GMT</pubDate>
            <atom:updated>2018-04-09T12:40:01.649Z</atom:updated>
            <content:encoded><![CDATA[<h3>Java 10 — migration story</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IY5IBEVlblI3iFHq72kGCA.jpeg" /></figure><blockquote><a href="https://www.linkedin.com/cws/share?url=https%3A%2F%2Fitnext.io%2Fjava-10-migration-story-cdc65c05bb5a%3Futm_source%3Dmedium_sharelink%26utm_medium%3Dsocial%26utm_campaign%3Dbuffer">Click here to share this article on LinkedIn »</a></blockquote><p>As you probably know <a href="http://jdk.java.net/10/"><strong>Java 10</strong></a> was recently released. Not so many new features. At least for <a href="http://kotlinlang.org/"><strong>Kotlin</strong></a> developers… But there are <a href="http://www.oracle.com/technetwork/java/javase/10-relnote-issues-4108729.html">several improvements</a> to <strong>JVM</strong> itself. And, I guess, there will be more in upcoming versions. Which we will get twice a year from now! So, I think it is better to take some time and sync your projects to make it easier in future to migrate with the same speed.</p><p>The main project I’m involved into is <strong>SpringBoot</strong> 1.5.X based service made with <strong>Kotlin</strong> and it uses <strong>Postgres</strong> as a data base. At this moment it uses <strong>Java 8</strong>. Such a great chance to skip <strong>Java 9</strong> and jump directly to 10! Being inspired by this thought I have opened my laptop.</p><p>I use <a href="http://sdkman.io/"><strong>SDKman</strong></a> to install Java but for <strong>Java 10</strong> it delivers broken version for some unknown reason. So this time I had to download bundle from the official <a href="http://jdk.java.net/10/">website</a> manually.</p><p>The biggest issue is that some libraries are no longer part of <strong>JDK</strong>. That is good news — it is getting cleaner. But as a result, you need to define additional dependencies for your project. You can also include them with command line parameters since they are actually still in <strong>JDK</strong> but I think it is better to move them into dependencies because as far as I’ve understood they gonna be removed in future releases completely. In my case it was:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SQ14w9r73jrD6tHWTt7d-w.png" /></figure><p>The second issue was <a href="https://docs.gradle.org/current/userguide/jacoco_plugin.html"><strong>Jacoco Gradle plugin</strong></a>. If you use it to measure the code coverage there is good news— <strong>Jacoco</strong> itself supports <strong>Java 10</strong>. But to make <strong>Jacoco Gradle plugin</strong> work I had to specify the tool version like this in my gradle build file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*njwwVXG6jfxW7NDI3YtQnw.png" /></figure><p>And the last part that was broken — <a href="http://site.mockito.org/"><strong>Mockito</strong></a>. That issue could be solved by adding a fresh version of <a href="http://bytebuddy.net/"><strong>Bytebuddy</strong></a> library like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VCu3z7x3Lm9b0WKn_czzLw.png" /></figure><p>After these modifications, I was able to build and run my project and all tests were green. Don’t be afraid to migrate! Next step would be to prepare <strong>Dockerbuild</strong> file. But that is a topic for the next article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cdc65c05bb5a" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/java-10-migration-story-cdc65c05bb5a">Java 10 — migration story</a> was originally published in <a href="https://itnext.io/">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kotlin for Pebble]]></title>
            <link>https://medium.com/@andrei.chernyshev/kotlin-for-pebble-e33086d8f8da?source=rss-3d5d9acf17e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/e33086d8f8da</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[pebble]]></category>
            <category><![CDATA[smartwatch]]></category>
            <category><![CDATA[kotlin]]></category>
            <dc:creator><![CDATA[Andrei Chernyshev]]></dc:creator>
            <pubDate>Fri, 16 Feb 2018 09:59:15 GMT</pubDate>
            <atom:updated>2018-02-16T10:36:18.237Z</atom:updated>
            <content:encoded><![CDATA[<p>The best Smartwatches are <a href="https://www.pebble.com/"><strong>Pebble</strong></a>. Even taking into account that the company producing them was sold, and there will be no more new devices it is still best smartwatches you can buy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KB-De6zghaKa6iaQcgmVkA.jpeg" /></figure><p>It is specially true if you are a software developer or just love to play with code. <strong>Pebbles</strong> provides you with powerful but simple <strong>SDK</strong> for <strong>C</strong> and <strong>Javascript</strong>. And cool web IDE —<a href="https://cloudpebble.net/"><strong> CloudPebble</strong></a>. As a result, it is super easy to develop apps and watchfaces.</p><p>But you probably know I am a big fan of <a href="http://kotlinlang.org/"><strong>Kotlin</strong></a>, so <strong>C</strong> and <strong>Javascript</strong> were not definitely enough for me! Since <strong>Kotlin-native</strong> at this moment doesn’t support the platforms are used in <strong>Pebble</strong> I’ve decided to go with <strong>KotlinJS</strong>.</p><p><strong>KotlinJS</strong> is a way to transpile <strong>Kotlin</strong> code to <strong>Javascript</strong>. As a starting point, I took this repo — <a href="https://github.com/pebble/pebblejs">https://github.com/pebble/pebblejs</a>. This repo provides you the way to develop apps for <strong>Pebble</strong> in <strong>Javascript</strong> locally.</p><p>First, you need to follow this <a href="https://developer.pebble.com/sdk/install/">https://developer.pebble.com/sdk/install/</a> instructions to setup <strong>PebbleSDK</strong>. Also, you need to setup Kotlin command line tools. I am using <a href="http://sdkman.io/"><strong>SDKMan</strong></a> for that. As soon as you have all that you are good to go.</p><p>So, I’ve made a fork of <strong>pebblejs</strong> repo — <a href="https://github.com/gimlet2/pebblekt">https://github.com/gimlet2/pebblekt</a>. The first thing to check here is <strong>build.sh</strong> script. It has three steps:</p><ol><li>Build Kotlin code to Javascript with <strong>kotlinc-js</strong></li><li>Remove unused code with help of <strong>kotlin-dce-js</strong></li><li>And <strong>pebble build </strong>to actually produce artifact for Pebble</li><li>The last step which is not the part of the script — installation — you can use different options of <strong>pebble install</strong> command.</li></ol><p>The last thing to focus on —<strong> src</strong> folder:</p><ol><li>in <strong>js</strong> folder you will find original <strong>PebbleJS</strong> SDK. Also a result of <strong>Kotlin</strong> transpiling is also could be found here in <strong>app.js</strong> file.</li><li><strong>KotlinJs</strong> standard library could be found in <strong>kotlinjs</strong> folder. It is huge but <strong>kotlin-dce-js</strong> is there to fix this.</li><li>And finally, <strong>kotlin</strong> folder contains bindings to js code(for example <strong>ui.kt</strong>), some helper functions in <strong>pebble.kt</strong> and <strong>app.kt</strong> — the application code.</li></ol><p>If you build and run this code you’ll get typical <em>Hello world</em> app like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/366/1*0P3Yh4uw0NzgUrlPYSkgvQ.jpeg" /></figure><p>With this project I want to try to expand <strong>Kotlin</strong> to a new platform. Worth to mention the latest release of <strong>Kotlin-native</strong>(<a href="https://github.com/JetBrains/kotlin-native/releases/tag/v0.6">0.6.0</a>) with a support of <strong>STM32</strong> chips. But that is a story for another post.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e33086d8f8da" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Prometheus, Python, Flask]]></title>
            <link>https://medium.com/@andrei.chernyshev/prometheus-python-flask-8487c3bc5b36?source=rss-3d5d9acf17e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/8487c3bc5b36</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[gunicorn]]></category>
            <category><![CDATA[flask]]></category>
            <dc:creator><![CDATA[Andrei Chernyshev]]></dc:creator>
            <pubDate>Fri, 02 Feb 2018 16:43:38 GMT</pubDate>
            <atom:updated>2023-12-27T09:59:36.146Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Python</strong> based apps are significant part of the ecosystem in our company. In the era of microservices there is really no much difference which exact technology is in use under the hood. But each service you develop should provide its own API and the way to monitor its status.</p><p>In our setup we use <a href="https://prometheus.io/"><strong>Prometheus</strong></a> to aggregate metrics from all our services. And it works just fine. Especially with our <strong>JVM</strong> apps. But that was not a case for all our Python’s till today.</p><p>As a historical tradition our Pythons apps are mostly done with <a href="http://flask.pocoo.org/"><strong>Flask</strong></a>. And it is a nice framework to do the job. In some cases it is also wrapped with <a href="http://gunicorn.org/"><strong>Gunicorn</strong></a>. And here is a tutorial how to make it work with Prometheus:</p><ol><li>Add the dependency to your project <strong>setup.py</strong> to prometheus_client==0.19.0</li><li>Inside your application define some metrics you want to collect, for example: FLASK_REQUEST_LATENCY = Histogram(__name__.replace(‘.’, ‘_’) + ‘_request_latency_seconds’, ‘Flask Request Latency’) .</li><li>Annotate a method you want to measure with @FLASK_REQUEST_LATENCY.time()</li><li>Add an endpoint to expose the statistics:</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/02865d505d8565166a30c33fef9de070/href">https://medium.com/media/02865d505d8565166a30c33fef9de070/href</a></iframe><p>And that’s it! If your app is just plain Flask without Gunicorn. To make it work in multiprocessor scenario you need to make several additional steps:</p><p>5. Create config for Gunicorn:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f7357a618a60c1608ded0150348cb2d6/href">https://medium.com/media/f7357a618a60c1608ded0150348cb2d6/href</a></iframe><p>6. This config can be provided to <strong>gunicorn</strong> cli via <strong>-c</strong> flag.</p><p>7. Add an Environment variable prometheus_multiproc_dir that should point to a directory where Prometheus should temporarily store the metrics. If you use <strong>Kubernetes</strong> update the deployment descriptor to mount <strong>Volume</strong> of <strong>emptyDir</strong> type.</p><p>8. And the last thing to do — update the code for your /stats endpoint in a following way:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9c6a7e9b62e1b96bbb203c0c7876e171/href">https://medium.com/media/9c6a7e9b62e1b96bbb203c0c7876e171/href</a></iframe><p>I hope this short guide can be useful and will help you to make your apps measurable and system more reliable.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8487c3bc5b36" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setup Go project - for JVM developers]]></title>
            <link>https://medium.com/@andrei.chernyshev/setup-go-project-for-jvm-developers-1c3ed96cd621?source=rss-3d5d9acf17e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/1c3ed96cd621</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[tools]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Andrei Chernyshev]]></dc:creator>
            <pubDate>Sat, 06 Jan 2018 00:36:59 GMT</pubDate>
            <atom:updated>2018-01-06T00:36:59.540Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*74h9ZBGFc-INjZrF8ZBhFg.png" /><figcaption>image from <a href="https://github.com/zxh0/jvm.go">https://github.com/zxh0/jvm.go</a></figcaption></figure><p>I have been doing development for <strong>JVM</strong> platform for quite some time already. It was <strong>Java</strong> back in time, now it is <strong>Kotlin</strong>. And everything seems logical here — here is your <strong>Maven</strong>, <strong>Gradle</strong> or whatever project description with versioned dependencies, when you do build — the artifact is right here. It gives you a sense of workspace. It is easy to develop multiple projects in parallel — they all are isolated from each other.</p><p>But then the new player comes in that perfect world — <strong>Go</strong>.</p><p><strong>$GOROOT</strong>? <strong>$GOPATH</strong>? WTF? Where are project’s dependencies? Is there something like versions? And where are my binaries?!</p><p>I believe that such design of the ecosystem has some rational core and reasoning. But from my(probably not just my) experience it looks like completely parallel universe.</p><p>To deal with it my first approach was to replicate expected <strong>$GOPATH</strong> folders structure in the project directory — <strong>bin</strong>, <strong>src</strong> and <strong>pkg</strong>. Then create correct import path inside <strong>src</strong> folder — like <strong>github.com/gimlet2/&lt;someproject&gt;</strong> and checkout project itself there. After this manipulations updating of <strong>$GOPATH</strong> environment variable to point to the project directory. Well, too complicated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*iEQB41x__t5yNiNAQVAieA.png" /></figure><p>To improve it a little bit I’ve decided to use dep package manager. And it became better. Now for each project, I was able to provide a list of dependencies with exact versions. Maybe that isn’t really the <strong>Go</strong> way, but I like it.</p><p>But still, it was far from ideal. Maybe virtual environment can be helpful here? It is widely used in Python to fix the similar issue. And the first thing I’ve found on <strong>Github</strong> was <a href="https://github.com/crsmithdev/goenv">goenv</a>. This project isn’t under active development but it does the job.</p><p>It is pretty easy to use:</p><ol><li>Install it go get github.com/crsmithdev/goenv</li><li>checkout your project</li><li>then, in your project folder do goenv init github.com/me/myproject</li><li>active virtual environment . goenv/activate</li></ol><p>Cool, it works! But <strong>dep</strong> is an issue now. It verifies that your project is located inside appropriate <strong>$GOPATH</strong>. And <strong>goenv</strong> creates virtual <strong>$GOPATH</strong> in <strong>~/.goenv/&lt;project name&gt;</strong>. Inside this folder, it also creates <strong>bin</strong>, <strong>pkg</strong> and src folders and folders structure that you’ve specified with goenv init command. Almost the same steps I was doing manually before. And it makes a symlink to your actual project folder. So, I’ve improved <strong>goenv</strong> a little bit to cd into this virtual project folder on activating of the environment.</p><p>Now you can run dep ensure right away or start your code editor(personally I use <a href="https://code.visualstudio.com/">Visual Studio Code</a> for Go development), work with git, etc. I’ve provided this change as a pull request to the original project. But you can also install it from my fork — go get <a href="https://github.com/gimlet2/goenv">github.com/gimlet2/goenv</a> .</p><p>Maybe that setup isn’t the best but it works for me. At least now I know what is where and can setup new project in one command.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c3ed96cd621" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Karma.js, Headless Chrome and Docker]]></title>
            <link>https://medium.com/front-end-weekly/karma-js-headless-chrome-and-docker-35c134df28f3?source=rss-3d5d9acf17e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/35c134df28f3</guid>
            <category><![CDATA[phantomjs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[vuejs]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[headless-chrome]]></category>
            <dc:creator><![CDATA[Andrei Chernyshev]]></dc:creator>
            <pubDate>Fri, 05 Jan 2018 16:22:08 GMT</pubDate>
            <atom:updated>2018-01-05T19:04:24.711Z</atom:updated>
            <content:encoded><![CDATA[<p>Today I’ve come back to frontend project I’m involved. I have no idea what have happened while I was away for different things but our <strong>Karma.js</strong> tests stop working.</p><p>The project is done with <strong>Vue.js</strong> and it becomes for some reason impossible to pass slots to the components as strings. Well. And there was error message suggesting to use <strong>Puppeteer</strong> instead.</p><p>And here is a short snippet to how actually do that. Quick notice, I run my tests inside Docker container…</p><ol><li>remove <strong>Phantomjs</strong> from your <strong>package.json</strong></li><li>add dependencies to <strong>puppeteer</strong> and <strong>karma-chrome-launcher</strong></li></ol><p>3. update <strong>karma.conf.js</strong> according to the snippet below</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3ff6834f81a9c7fcddffcb76f25ad880/href">https://medium.com/media/3ff6834f81a9c7fcddffcb76f25ad880/href</a></iframe><p>4. also <strong>Chrome</strong> requires some system libraries and doesn’t work on default <strong>nodejs</strong> <strong>Docker</strong> image. So, I’ve found `geekykaran/headless-chrome-node-docker`.</p><p>And after all that changes my tests are green again!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=35c134df28f3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/front-end-weekly/karma-js-headless-chrome-and-docker-35c134df28f3">Karma.js, Headless Chrome and Docker</a> was originally published in <a href="https://medium.com/front-end-weekly">Frontend Weekly</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[8 minutes of fame — fzf talk]]></title>
            <link>https://medium.com/@andrei.chernyshev/8-minutes-of-fame-fzf-talk-1d375160d9d3?source=rss-3d5d9acf17e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d375160d9d3</guid>
            <category><![CDATA[terminal]]></category>
            <category><![CDATA[command-line]]></category>
            <category><![CDATA[fzf]]></category>
            <dc:creator><![CDATA[Andrei Chernyshev]]></dc:creator>
            <pubDate>Wed, 15 Nov 2017 18:36:19 GMT</pubDate>
            <atom:updated>2017-11-15T18:36:38.253Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BY3Uq4WgzyvruHuCl4o_Hw.png" /></figure><p>Today we’ve started a new thing in our company(just in case you wondering it’s Outfittery Gmbh) — “8 minutes of fame”. This thing has one idea behind — small lightning talks 8 minutes each. It expected to be periodical. For now, we’ve agreed to do it once a month but will see how it’ll go. Each session contains 4 slots. No slides allowed * — show code or live demo, or you could just talk for 8 minutes(* — on some exceptional topics it’s ok to have).</p><p>But here I want to summarize the talk I gave — <strong>How to fzf.</strong></p><p>First of all, what is <a href="https://github.com/junegunn/fzf"><strong>fzf</strong></a>? That is command line tool that should simplify your daily life with power of fuzzy finding. That actually the way how it’s pronounced — FuzzyFinder. It is written in <strong>Go</strong>lang and could be easily found on <strong>Github</strong>. The recommended way to <strong>install</strong> it — checkout the repo to ~/.fzf folder and run install script. It will ask you several questions and you are ready to go!(don’t forget to apply shell config modifications with source command)</p><p>What is so cool about it? Well, it’s doing one thing but doing it well. As each Unix tools should. It takes a list of lines to STD/IN and produces a filtered list of lines to STD/OUT. But magic happens in the middle =). Under the hood it supports several filter options: default one — fuzzy finding — you type and it tries to understand what you actually mean, strict match, the strict match from the beginning of the line and strict match on the end of the line. Forgot to mention, it is also possible to filter something out — just prepend your query with !(bang).</p><p>After you’ve found what you need(with a query or by manual navigation with cursor buttons) just hit enter or even just pick what you need my mouse click.With <strong>-m</strong> flag passed it’s allowed to pick several items from the list(just use Tab or Shift+Tab).</p><p>Just with this functionality, this tool becomes useful for integration to you interactive scripts. But it provides more — bunch of cool keybindings(and you can extend it). Here is my favorite:</p><ol><li>Ctrl+R — fuzzy search on your terminal history;</li><li>Ctrl+T — find files in current directory and deep inside and return the result to the command line. Super useful when you type some command(let’s say less) and then you hit Ctrl+T and pick file you want;</li><li>Alt+C — cd to selected directory;</li><li>ssh ** and then Tab — selecting a host from your hosts file or ssh config;</li><li>kill -9 and then Tab — selecting process to kill;</li></ol><p>And there is more, those are just my top list I use daily.<br>There are several more things worse to mention: Vim integration and new feature — preview. But, I hope, if you haven’t tried(or maybe you are using fzf already for many years…), just check it. More details you always can find in README file. And I’m going to prepare my next talk for “8 minutes of fame”.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d375160d9d3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Summarize on “Spring Microservices” book by Rajesh RV]]></title>
            <link>https://medium.com/@andrei.chernyshev/summarize-on-spring-microservices-book-by-rajesh-rv-a5f56be28985?source=rss-3d5d9acf17e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5f56be28985</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[spring-cloud]]></category>
            <category><![CDATA[books]]></category>
            <category><![CDATA[spring]]></category>
            <dc:creator><![CDATA[Andrei Chernyshev]]></dc:creator>
            <pubDate>Sat, 30 Sep 2017 12:33:11 GMT</pubDate>
            <atom:updated>2017-09-30T12:56:04.758Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently I’ve read <strong>“Spring Microservices”</strong> book by <strong>Rajesh RV</strong> and here I want to try to summarize it. The book was published in June 2016. But, it seems, it is still relevant.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*sxES4bQ1vbo2PoXbTjJdVA.jpeg" /></figure><h4>Microservices isn’t just for developers pleasure but also business demand.</h4><p>Yes, sure, it’s extremely interesting and fun to plan and implement scalable and distributed systems but developers should always keep in mind why we are doing that — to evaluate faster on business processes, reduce the cost of the experiment.</p><h4>Meaningful health check is important</h4><p>Self-healing is significant for microservice architecture. And to provide it your service has to report its health state accurate. For example, your service is deployed in <strong>Kubernetes</strong> cluster and exposes <strong>/health</strong> endpoint. Then it will be possible to restart it in case of failure and reroute traffic to a health node instead. Also, it helps you to understand your app better, know all significant dependencies and requirements.</p><h4>Spring Cloud is a good choice for microservices</h4><p>…if you do not afraid of such vendor-lock. In case if your platform is 100% based on Spring stack it seems pretty logical to try to solve microservices challenges with help of <strong>Spring Cloud</strong>. Bunch of cool project from <strong>Spring Cloud Config</strong> till <strong>Spring Cloud Streams</strong> helps you to build reliable and manageable system. But if you run your services for example on top of <strong>Kubernetes</strong> you will get alternative solutions for those issues for free(like service discovery, load balancing, etc.).</p><h4>Distributed tracing brings transparency into the system</h4><p>On that field Spring provides us <strong>Spring Cloud Sleuth</strong> solution. It works on top of <strong>Zipkin</strong>, Cloudera or Dapper. As result of integration, you will be able to add to your log messages what’s called <strong>Trace-Id</strong> and Span-Id, so you can track request chain across entire system for example in <strong>Kibana</strong>. Super useful for debugging, dependency analysis, etc.</p><h4>Autoscaling</h4><p>…isn’t trivial process. Beside of technical support of autoscaling from your platform(for example, Kubernetes has it but limited, but there are some third-party extensions to improve it), you really need to think about scaling policies, pay attention what limits your app performance.</p><p>Of course, there are much more useful tips in this book. Here is only some point I focus my attention on. In total — it worth to spend some time and read.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a5f56be28985" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sentri.io — errors handling]]></title>
            <link>https://medium.com/@andrei.chernyshev/sentri-io-errors-handling-deac2ad5f57c?source=rss-3d5d9acf17e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/deac2ad5f57c</guid>
            <category><![CDATA[error-handling]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[sentry]]></category>
            <dc:creator><![CDATA[Andrei Chernyshev]]></dc:creator>
            <pubDate>Sat, 23 Sep 2017 01:49:47 GMT</pubDate>
            <atom:updated>2017-09-23T01:49:47.724Z</atom:updated>
            <content:encoded><![CDATA[<p>Today I want to talk about one service I’ve discovered for myself last week. As you probably already got from article title it is <a href="https://sentry.io/">Sentry.io</a>. This open source project helps you to aggregate and monitor information regarding errors happening in your application. Beside opensource version, there is also hosted <a href="https://sentry.io/pricing/">paid</a>(with free Hobbyist plan) version which supposes to be the same.</p><p>This service provides wide support for different programming languages like Java, C#, Elixir, Go, Javascript, Node, Perl, PHP, Python, etc. The integration process is super easy — you just need to add proper dependency into your project and provide a little bit of <a href="https://docs.sentry.io/clients/java/config/">configuration</a>(at least access token), and you are ready to go.</p><p>In my case, it was a <strong>Spring-Boot</strong> application with <strong>logback</strong> logging framework. Both those technologies are supported by Sentry.io. So, I’ve placed <strong>io.sentry:sentry-spring</strong> and <strong>io.sentry:sentry-logback</strong> libraries into projects <strong>Gradle</strong> script. Then I’ve created a new project inside Sentry’s dashboard and generated a token for it. Next step — configuration inside the project. And that is something I don’t like about all that story. Maybe there is some way around but I can’t find it — so, I had to duplicate configuration twice — for logback and for spring-boot respectively. I’ve added <strong>sentry.properties</strong> file in project’s resource folder with <strong>dsn</strong> key inside and <strong>sentry.dsn</strong> key to my <strong>application.yaml</strong>. Also, the configuration of logback appenders was updated with the following block:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0139b4b23e686cd0e3e4a4415dfcdb4d/href">https://medium.com/media/0139b4b23e686cd0e3e4a4415dfcdb4d/href</a></iframe><p>And as a final step additional beans for Spring to handle unhandled exceptions and provide additional request context(yes, a little bit of <strong>Kotlin</strong>):</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2666d1d6a353ffd933718603846cb002/href">https://medium.com/media/2666d1d6a353ffd933718603846cb002/href</a></iframe><p>That’s it.</p><p>But there is much more than just aggregation of errors. Sentry provides useful report channels integrations. For example, it can send notifications by <strong>email</strong> or to S<strong>lack</strong> when there is a new type of error. Or notify you if same error happened more then 100 times per hour. All those rules are extremely flexible and can be configured with Sentry’s dashboard.</p><p>And there is integration with popular issue trackers like <strong>Jira</strong>. So, it will create a new bug ticket for each new error with stacktrace and all context it has. That should make it easier to fix them.</p><p>So far looks good.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=deac2ad5f57c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kafka usage — tips&hints]]></title>
            <link>https://medium.com/@andrei.chernyshev/kafka-usage-tips-hints-d87ed5bf7d1e?source=rss-3d5d9acf17e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/d87ed5bf7d1e</guid>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[apache-kafka]]></category>
            <category><![CDATA[tips-and-tricks]]></category>
            <category><![CDATA[kafka]]></category>
            <dc:creator><![CDATA[Andrei Chernyshev]]></dc:creator>
            <pubDate>Sun, 13 Aug 2017 21:30:42 GMT</pubDate>
            <atom:updated>2017-08-13T21:30:42.880Z</atom:updated>
            <content:encoded><![CDATA[<p>Today we will talk about <a href="https://kafka.apache.org/">Apache Kafka</a>. As you probably already know, Kafka is “a distributed streaming platform”, so it could be used as Queue, Message Bus, etc.</p><p>But this story isn’t about Kafka it self. It is about issues I faced recently developing one Kafka based service. Small application consuming messages from defined topic and validating them according to the schema. Nothing like rocket science. But.</p><ol><li>Upfront check version of your Kafka server — even minor version difference could break API. Like server version 0.10.0.1 isn’t compatible with client 0.10.1.1. Just pay attention.</li><li>Check which compression mechanism is used on your Kafka server. <a href="https://www.gnu.org/software/gzip/">GZip</a> and <a href="https://google.github.io/snappy/">Snappy</a> are supported. In my case it was Snappy, and you know what? It requires <a href="https://www.gnu.org/software/libc/">glibc</a>. And my base docker image was Alpine. And Alpine does not have support of glibc. So, choose the right base image.</li><li>If you use Kafka Streams API and want to split one stream into two based on some predicate your could pass this predicate to `<em>branch</em>` method along with predicate that always returns true — some sort of <em>everithingElsePredicate(</em>Predicate { _, _ -&gt; true }).</li><li>kafka-console-consumer and kafka-console-producer — your best friends to debug your Kafka app.</li><li>If you are going to scale you app to process some topic in parallel way don’t forget to increase number of partitions on that topic. But keep in mind that it is only possible to increase number of partitions but there is no way back.</li></ol><p>That’s all I have in mind to mention.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d87ed5bf7d1e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>