<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>IT on Manuel Bernhardt</title><link>https://manuel.bernhardt.io/categories/it/</link><description>Recent content in IT on Manuel Bernhardt</description><generator>Hugo</generator><language>en</language><lastBuildDate>Fri, 01 Aug 2025 10:51:52 +0200</lastBuildDate><atom:link href="https://manuel.bernhardt.io/categories/it/index.xml" rel="self" type="application/rss+xml"/><item><title>Macbook Pro Insomnia</title><link>https://manuel.bernhardt.io/posts/2025-07-24-macbook-pro-insomnia/</link><pubDate>Thu, 24 Jul 2025 20:38:38 +0000</pubDate><guid>https://manuel.bernhardt.io/posts/2025-07-24-macbook-pro-insomnia/</guid><description>&lt;p>&lt;em>Update (01.08.2025): fixed broken link, typo, clarified problematic behaviour&lt;/em>&lt;/p>
&lt;p>For a number of years now I have a MacBook Pro Silicon M1 Max. It worked beautifully.&lt;/p>
&lt;p>Then, seemingly out of nowhere, I started noticing that the battery drained over night when I left the notebook somewhere, not connected to power. This got worse and worse, up until the point that I&amp;rsquo;ve had enough of it and I started doing some research.&lt;/p></description></item><item><title>Cloud Run Job with arguments</title><link>https://manuel.bernhardt.io/posts/2025-02-22-cloud-run-job-scheduler-args/</link><pubDate>Sat, 22 Feb 2025 16:10:22 +0200</pubDate><guid>https://manuel.bernhardt.io/posts/2025-02-22-cloud-run-job-scheduler-args/</guid><description>&lt;p>&lt;a href="https://cloud.google.com/run/docs/create-jobs">Cloud Run Jobs&lt;/a> allows to run containers as jobs, i.e. as short-lived tasks that spin up a container every time that they&amp;rsquo;re invoked. As with every container you can use environment variables to pass context. But what if we want to pass arguments to the container?&lt;/p>
&lt;p>In this case, the GCP API specifies &lt;a href="https://cloud.google.com/run/docs/reference/rest/v1/namespaces.jobs/run#ContainerOverride">containerOverrides&lt;/a>. When using terraform, we can pass those with the &lt;code>google_cloud_scheduler_job&lt;/code>resource by customizing the &lt;code>http_target&lt;/code> body like so:&lt;/p></description></item><item><title>On Azure</title><link>https://manuel.bernhardt.io/posts/2024-05-16-on-azure/</link><pubDate>Thu, 16 May 2024 10:49:22 +0100</pubDate><guid>https://manuel.bernhardt.io/posts/2024-05-16-on-azure/</guid><description>&lt;p>&lt;em>I&amp;rsquo;m working with a client &lt;del>condemned to&lt;/del> graced with the privilege of using the Azure Cloud platform. Whilst I have years of experience working with AWS and GCP, my last exposure to Azure goes back to 2017. Memories from that time before Corona are faint, the world was a different place back then. But some things do not change.&lt;/em>&lt;/p>
&lt;h2 id="identities">On Managed Identities&lt;/h2>
&lt;p>&amp;hellip;without having to manage any credentials? The &lt;a href="https://learn.microsoft.com/en-us/entra/identity/managed-identities-azure-resources/overview">sound of it&lt;/a> is pleasant to the ears, and off we go taking this approach to setup an &lt;a href="https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/how-to-connect-with-managed-identity">Azure Database for PosgreSQL - Flexible Server&lt;/a>. The name is long, the process a bit involved, but in the end the identity is there, managed.&lt;/p></description></item><item><title>Migrating from Kubernetes to Google Cloud Run with terraform</title><link>https://manuel.bernhardt.io/posts/2024-03-07-k8s-to-cloud-run/</link><pubDate>Thu, 07 Mar 2024 11:14:12 +0100</pubDate><guid>https://manuel.bernhardt.io/posts/2024-03-07-k8s-to-cloud-run/</guid><description>&lt;p>Kubernetes has its advantages when you&amp;rsquo;re big enough and require the flexibility it offers. But when all you&amp;rsquo;re after is running services and you don&amp;rsquo;t need stateful sets, &lt;a href="https://cloud.google.com/run?hl=en">Google Cloud Run&lt;/a> can be a good alternative (provided you&amp;rsquo;re using Google Cloud Platform). This article provides a few pointers to migrate Kubernetes deployments to Google Cloud Run.&lt;/p>
&lt;h1 id="migrating-yaml-deployment-descriptors">Migrating YAML deployment descriptors&lt;/h1>
&lt;p>There&amp;rsquo;s a &lt;a href="https://cloud.google.com/run/docs/migrate/from-kubernetes">guide for migrating deployment descriptors&lt;/a> which outlines the major syntax differences between a Kubernetes deployment and a Cloud Run service.&lt;/p></description></item><item><title>Fearless concurrency with Rust, cats, and a few Raspberry PIs</title><link>https://manuel.bernhardt.io/posts/2024-01-26-rust-fearless-concurrency-cats-raspberry-pi/</link><pubDate>Fri, 26 Jan 2024 10:58:12 +0100</pubDate><guid>https://manuel.bernhardt.io/posts/2024-01-26-rust-fearless-concurrency-cats-raspberry-pi/</guid><description>&lt;p>Somehow I&amp;rsquo;m never satisfied when a program only runs on one computer. The reassuring feeling of connectedness, the thrill of discovering who else is there on the network, the fear of network instability and the insanity of trying to establish a coherent view of the world on multiple machines are both a source of joy and despair that keep me hooked. But I digress&amp;hellip;&lt;/p>
&lt;p>In the previous article, we looked at &lt;a href="https://manuel.bernhardt.io/posts/2024-01-12-rust-cat-litter-box/">building a blinking Raspberry PI with Rust&lt;/a> to help cat owners think about cleaning the cat litter box (and avoid death stares from their feline companions). In this article, we&amp;rsquo;ll take things a step further and expand the Reminder PIs to a network, allowing to spread them all over the house so that forgetting about this daily cat owner duty will become an almost impossible thing to do. In order to achieve this, we will embrace the principles of &lt;a href="https://doc.rust-lang.org/book/ch16-00-concurrency.html">Fearless Concurrency&lt;/a> made possible by Rust&amp;rsquo;s memory management paradigm. More specifically, we will:&lt;/p></description></item><item><title>Building a cat litter box reminder with Rust</title><link>https://manuel.bernhardt.io/posts/2024-01-12-rust-cat-litter-box/</link><pubDate>Fri, 12 Jan 2024 15:34:48 +0100</pubDate><guid>https://manuel.bernhardt.io/posts/2024-01-12-rust-cat-litter-box/</guid><description>&lt;p>I continued working on a side-project I built a year ago with &lt;a href="https://www.rust-lang.org/">Rust&lt;/a>, and it is now at a point at which I can write something about it.&lt;/p>
&lt;p>When you own cats, you also own a litter box for said cats which needs to be emptied regularly (at least once a day for two adult cats). Failing this, the cats will give you a look which, in human language, means as much as &amp;ldquo;I will murder you in your sleep&amp;rdquo; which is not a very pleasant feeling.&lt;/p></description></item><item><title>On pinning and isolating CPU cores</title><link>https://manuel.bernhardt.io/posts/2023-11-16-core-pinning/</link><pubDate>Thu, 16 Nov 2023 17:27:11 +0100</pubDate><guid>https://manuel.bernhardt.io/posts/2023-11-16-core-pinning/</guid><description>&lt;p>This year I have been involved in running performance benchmarks of &lt;a href="https://aeron.io">Aeron&lt;/a> over at &lt;a href="https://weareadaptive.com">Adaptive&lt;/a> on two major cloud providers. I learned quite a few things about the &lt;del>arcane arts&lt;/del> &lt;del>science&lt;/del> craft of running performance benchmarks.&lt;/p>
&lt;p>When benchmarking a piece of software, you really want to get the best performance out of it, which is to say that you also want to run it under the best conditions in order to see what is possible. One aspect I&amp;rsquo;d like to cover in this article is related to giving the program exclusive access to the CPU core(s) it needs to run, without having other threads interfering with the execution. This involves:&lt;/p></description></item><item><title>Rust Development for the Raspberry Pi on Apple Silicon</title><link>https://manuel.bernhardt.io/posts/2022-11-04-rust-development-for-the-raspberry-pi-on-apple-silicon/</link><pubDate>Fri, 04 Nov 2022 17:36:39 +0100</pubDate><guid>https://manuel.bernhardt.io/posts/2022-11-04-rust-development-for-the-raspberry-pi-on-apple-silicon/</guid><description>&lt;p>&lt;em>Update (18.02.2023): Updated the article to reflect the usage of VSCode remote development instead of JetBrains Gateway&lt;/em>&lt;/p>
&lt;p>A few weeks ago I started building a Rust project for the Raspberry PI using my brand new MacBook Pro with an M1 chip (the old MacBook Pro from late 2013 still works but it simply is too slow for the work I&amp;rsquo;m doing these days).&lt;/p>
&lt;p>
 &lt;figure style="text-align: center">
 &lt;img src="https://manuel.bernhardt.io/wp-content/new-mac.jpg" class="pure-img" alt="">
 &lt;figcaption>Shiny new MacBook Pro complete with scuba-diving sticker from my wife&lt;/figcaption>
 &lt;/figure>

&lt;/p></description></item><item><title>Switching to Hugo after 17 years of WordPress</title><link>https://manuel.bernhardt.io/2022/08/11/switching-to-hugo-after-17-years-of-wordpress/</link><pubDate>Thu, 11 Aug 2022 11:53:32 +0200</pubDate><guid>https://manuel.bernhardt.io/2022/08/11/switching-to-hugo-after-17-years-of-wordpress/</guid><description>&lt;p>In the fall of 2005, I installed WordPress on the free hosting space provided by my ISP in France (fittingly called &lt;em>Free&lt;/em>). I had very little experience with PHP but enough so to get the site up and running.&lt;/p>
&lt;p>Initially called &lt;em>Lost in translation&lt;/em> (after the &lt;a href="https://en.wikipedia.org/wiki/Lost_in_Translation_%28film%29">eponymous movie&lt;/a> starring Bill Murray and Scarlett Johansson) and I was writing about&amp;hellip; well, I frankly don&amp;rsquo;t remember. However it must have been such poor writing that I decided to &lt;a href="https://manuel.bernhardt.io/2008/01/19/reset/">wipe all of it&lt;/a> in the beginning of 2008 (even the wayback machine didn&amp;rsquo;t care to keep a trace of the content, to give you an idea of how bad it must have been). The subsequent writing wasn&amp;rsquo;t much better but I apparently wasn&amp;rsquo;t ashamed enough about it to wipe it out again.&lt;/p></description></item><item><title>Programming Languages</title><link>https://manuel.bernhardt.io/2021/10/12/programming-languages/</link><pubDate>Tue, 12 Oct 2021 07:08:14 +0200</pubDate><guid>https://manuel.bernhardt.io/2021/10/12/programming-languages/</guid><description>&lt;p>Programming languages I have dabbled with, in approximate order of first encounter:&lt;/p>
&lt;ul>
&lt;li>Sinclair ZX81 basic&lt;/li>
&lt;li>QuickBasic&lt;/li>
&lt;li>logo&lt;/li>
&lt;li>turbo basic&lt;/li>
&lt;li>turbo pascal&lt;/li>
&lt;li>assembly&lt;/li>
&lt;li>html&lt;/li>
&lt;li>c&lt;/li>
&lt;li>java&lt;/li>
&lt;li>sql&lt;/li>
&lt;li>matlab&lt;/li>
&lt;li>php&lt;/li>
&lt;li>perl&lt;/li>
&lt;li>javascript&lt;/li>
&lt;li>python&lt;/li>
&lt;li>action script&lt;/li>
&lt;li>scala&lt;/li>
&lt;li>groovy&lt;/li>
&lt;li>typescript&lt;/li>
&lt;li>go&lt;/li>
&lt;li>swift&lt;/li>
&lt;li>kotlin&lt;/li>
&lt;li>rust&lt;/li>
&lt;/ul>
&lt;p>I always planned on looking closer at a LISP (such as Clojure) but so far haven&amp;rsquo;t found the time to play with one.&lt;/p>
&lt;p>In general, I find it increasinly easy to pick up a new programming language. Concepts translate rather well. There definitely are design differences between the languages that require more time to get right and getting the feeling for the idiomatic way of writing in language X does take a bit of practice, but all in all I find the exercise to be rather repetitive (I expect that someone will point out that I have not yet experienced LISP).&lt;/p></description></item><item><title>Tour of Temporal: Performance</title><link>https://manuel.bernhardt.io/2021/04/25/tour-of-temporal-performance/</link><pubDate>Sun, 25 Apr 2021 18:59:46 +0200</pubDate><guid>https://manuel.bernhardt.io/2021/04/25/tour-of-temporal-performance/</guid><description>&lt;p>In &lt;a href="https://manuel.bernhardt.io/2021/04/12/tour-of-temporal-welcome-to-the-workflow/">the last part of this series&lt;/a>, we looked into the fundamentals of the &lt;a href="http://temporal.io/" target="_blank" rel="noreferrer noopener">Temporal workflow engine&lt;/a> and how it compares to actor toolkits such as &lt;a href="http://akka.io">Akka&lt;/a>. As I wrote in the previous part, my personal experience with workflows has led me to associate anything with the word &amp;ldquo;worfklow&amp;rdquo; in it to &amp;ldquo;a slow process&amp;rdquo; (taking minutes to complete). In order to clear that idea from my mind (and also because I like exploring performance characteristics of technologies) I wanted to have a closer look at the performance of Temporal workflows.&lt;/p></description></item><item><title>Tour of Temporal: Welcome to the Workflow</title><link>https://manuel.bernhardt.io/2021/04/12/tour-of-temporal-welcome-to-the-workflow/</link><pubDate>Mon, 12 Apr 2021 07:42:15 +0200</pubDate><guid>https://manuel.bernhardt.io/2021/04/12/tour-of-temporal-welcome-to-the-workflow/</guid><description>&lt;p>I&amp;rsquo;ve been exposed to workflows early on in my career, at first in enterprise environments where advanced GUIs were used to model highly complex business workflows whose execution would invariable lead to hours of debugging through mountains of log files via a remote desktop connection to the server running the proprietary workflow execution engine and later in research projects which would invariably feature some type of home-grown workflow engine (with a shiny GUI) to solve a part of the project. These interactions with workflows left me with a rather poor after-taste of the entire concept of workflows which can be summed up in two words: &lt;em>slow&lt;/em> and &lt;em>complicated&lt;/em>.&lt;/p></description></item><item><title>10000 nodes and beyond with Akka Cluster and Rapid</title><link>https://manuel.bernhardt.io/2020/04/30/10000-node-cluster-with-akka-and-rapid/</link><pubDate>Thu, 30 Apr 2020 09:39:47 +0200</pubDate><guid>https://manuel.bernhardt.io/2020/04/30/10000-node-cluster-with-akka-and-rapid/</guid><description>&lt;p>Update: there&amp;rsquo;s a &lt;a href="https://soundcloud.com/lightbend/scaling-akka-cluster-to-10000-nodes-with-rapid-manuel-bernhardt" target="_blank" rel="noreferrer noopener">podcast episode&lt;/a> about this&lt;/p>
&lt;p>&lt;span class="firstcharacter">T&lt;/span>he year is 2021. As the world is still deeply affected by the COVID-19 pandemic, the United Nations have decided that in order to prevent the same scenario of ever happening again, there should be a worldwide, real-time contact-tracing system in place capable of tracking every human being on the planet. Everyone is now equipped with a small, pebble-like device. If a person you have been in contact with is confirmed to carry a new kind of virus for which there is no remedy, the device starts glowing in red. Each device reports the anonymized contact information to one global backend system capable of handling this type of massive scale.&lt;/p></description></item><item><title>Tour of Akka Typed: Cluster Singleton and Routers</title><link>https://manuel.bernhardt.io/2019/12/03/tour-of-akka-typed-cluster-singleton-and-routers/</link><pubDate>Tue, 03 Dec 2019 14:59:48 +0100</pubDate><guid>https://manuel.bernhardt.io/2019/12/03/tour-of-akka-typed-cluster-singleton-and-routers/</guid><description>&lt;p>In &lt;a href="https://manuel.bernhardt.io/2019/11/09/tour-of-akka-typed-cluster-sharding/">part 5 of this series&lt;/a>, we started to scale the application from a local one to a clustered one by introducing Cluster Sharding. In this article, we will continue our effort to scale the payment processor out and make it resilient through the use of Cluster Singletons and Cluster-Aware Routers.&lt;/p>
&lt;p>Before we get started, here’s a quick reminder of what we’ve seen so far: in the &lt;a href="https://manuel.bernhardt.io/2019/07/11/tour-of-akka-typed-protocols-and-behaviors/">first part&lt;/a> we had a look at the the raison d’être of Akka Typed and what advantages it has over the classic, untyped API. In the &lt;a href="https://manuel.bernhardt.io/2019/08/07/tour-of-akka-typed-message-adapters-ask-pattern-and-actor-discovery/">second part&lt;/a> we introduced the concepts of message adapters, the ask pattern and actor discovery. In the third part, we covered one of the core concepts of Actor systems: &lt;a href="https://manuel.bernhardt.io/2016/08/09/akka-anti-patterns-flat-actor-hierarchies-or-mixing-business-logic-and-failure-handling/">supervision and failure recovery&lt;/a>. In the fourth part, we covered one of the most popular use-cases for Akka: &lt;a href="https://manuel.bernhardt.io/2019/10/07/tour-of-akka-typed-event-sourcing/">event sourcing&lt;/a>. Finally, as mentioned before, in the &lt;a href="https://manuel.bernhardt.io/2019/11/09/tour-of-akka-typed-cluster-sharding/">fifth part&lt;/a> we started scaling out by making use of cluster sharding.&lt;/p></description></item><item><title>Tour of Akka Typed: Cluster Sharding</title><link>https://manuel.bernhardt.io/2019/11/09/tour-of-akka-typed-cluster-sharding/</link><pubDate>Sat, 09 Nov 2019 20:14:10 +0100</pubDate><guid>https://manuel.bernhardt.io/2019/11/09/tour-of-akka-typed-cluster-sharding/</guid><description>&lt;p>&lt;em>Update 21/11/2019: Fixed comment about &lt;code>shardId&lt;/code> extraction in relation to &lt;code>ShardingEnvelope&lt;/code>&lt;/em>&lt;/p>
&lt;p>Welcome to the fifth part of the Akka Typed series! In this part, we&amp;rsquo;ll leave the safe harbor of a single JVM and sail into the seas of distributed systems by exploring a key features of Akka Cluster with the typed API: Cluster Sharding. If you want to get a more in-depth introduction to Akka Cluster, I invite you to check out &lt;a href="https://manuel.bernhardt.io/2018/08/03/tour-akka-cluster/">the article series on this topic&lt;/a>.&lt;/p></description></item><item><title>One step closer: exploiting locality in Akka Cluster based systems</title><link>https://manuel.bernhardt.io/2019/10/28/one-step-closer-exploiting-locality-in-akka-cluster-based-systems/</link><pubDate>Mon, 28 Oct 2019 12:36:24 +0100</pubDate><guid>https://manuel.bernhardt.io/2019/10/28/one-step-closer-exploiting-locality-in-akka-cluster-based-systems/</guid><description>&lt;p>When it comes to the latency of processing a request in a distributed system, everyone knows (or &lt;a rel="noreferrer noopener" aria-label="should know (opens in a new tab)" href="https://gist.github.com/jboner/2841832" target="_blank">should know&lt;/a>) that doing things over the network is the most expensive thing you can do (alongside with disk reads):&lt;/p>
&lt;p>
 &lt;figure style="text-align: center">
 &lt;img src="https://manuel.bernhardt.io/wp-content/687474703a2f2f692e696d6775722e636f6d2f6b307431652e706e67.png" class="pure-img" alt="">
 &lt;figcaption>The round trip time in a datacenter is about 5000 times longer than a main memory reference&lt;/figcaption>
 &lt;/figure>

&lt;/p>
&lt;p>Modern architectures have recognized this and will favor keeping data in memory, avoiding the need to go to disk or to the database, when consistency requirements allow for it. With &lt;a href="https://manuel.bernhardt.io/2018/02/26/tour-akka-cluster-cluster-sharding/">Akka Cluster Sharding&lt;/a> combined with &lt;a href="https://manuel.bernhardt.io/2018/01/31/tour-akka-cluster-eventual-consistency-persistent-actors-message-delivery-semantics/">Akka Persistence&lt;/a>, it is possible to keep millions of durable entities in memory, reducing latency to a large degree.&lt;/p></description></item><item><title>Tour of Akka Typed: Event Sourcing</title><link>https://manuel.bernhardt.io/2019/10/07/tour-of-akka-typed-event-sourcing/</link><pubDate>Mon, 07 Oct 2019 13:42:32 +0200</pubDate><guid>https://manuel.bernhardt.io/2019/10/07/tour-of-akka-typed-event-sourcing/</guid><description>&lt;p>Welcome to the fourth part of the Akka Typed series. In the &lt;a href="https://manuel.bernhardt.io/2019/07/11/tour-of-akka-typed-protocols-and-behaviors/">first part&lt;/a> we had a look at the the raison d’être of Akka Typed and what advantages it has over the classic, untyped API. In the &lt;a href="https://manuel.bernhardt.io/2019/08/07/tour-of-akka-typed-message-adapters-ask-pattern-and-actor-discovery/">second part&lt;/a> we introduced the concepts of message adapters, the ask pattern and actor discovery. In the third part, we covered one of the core concepts of Actor systems: &lt;a href="https://manuel.bernhardt.io/2016/08/09/akka-anti-patterns-flat-actor-hierarchies-or-mixing-business-logic-and-failure-handling/">supervision and failure recovery&lt;/a>. In this part of the series we&amp;rsquo;ll explore one of the most popular use-cases for Akka: event sourcing. We&amp;rsquo;ll assume that you are already familiar with the concept of event sourcing - if not, first &lt;a href="https://hackernoon.com/events-as-first-class-citizens-8633e8479493">read about it&lt;/a> to get some context.&lt;/p></description></item><item><title>Tour of Akka Typed: supervision and signals</title><link>https://manuel.bernhardt.io/2019/09/05/tour-of-akka-typed-supervision-and-signals/</link><pubDate>Thu, 05 Sep 2019 10:10:10 +0200</pubDate><guid>https://manuel.bernhardt.io/2019/09/05/tour-of-akka-typed-supervision-and-signals/</guid><description>&lt;p>&lt;em>Update 18.10.2019: fixed wrong syntax for handling multiple exceptions, clarifying a few points&lt;/em>&lt;/p>
&lt;p>Welcome to the third part of the Akka Typed series. In the &lt;a href="https://manuel.bernhardt.io/2019/07/11/tour-of-akka-typed-protocols-and-behaviors/">first part&lt;/a> we had a look at the the raison d&amp;rsquo;être of Akka Typed and what advantages it has over the classic, untyped API. In the &lt;a href="https://manuel.bernhardt.io/2019/08/07/tour-of-akka-typed-message-adapters-ask-pattern-and-actor-discovery/">second part&lt;/a> we introduced the concepts of message adapters, the ask pattern and actor discovery. In this part of the series, we&amp;rsquo;ll have a look at one of the core concepts of actor systems: &lt;a href="https://manuel.bernhardt.io/2016/08/09/akka-anti-patterns-flat-actor-hierarchies-or-mixing-business-logic-and-failure-handling/">supervision and failure recovery&lt;/a>.&lt;/p></description></item><item><title>Tour of Akka Typed: Message Adapters, Ask Pattern and Actor Discovery</title><link>https://manuel.bernhardt.io/2019/08/07/tour-of-akka-typed-message-adapters-ask-pattern-and-actor-discovery/</link><pubDate>Wed, 07 Aug 2019 08:13:01 +0200</pubDate><guid>https://manuel.bernhardt.io/2019/08/07/tour-of-akka-typed-message-adapters-ask-pattern-and-actor-discovery/</guid><description>&lt;p>In the &lt;a href="https://manuel.bernhardt.io/2019/07/11/tour-of-akka-typed-protocols-and-behaviors/">previous article&lt;/a> of this series we&amp;rsquo;ve explored the basics of the Akka Typed API: why it was created and what are its benefits in comparison to the classic Actor API, how to build typed actor systems via protocols and behaviors and how to create typed actors. In this series we&amp;rsquo;re going to go further down the route of building typed actor systems by looking at fundamental concepts necessary for the interaction between actors.&lt;/p></description></item><item><title>Tour of Akka Typed: Protocols and Behaviors</title><link>https://manuel.bernhardt.io/2019/07/11/tour-of-akka-typed-protocols-and-behaviors/</link><pubDate>Thu, 11 Jul 2019 08:05:53 +0200</pubDate><guid>https://manuel.bernhardt.io/2019/07/11/tour-of-akka-typed-protocols-and-behaviors/</guid><description>&lt;p>&lt;em>Update 18.08.2019: corrected actor hierarchy and default supervision strategy&lt;/em>&lt;/p>
&lt;p>&lt;a rel="noreferrer noopener" aria-label="Ukrainian translation (opens in a new tab)" href="https://uk.codegalaxy.io/theory/scala/papers/90eb098342b4434499ae9029a166922a/akka_typed___protocols_and_behaviors" target="_blank">Ukrainian translation&lt;/a> / &lt;a rel="noreferrer noopener" aria-label="Chinese translation (opens in a new tab)" href="https://my.oschina.net/enyo/blog/3133185" target="_blank">Chinese translation&lt;/a>&lt;/p>
&lt;p>In this series we are going to explore &lt;a href="https://doc.akka.io/docs/akka/2.6/typed/index.html">Akka Typed&lt;/a>, the new Akka Actor API that brings significant advantage over the classic one. Akka Typed is &lt;a href="https://akka.io/blog/news/2019/04/10/akka-tyoed-prod-ready">ready for production since April&lt;/a> and although the API is still marked as &lt;a href="https://doc.akka.io/docs/akka/current/common/may-change.html">may change&lt;/a> I think it is a good time to look into it and to learn what&amp;rsquo;s new.&lt;/p></description></item><item><title>Optimizing CI build times for Scala projects</title><link>https://manuel.bernhardt.io/2019/06/17/optimizing-ci-build-times-for-scala-projects/</link><pubDate>Mon, 17 Jun 2019 10:12:38 +0200</pubDate><guid>https://manuel.bernhardt.io/2019/06/17/optimizing-ci-build-times-for-scala-projects/</guid><description>&lt;p>CI / CD pipelines that run for each new and merged pull-request (or even for each commit on a branch) are today&amp;rsquo;s de-facto standard when it comes to developing software. Running the complete test suite automatically ensures that regressions are rapidly identified and do not make it into production.&lt;/p>
&lt;p>As applications grow and their test suites grow (well, ideally, of course), build times tend to grow as well. Without care, these increasing build times can become a productivity bottleneck as the feedback loop provided by the automated CI/CD pipeline grows longer and longer. And yet I&amp;rsquo;ve also observed that teams tend to get used to those long build times (over 20 minutes or longer) without realizing just how much time is spent waiting for the tests to pass. It&amp;rsquo;s a bit of a &lt;a href="https://en.wikipedia.org/wiki/Boiling_frog">&amp;ldquo;boiling frog&amp;rdquo; situation&lt;/a> as the build times increase gradually and people just get used to them. The trouble is that &lt;strong>this has a potentially large impact on team productivity&lt;/strong> - waiting for the CI pipeline to finish before submitting a pull-request for review (because you wouldn&amp;rsquo;t want to submit it if the tests fail), waiting for the pipeline to finish after merging it to the master branch before deployment, etc. is just wasted time - without mentioning the &lt;a href="https://www.joelonsoftware.com/2001/02/12/human-task-switches-considered-harmful/">context switch&lt;/a> that inevitably occurs when you have to wait for a 20 minutes for a build to finish.&lt;/p></description></item><item><title>Why I’m still using a MacBook Pro Late 2013 in 2019</title><link>https://manuel.bernhardt.io/2019/06/07/why-im-still-using-a-macbook-pro-late-2013/</link><pubDate>Fri, 07 Jun 2019 09:18:05 +0200</pubDate><guid>https://manuel.bernhardt.io/2019/06/07/why-im-still-using-a-macbook-pro-late-2013/</guid><description>&lt;p>&lt;em>Update: it is now June 2021 and I&amp;rsquo;m still using the MacBook Pro Late 2013&lt;/em>&lt;br>
&lt;em>Update: it is now February 2022 and I&amp;rsquo;m still using the MacBook Pro Late 2013 after having changed the thermal paste for the CPU and GPU&lt;/em>&lt;/p>
&lt;p>I&amp;rsquo;ve started using Apple computers in 2008. Of all the Apple computers - and other computers - I&amp;rsquo;ve owned, the MacBook Pro Late 2013 is the one I&amp;rsquo;ve been able to keep the longest so far. The main reason that&amp;rsquo;s possible is because there are still a few ways to upgrade this Apple computer.&lt;/p></description></item><item><title>Raspberry PI Akka Cluster LED strips</title><link>https://manuel.bernhardt.io/2019/05/02/raspberry-pi-akka-cluster-led-strips/</link><pubDate>Thu, 02 May 2019 12:00:59 +0200</pubDate><guid>https://manuel.bernhardt.io/2019/05/02/raspberry-pi-akka-cluster-led-strips/</guid><description>&lt;p>Ever since Eric Loots from Lightbend first showed me the Raspberry-PI based Akka Cluster with special LED stripes, I&amp;rsquo;ve wanted (at least) one of them.&lt;/p>
&lt;p>
 &lt;figure style="text-align: center">
 &lt;img src="https://manuel.bernhardt.io/wp-content/DdY1IWfWsAAMmEN.jpeg" class="pure-img" alt="">
 &lt;figcaption>The Akka PI Cluster at Scala Days 2018&lt;/figcaption>
 &lt;/figure>

&lt;/p>
&lt;p>This is a 5 node cluster with special LED stripes setup in such a way that the LED colour and status (on, off, blinking, etc.) show in which state each node is. It is an excellent way to teach Akka Cluster, and since &lt;a href="https://manuel.bernhardt.io/training">I do this regularly&lt;/a> I was very interested from the beginning to get one of these myself.&lt;/p></description></item><item><title>Akka anti-patterns: too many actors</title><link>https://manuel.bernhardt.io/2018/08/06/akka-anti-patterns-many-actors/</link><pubDate>Mon, 06 Aug 2018 06:01:22 +0200</pubDate><guid>https://manuel.bernhardt.io/2018/08/06/akka-anti-patterns-many-actors/</guid><description>&lt;p>&lt;em>Update (07.08.2018): clarified optimal vs. suboptimal use cases of having many actors at runtime (it could have been misunderstood that Akka isn&amp;rsquo;t meant to build systems with many actors - it entirely is - but it is questionable whether that&amp;rsquo;s always the best approach)&lt;/em>&lt;/p>
&lt;p>It occurred to me that I haven&amp;rsquo;t written yet about this very frequent anti-pattern. It is to be found in codebases written by developers who have just discovered the actor model.&lt;/p></description></item><item><title>Akka anti-patterns: Java serialization</title><link>https://manuel.bernhardt.io/2018/07/20/akka-anti-patterns-java-serialization/</link><pubDate>Fri, 20 Jul 2018 11:29:45 +0200</pubDate><guid>https://manuel.bernhardt.io/2018/07/20/akka-anti-patterns-java-serialization/</guid><description>&lt;p>&lt;a href="http://akka.io">Akka&lt;/a> makes use of serialization when messages leave the JVM boundaries. This can happen in mainly two scenarios: sending messages over the network when using Akka Cluster (&lt;a href="https://manuel.bernhardt.io/2017/06/08/akka-anti-patterns-using-remoting/">do not use Akka Remote directly&lt;/a>) or using Akka Persistence.&lt;/p>
&lt;p>Now here&amp;rsquo;s the catch: the default serialization technology configured in Akka is nothing but the infamous Java serialization, &lt;a href="https://developers.slashdot.org/story/18/05/26/0520227/oracle-calls-java-serialization-a-horrible-mistake-plans-to-dump-it">which Mark Reinhold called a &amp;ldquo;horrible mistake&amp;rdquo; and which Oracle plans to dump in the near future anyway&lt;/a>.&lt;/p></description></item><item><title>Akka anti-patterns: stateless actors</title><link>https://manuel.bernhardt.io/2018/05/30/akka-anti-patterns-stateless-actors/</link><pubDate>Wed, 30 May 2018 07:31:24 +0200</pubDate><guid>https://manuel.bernhardt.io/2018/05/30/akka-anti-patterns-stateless-actors/</guid><description>&lt;p>Actors are object-orientation done right (as opposed to say, objects in Java): their state is not visible from the outside and they communicate via messages. There&amp;rsquo;s no way to break encapsulation because you can&amp;rsquo;t peek into an actor&amp;rsquo;s state while it is running. That&amp;rsquo;s the entire point of actors: they provide you with the illusion of a safe space in which things are executed sequentially, one message after the other, allowing you to use mutable state inside of your actor without having to worry about race conditions (well, almost: &lt;a href="https://manuel.bernhardt.io/2016/08/02/akka-anti-patterns-shared-mutable-state/">don&amp;rsquo;t leak the state&lt;/a>).&lt;/p></description></item><item><title>A quick tour of build tools in Scala</title><link>https://manuel.bernhardt.io/2018/04/19/quick-tour-build-tools-scala/</link><pubDate>Thu, 19 Apr 2018 13:07:55 +0200</pubDate><guid>https://manuel.bernhardt.io/2018/04/19/quick-tour-build-tools-scala/</guid><description>&lt;ul>
&lt;li>&lt;strong>Update 20.04.2018&lt;/strong>: added Polyglot Maven&lt;/li>
&lt;/ul>
&lt;p>Scala has a rich ecosystem and active community producing &lt;a href="https://github.com/lauris/awesome-scala">a lot of useful libraries&lt;/a>. So much so that, sometimes it is not easy as a newcomer to decide which library to pick for a given task (this is the case for example when it comes to &lt;a href="https://manuel.bernhardt.io/2014/02/04/a-quick-tour-of-relational-database-access-with-scala/">database access&lt;/a> and &lt;a href="https://manuel.bernhardt.io/2015/11/06/a-quick-tour-of-json-libraries-in-scala/">JSON handling&lt;/a>). In this article we are going to cover another domain in which there is an increasing number of alternatives: build tools. At the time of writing this article in April 2018 we have at our disposal:&lt;/p></description></item><item><title>Tour of Akka Cluster – Testing with the multi-node-testkit and a handful Raspberry PIs</title><link>https://manuel.bernhardt.io/2018/03/23/tour-akka-cluster-testing-multi-node-testkit-handful-raspberry-pis/</link><pubDate>Fri, 23 Mar 2018 08:19:47 +0100</pubDate><guid>https://manuel.bernhardt.io/2018/03/23/tour-akka-cluster-testing-multi-node-testkit-handful-raspberry-pis/</guid><description>&lt;p>In the previous parts of this article series, we have looked at various functionality of Akka Cluster: &lt;a href="https://manuel.bernhardt.io/2018/01/03/tour-akka-cluster-akka-distributed-data/">distributed data&lt;/a>, &lt;a href="https://manuel.bernhardt.io/2018/01/31/tour-akka-cluster-eventual-consistency-persistent-actors-message-delivery-semantics/">persistence, message delivery semantics&lt;/a> and &lt;a href="https://manuel.bernhardt.io/2018/02/26/tour-akka-cluster-cluster-sharding/">cluster sharding&lt;/a>. We are far from done with exploring Akka Cluster features, but today it is time to look at one feature that is extremely useful when it comes to building production-quality systems based on Akka Cluster: the test support. As testing itself isn&amp;rsquo;t the most exciting activity there is, let&amp;rsquo;s space this article a bit up by throwing a few Raspberry PIs in the mix:&lt;/p></description></item><item><title>Akka anti-patterns: overusing ActorSelection</title><link>https://manuel.bernhardt.io/2018/03/20/akka-anti-patterns-overusing-actorselection/</link><pubDate>Tue, 20 Mar 2018 09:27:15 +0100</pubDate><guid>https://manuel.bernhardt.io/2018/03/20/akka-anti-patterns-overusing-actorselection/</guid><description>&lt;p>&lt;a href="https://akka.io">Akka&amp;rsquo;s&lt;/a> &lt;a href="https://doc.akka.io/japi/akka/current/akka/actor/ActorSelection.html">ActorSelection&lt;/a> makes it possible to look up actors by logical path in the hierarchy:&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-scala" data-lang="scala">&lt;span class="line">&lt;span class="cl">&lt;span class="k">val&lt;/span> &lt;span class="n">selection&lt;/span>&lt;span class="k">:&lt;/span> &lt;span class="kt">ActorSelection&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">context&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">actorSelection&lt;/span>&lt;span class="o">(&lt;/span>&lt;span class="s">&amp;#34;../processor/storage&amp;#34;&lt;/span>&lt;span class="o">)&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>This selection can then be used like &lt;code>ActorRef&lt;/code> in order to send messages to it using the &lt;code>tell&lt;/code> or &lt;code>ask&lt;/code> patterns:&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-scala" data-lang="scala">&lt;span class="line">&lt;span class="cl">&lt;span class="n">selection&lt;/span> &lt;span class="o">!&lt;/span> &lt;span class="nc">Storage&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="nc">Store&lt;/span>&lt;span class="o">(&lt;/span>&lt;span class="s">&amp;#34;important words&amp;#34;&lt;/span>&lt;span class="o">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="k">val&lt;/span> &lt;span class="n">allWords&lt;/span>&lt;span class="k">:&lt;/span> &lt;span class="kt">Future&lt;/span>&lt;span class="o">[&lt;/span>&lt;span class="kt">Seq&lt;/span>&lt;span class="o">[&lt;/span>&lt;span class="kt">String&lt;/span>&lt;span class="o">]]&lt;/span> &lt;span class="k">=&lt;/span> &lt;span class="n">selection&lt;/span> &lt;span class="o">?&lt;/span> &lt;span class="nc">Storage&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="nc">RetrieveAll&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>&lt;code>ActorSelection&lt;/code> is therefore quite useful and allows more flexibility when designing an actor system given that trees can be built dynamically and queried dynamically at runtime. That being said, there are a few things that you should be aware of when using this mechanism.&lt;/p></description></item><item><title>Tour of Akka Cluster – Cluster Sharding</title><link>https://manuel.bernhardt.io/2018/02/26/tour-akka-cluster-cluster-sharding/</link><pubDate>Mon, 26 Feb 2018 16:33:04 +0100</pubDate><guid>https://manuel.bernhardt.io/2018/02/26/tour-akka-cluster-cluster-sharding/</guid><description>&lt;p>In &lt;a href="https://manuel.bernhardt.io/2018/01/31/tour-akka-cluster-eventual-consistency-persistent-actors-message-delivery-semantics/">Tour of Akka Cluster - Eventual consistency, persistent actors and message delivery semantics&lt;/a> we started to look into making the reactive payment processor resilient to node crashes by exploring Akka Persistence, a mechansim that provides durability guarantees for actor state. We also briefly mentioned &lt;a href="https://doc.akka.io/docs/akka/2.5/cluster-sharding.html">Akka Cluster Sharding&lt;/a> which offers a way to automatically distribute actors of the same type over several nodes. In this article we are going to take a closer look at cluster sharding and then make use of it for our reactive payment processor.&lt;/p></description></item><item><title>Tour of Akka Cluster – Eventual consistency, persistent actors, message delivery semantics</title><link>https://manuel.bernhardt.io/2018/01/31/tour-akka-cluster-eventual-consistency-persistent-actors-message-delivery-semantics/</link><pubDate>Wed, 31 Jan 2018 14:19:43 +0100</pubDate><guid>https://manuel.bernhardt.io/2018/01/31/tour-akka-cluster-eventual-consistency-persistent-actors-message-delivery-semantics/</guid><description>&lt;p>In &lt;a href="https://manuel.bernhardt.io/2018/01/03/tour-akka-cluster-akka-distributed-data/">Tour of Akka Cluster - Akka Distributed Data&lt;/a> we looked into building a reactive payment processing system using Akka Distributed Data as a means to provide master-master replication to the order storage component. We did not, however, ensure in any way of form that the system as a whole could withstand individual node crashes. In this article, we will explore options for making the Reactive Payment Processor fault-tolerant.&lt;/p>
&lt;h2 id="evaluating-the-existing-design-in-the-light-of-redundancy">Evaluating the existing design in the light of redundancy&lt;/h2>
&lt;p>Let&amp;rsquo;s make a thought experiment and see if our current design is fit to be &amp;ldquo;upgraded&amp;rdquo; in the light of redundancy. Let&amp;rsquo;s suppose we have made the validation process redundant, so that it would take place on any node (not just the node on which the order was first registered). This way, should the order receiving the node fail, we would still be able to continue validation and processing (so long as it wasn&amp;rsquo;t the node also handling the particular acquring bank).&lt;/p></description></item><item><title>Tour of Akka Cluster – Akka Distributed Data</title><link>https://manuel.bernhardt.io/2018/01/03/tour-akka-cluster-akka-distributed-data/</link><pubDate>Wed, 03 Jan 2018 15:23:04 +0100</pubDate><guid>https://manuel.bernhardt.io/2018/01/03/tour-akka-cluster-akka-distributed-data/</guid><description>&lt;p>Building distributed systems is hard. Pesky things like the laws of physics get in the way of maintaining state accross geographically (and chronologically) disparate systems, and, if that weren&amp;rsquo;t already outrageous enough in itself, those systems may be subject to network failures, forcing us to think about annoying tradeoffs regarding consistency, availability and the meaning of life.&lt;/p>
&lt;p>One of the more interesting (well, at least from my perspective) tools in the &lt;a href="https://akka.io">Akka&lt;/a> toolbox is &lt;a href="https://doc.akka.io/docs/akka/current/cluster-usage.html?language=scala">Akka Cluster&lt;/a> and the modules built on top of it. Through its design it acknowledges the hard reality of life, promoting a &amp;ldquo;no magic here&amp;rdquo; approach to building distributed applications and yet at the same time, takes care about many of the harder aspects of doing so.&lt;/p></description></item><item><title>Akka anti-patterns: naming your application components after Akka concepts</title><link>https://manuel.bernhardt.io/2017/08/26/akka-anti-patterns-naming-your-application-after-akka-concepts/</link><pubDate>Sat, 26 Aug 2017 06:00:47 +0200</pubDate><guid>https://manuel.bernhardt.io/2017/08/26/akka-anti-patterns-naming-your-application-after-akka-concepts/</guid><description>&lt;p>So you&amp;rsquo;ve just learned Akka and are tremendously excited. It&amp;rsquo;s got dispatchers, routers, supervisors - so many shiny things to play with, and in style (I mean, come on, a dispatcher sounds a lot nicer than, say, an &lt;code>AbstractSingletonProxyFactoryBean&lt;/code>).&lt;/p>
&lt;p>
&lt;figure style="text-align: center">
 &lt;img src="https://manuel.bernhardt.io/wp-content/d726ffbf9d0930295e3d98de53b93c53.jpg" class="pure-img" alt="">
&lt;/figure>

&lt;/p>
&lt;p>And so it happens that, perhaps even unknowingly to you (you&amp;rsquo;re busy configuring a &lt;a href="http://doc.akka.io/docs/akka/2.5.3/scala/routing.html">pool router&lt;/a>), your actors start getting names such as:&lt;/p>
&lt;ul>
&lt;li>&lt;code>Dispatcher&lt;/code>&lt;/li>
&lt;li>&lt;code>IncomingRouter&lt;/code>&lt;/li>
&lt;li>&lt;code>FailureSupervisor&lt;/code>&lt;/li>
&lt;/ul>
&lt;p>I&amp;rsquo;ve observed this on three projects now, for two of which I delivered &lt;a href="https://manuel.bernhardt.io/fast-track-to-akka-with-java/">an introductory Akka training&lt;/a> to the team beforehand. I&amp;rsquo;d say that this anti-pattern is especially to be found in projects where people are just getting started with Akka.&lt;/p></description></item><item><title>A new adaptive accrual failure detector for Akka</title><link>https://manuel.bernhardt.io/2017/07/26/a-new-adaptive-accrual-failure-detector-for-akka/</link><pubDate>Wed, 26 Jul 2017 15:28:38 +0200</pubDate><guid>https://manuel.bernhardt.io/2017/07/26/a-new-adaptive-accrual-failure-detector-for-akka/</guid><description>&lt;p>&lt;a href="http://akka.io">Akka&lt;/a> uses the &lt;a href="http://fubica.lsd.ufcg.edu.br/hp/cursos/cfsc/papers/hayashibara04theaccrual.pdf">The Φ Accrual Failure Detector&lt;/a> for failure detection, which is to say for answering the question of whether a node is alive or not. That&amp;rsquo;s one of the harder problems of distributed systems since it is virtually impossible (from the point of view of one node) to tell the difference of a remote system being completely unavailable (process crashed, computer died, etc.) or &lt;em>slow&lt;/em> (network congestion, other kind of congestion such as CPU during a garbage collection for JVM processes, etc.).&lt;/p></description></item><item><title>Akka anti-patterns: trusting the network</title><link>https://manuel.bernhardt.io/2017/06/20/akka-anti-patterns-trusting-network/</link><pubDate>Tue, 20 Jun 2017 05:06:33 +0200</pubDate><guid>https://manuel.bernhardt.io/2017/06/20/akka-anti-patterns-trusting-network/</guid><description>&lt;p>One anti-pattern I&amp;rsquo;ve observed in networked Akka applications is a tendency to forget that it is, well, networked and to treat the network as a friendly place.&lt;/p>
&lt;p>
 &lt;figure style="text-align: center">
 &lt;img src="https://manuel.bernhardt.io/wp-content/trusting-the-network.jpg" class="pure-img" alt="">
 &lt;figcaption>Trusting the network to be reliable&lt;/figcaption>
 &lt;/figure>

&lt;/p>
&lt;p>How does that look like? Well, consider the following piece of code:&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-java" data-lang="java">&lt;span class="line">&lt;span class="cl">&lt;span class="n">actorOnDifferentNode&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="na">tell&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">veryImportantMessage&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="w"> &lt;/span>&lt;span class="n">sender&lt;/span>&lt;span class="p">());&lt;/span>&lt;span class="w">
&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>Akka&amp;rsquo;s default message sending mechanism is the fire-and-forget &lt;code>tell&lt;/code> method. And that works great - until it doesn&amp;rsquo;t. See, &lt;code>tell&lt;/code> has &lt;a href="http://doc.akka.io/docs/akka/current/java/general/message-delivery-reliability.html">at-most-once message delivery semantics&lt;/a>. This means that in theory (and in practice!) messages may not make it to their destination.&lt;/p></description></item><item><title>Akka anti-patterns: using remoting</title><link>https://manuel.bernhardt.io/2017/06/08/akka-anti-patterns-using-remoting/</link><pubDate>Thu, 08 Jun 2017 07:14:03 +0200</pubDate><guid>https://manuel.bernhardt.io/2017/06/08/akka-anti-patterns-using-remoting/</guid><description>&lt;p>
 &lt;figure style="text-align: center">
 &lt;img src="https://manuel.bernhardt.io/wp-content/lucy-waves.jpg" class="pure-img" alt="">
 &lt;figcaption>Senior developer using Akka remoting directly to build a special type of cluster&lt;/figcaption>
 &lt;/figure>

&lt;/p>
&lt;p>Whilst I have always successfully discouraged my clients from using &lt;a href="http://doc.akka.io/docs/akka/snapshot/scala/remoting.html">Akka Remoting&lt;/a> in their application, I often get questions regarding remoting while &lt;a href="https://manuel.bernhardt.io/talks/">talking&lt;/a> about anti-patterns at conferences and user groups.&lt;/p>
&lt;p>Don&amp;rsquo;t get me wrong. I love Akka remoting. Especially the new &lt;a href="https://github.com/real-logic/Aeron">Aeron&lt;/a>-based &lt;a href="http://doc.akka.io/docs/akka/snapshot/scala/remoting-artery.html">Artery&lt;/a> remoting version that is based on UDP rather than TCP. Whilst it maintains the same delivery guarantees, it is quite a bit faster than the TCP counterpart.&lt;/p></description></item><item><title>Tour de Lagom Part 1: Lagom and microservices</title><link>https://manuel.bernhardt.io/2017/06/05/tour-de-lagom-part-1-lagom-microservices/</link><pubDate>Mon, 05 Jun 2017 16:17:52 +0200</pubDate><guid>https://manuel.bernhardt.io/2017/06/05/tour-de-lagom-part-1-lagom-microservices/</guid><description>&lt;p>&lt;a href="https://www.lagomframework.com">Lagom&lt;/a> is a framework for building reactive microservices in Scala or Java with an emphasis on developer productivity. I&amp;rsquo;ve had a chance to work with it for some time and would like to share my impressions about it. This is going to take a bit longer than just one post, so you&amp;rsquo;re reading part one of a 3-part series:&lt;/p>
&lt;ul>
&lt;li>Part 1: Lagom and microservices&lt;/li>
&lt;li>Part 2: Lagom and reactive&lt;/li>
&lt;li>Part 3: Lagom and developer productivity&lt;/li>
&lt;/ul>
&lt;p>The idea is to cover most of what Lagom has to offer by looking at it at various angles. Let&amp;rsquo;s go!&lt;/p></description></item><item><title>Akka Streams – What is NotUsed all about</title><link>https://manuel.bernhardt.io/2017/05/22/akka-streams-notused/</link><pubDate>Mon, 22 May 2017 08:55:14 +0200</pubDate><guid>https://manuel.bernhardt.io/2017/05/22/akka-streams-notused/</guid><description>&lt;p>&lt;a href="http://akka.io">Akka Streams&lt;/a> is a powerful implementation on top of the &lt;a href="http://www.reactive-streams.org/">Reactive Streams&lt;/a> SPI for non-blocking asynchronous communication with back-pressure on the JVM. This post is not about explaining what this means, nor what Akka Streams does. The purpose of this post is to explain what on earth the &lt;code>NotUsed&lt;/code> type in type signatures of Akka Streams is all about which — incidentally — also means explaining a fundamental design aspect of Akka Streams.&lt;/p></description></item><item><title>Akka anti-patterns: blocking</title><link>https://manuel.bernhardt.io/2017/05/15/akka-anti-patterns-blocking/</link><pubDate>Mon, 15 May 2017 07:59:20 +0200</pubDate><guid>https://manuel.bernhardt.io/2017/05/15/akka-anti-patterns-blocking/</guid><description>&lt;p>This is probably one of the most frequent (and dangerous) anti-patterns when it comes to working with &lt;a href="http://akka.io/">Akka&lt;/a>. Let&amp;rsquo;s look at an adequate description of the mindset you must be in in order to use it:&lt;/p>
&lt;p>So maybe you didn&amp;rsquo;t actually want to see the world burn. Maybe you thought that this one time it was okay to call blocking code inside of an actor. Little did you know that, seven months later, this decision would bring down the entire system minutes after its official launch and announcement in the media.&lt;/p></description></item><item><title>IntelliJ IDEA OS X Shortcuts on Ubuntu Gnome</title><link>https://manuel.bernhardt.io/2017/04/10/intellij-idea-os-x-shortcuts-ubuntu-gnome/</link><pubDate>Mon, 10 Apr 2017 19:43:20 +0200</pubDate><guid>https://manuel.bernhardt.io/2017/04/10/intellij-idea-os-x-shortcuts-ubuntu-gnome/</guid><description>&lt;p>I recently got myself a new desktop computer with nice and fast hardware (more about this in another post) and am setting up Ubuntu Gnome on it. Since I&amp;rsquo;ll still be using my MacBook Pro for some time I don&amp;rsquo;t want to learn another set of keyboard shortcuts, so I set out to use IDEA&amp;rsquo;s OS X 10.5+ keyboard bindings on Ubuntu. It turns out that it possible, although not straightforward. Here&amp;rsquo;s how to go about it.&lt;/p></description></item><item><title>Akka anti-patterns: being out of touch with the hardware</title><link>https://manuel.bernhardt.io/2016/11/21/akka-anti-patterns-being-out-of-touch-with-the-hardware/</link><pubDate>Mon, 21 Nov 2016 17:02:31 +0100</pubDate><guid>https://manuel.bernhardt.io/2016/11/21/akka-anti-patterns-being-out-of-touch-with-the-hardware/</guid><description>&lt;p>Choosing Akka as a tool is often - if not always - driven by the need for good performance. Surely, the actor model itself is appealing as a means for organizing and reasoning about code, but this isn&amp;rsquo;t in itself a good reason enough to use the Akka toolkit. If all you are concerned about is a nice way to organize code and build modular applications you might as well pick the Spring Framework which has a very rich and clear component model and provides very good support for building software where performance isn&amp;rsquo;t one of the driving factors.&lt;/p></description></item><item><title>Akka anti-patterns: too many actor systems</title><link>https://manuel.bernhardt.io/2016/08/23/akka-anti-patterns-too-many-actor-systems/</link><pubDate>Tue, 23 Aug 2016 07:25:10 +0200</pubDate><guid>https://manuel.bernhardt.io/2016/08/23/akka-anti-patterns-too-many-actor-systems/</guid><description>&lt;p>Admittedly I&amp;rsquo;ve seen this one in use only one time, but it was one time too many. For some reason I keep seeing clients come up with this during design discussions and reviews though, therefore it makes it into the list of &lt;a href="https://manuel.bernhardt.io/tags/anti-pattern/">Akka anti-patterns&lt;/a>.&lt;/p>
&lt;p>What I am talking about is this:&lt;/p>
&lt;p>
 &lt;figure style="text-align: center">
 &lt;img src="https://manuel.bernhardt.io/wp-content/actorsystems.png" class="pure-img" alt="">
 &lt;figcaption>Many ActorSystems on a single JVM, competing for resources&lt;/figcaption>
 &lt;/figure>

&lt;/p>
&lt;p>Reasons I hear for this design:&lt;/p>
&lt;ul>
&lt;li>isolation of concerns: each ActorSystem is separated, hence failure of one system does not affect the other&lt;/li>
&lt;li>custom classloading in the ActorSystem, dynamically loading libraries and isolating them between systems&lt;/li>
&lt;li>using multiple Akka versions without having to restart&lt;/li>
&lt;/ul>
&lt;p>And I am not talking about designs where there are 2 or 3 ActorSystems on the same JVM here, but possible hundreds if not thousands. Now, Akka itself &lt;a href="http://doc.akka.io/docs/akka/current/general/actor-systems.html#Configuration_Container">does not share any global state&lt;/a> so you can theoretically pull this off. But should you?&lt;/p></description></item><item><title>Akka anti-patterns: race conditions</title><link>https://manuel.bernhardt.io/2016/08/16/akka-anti-patterns-race-conditions/</link><pubDate>Tue, 16 Aug 2016 05:00:39 +0200</pubDate><guid>https://manuel.bernhardt.io/2016/08/16/akka-anti-patterns-race-conditions/</guid><description>&lt;p>
&lt;figure style="text-align: center">
 &lt;img src="https://manuel.bernhardt.io/wp-content/3169240519_49e8193ab4_o.jpg" class="pure-img" alt="">
&lt;/figure>

&lt;/p>
&lt;p>The actor model makes it possible to build highly-concurrent applications through the notion that actors obey the &lt;a href="http://doc.akka.io/docs/akka/snapshot/general/jmm.html#Actors_and_the_Java_Memory_Model">actor send rule and the actor subsequent processing rule&lt;/a>, hence creating a &lt;strong>single-threaded environment&lt;/strong> inside of an actor.&lt;/p>
&lt;p>That being said, it&amp;rsquo;s all an &lt;strong>illusion&lt;/strong>: as we have &lt;a href="https://manuel.bernhardt.io/2016/08/02/akka-anti-patterns-shared-mutable-state/">briefly talked about previously&lt;/a>, Akka&amp;rsquo;s dispatchers make sure that messages are being processed by actors and so the thread by which one message is processed may not be the same as the one by which the next message is going to be processed.&lt;/p></description></item><item><title>Akka anti-patterns: flat actor hierarchies or mixing business logic and failure handling</title><link>https://manuel.bernhardt.io/2016/08/09/akka-anti-patterns-flat-actor-hierarchies-or-mixing-business-logic-and-failure-handling/</link><pubDate>Tue, 09 Aug 2016 04:00:31 +0200</pubDate><guid>https://manuel.bernhardt.io/2016/08/09/akka-anti-patterns-flat-actor-hierarchies-or-mixing-business-logic-and-failure-handling/</guid><description>&lt;p>
 &lt;figure style="text-align: center">
 &lt;img src="https://manuel.bernhardt.io/wp-content/Portable-Network-Graphics-image-C1B055469582-1.png" class="pure-img" alt="">
 &lt;figcaption>Flat actor hierarchy. Sad actors being all flat.&lt;/figcaption>
 &lt;/figure>

&lt;/p>
&lt;p>One of the fundamental ideas built into Akka is the one of failure handling through parental &lt;em>supervision&lt;/em>.&lt;/p>
&lt;p>In other words this means agencing actors in such a way that parent actors that depend upon the correct execution of a child to perform their work are also responsible for deciding what to do when one of the child actor crashes.&lt;/p>
&lt;p>An exception thrown inside of an actor results in that actor crashing, prompting its parent to decide what to do, which it does using a &lt;a href="http://doc.akka.io/docs/akka/current/general/supervision.html">SupervisorStrategy&lt;/a>. You should not be writing defensive &lt;code>try...catch&lt;/code> blocks inside of an actor - except perhaps for a few rare cases, this too is an anti-pattern! Instead the idea is to &lt;a href="http://letitcrash.com">let it crash&lt;/a> and handle failures through another channel entirely.&lt;/p></description></item><item><title>Akka anti-patterns: shared mutable state</title><link>https://manuel.bernhardt.io/2016/08/02/akka-anti-patterns-shared-mutable-state/</link><pubDate>Tue, 02 Aug 2016 15:00:40 +0200</pubDate><guid>https://manuel.bernhardt.io/2016/08/02/akka-anti-patterns-shared-mutable-state/</guid><description>&lt;p>When I work with clients on designing actor systems there are a few anti-patterns that seem to make it into initial, non-reviewed designs no matter what. In this series of short articles I would like to cover a few of those.&lt;/p>
&lt;h1 id="anti-pattern-1-sharing-mutable-state-accross-actors">Anti-pattern #1: sharing mutable state accross actors&lt;/h1>
&lt;p>
&lt;figure style="text-align: center">
 &lt;img src="https://manuel.bernhardt.io/wp-content/one-does-not-state.jpg" class="pure-img" alt="">
&lt;/figure>

&lt;/p>
&lt;p>Even though the Akka documentation &lt;a href="http://doc.akka.io/docs/akka/current/general/actor-systems.html#Actor_Best_Practices">points this out&lt;/a> &lt;a href="http://doc.akka.io/docs/akka/current/general/jmm.html#Actors_and_shared_mutable_state">in various places&lt;/a>, one of the favourite anti-patterns I&amp;rsquo;ve seen is use is &lt;em>sharing mutable state accross actor boundaries&lt;/em>.&lt;/p></description></item><item><title>The reality of writing a technical book</title><link>https://manuel.bernhardt.io/2016/07/15/the-reality-of-writing-a-technical-book/</link><pubDate>Fri, 15 Jul 2016 16:18:15 +0200</pubDate><guid>https://manuel.bernhardt.io/2016/07/15/the-reality-of-writing-a-technical-book/</guid><description>&lt;p>Two days ago I received my copies of &lt;a href="https://manuel.bernhardt.io/reactive-web-applications/">Reactive Web Applications&lt;/a>.&lt;/p>
&lt;p>
 &lt;figure style="text-align: center">
 &lt;img src="https://manuel.bernhardt.io/wp-content/IMG_8064.jpg" class="pure-img" alt="">
 &lt;figcaption>Stairways to Reactive&lt;/figcaption>
 &lt;/figure>

&lt;/p>
&lt;p>Needless to say, I had been waiting for this moment for some time. Even though the final PDF version had been out for a few weeks prior to this, nothing compares to holding in your hands an actual, physical, printed book (sites like &lt;a href="https://www.printivity.com/books/perfect-bound-books">Printivity&lt;/a> could help out in this regard) and seeing the pages you&amp;rsquo;ve been working on in context with the possibility of turning them back and forth. Call me old-fashioned, but when it comes to reading a book with the purpose of learning new material I have the feeling that printed books have a better quality to it, with some form of tactile memory helping to remember the contents better.&lt;/p></description></item><item><title>The microservices marathon</title><link>https://manuel.bernhardt.io/2016/06/14/the-microservices-marathon/</link><pubDate>Tue, 14 Jun 2016 09:19:58 +0200</pubDate><guid>https://manuel.bernhardt.io/2016/06/14/the-microservices-marathon/</guid><description>&lt;p>Everyone is talking about microservices. And many people are betting on it. At this year&amp;rsquo;s &lt;a href="https://voxxeddays.com/vienna/">Voxxed Days Vienna&lt;/a> over 60% of the submissions contained the word microservices. At JAX 2016 in Mainz, the word microservices was spoken out aloud on average 40 times per minute accross the entire venue. It&amp;rsquo;s hard to go one day on Twitter without seeing microservices in the stream.&lt;/p>
&lt;p>In this post I&amp;rsquo;ll first try to answer the question of why there is a need for microservices (in some settings) and then I&amp;rsquo;d like to talk a bit about what I think is a neglected issue in all the hype surrounding the topic these days: the feasability of organizational adoption of microservices. It is one thing to have the tools to microservice and another one entirely to be able to get an organization to think and act in terms compatible with the vision promised by the microservice architecture.&lt;/p></description></item><item><title>Akka Cluster, Java and the Raspberry PI 3 Model B</title><link>https://manuel.bernhardt.io/2016/04/19/akka-cluster-java-and-the-raspberry-pi-3-model-b/</link><pubDate>Tue, 19 Apr 2016 07:39:52 +0200</pubDate><guid>https://manuel.bernhardt.io/2016/04/19/akka-cluster-java-and-the-raspberry-pi-3-model-b/</guid><description>&lt;p>I recently built an architecture prototype for &lt;a href="http://dimoco.at">DIMOCO&lt;/a> aiming at answering roughly the following questions:&lt;/p>
&lt;ul>
&lt;li>what does it entail to run an Akka cluster, how fast can new nodes join, how manageable is such a cluster?&lt;/li>
&lt;li>are traditional publish-subscribe message distribution semantics supported (one-to-one, one-to-N, one-to-any-of-N)?&lt;/li>
&lt;li>how can message loss be averted / minimized?&lt;/li>
&lt;li>how fast is the message sending, is it fast enough?&lt;/li>
&lt;li>does it feel &amp;ldquo;Java-like&amp;rdquo; enough (since Akka has strong ties to Scala and the aim is to use Java for this project)?&lt;/li>
&lt;li>how well does it run on the data centers on premise, how easy is it to operate?&lt;/li>
&lt;/ul>
&lt;p>Since I&amp;rsquo;ve been itching to find an excuse for trying out the new &lt;a href="https://www.raspberrypi.org/products/raspberry-pi-3-model-b/">Raspberry PI 3 Model B&lt;/a> this was the perfect opportunity to order 3 of them and use them for testing the prototype.&lt;/p></description></item><item><title>The one Play Framework productivity tip you should know about</title><link>https://manuel.bernhardt.io/2016/03/07/the-one-play-framework-productivity-tip-you-should-know-about/</link><pubDate>Mon, 07 Mar 2016 15:08:38 +0100</pubDate><guid>https://manuel.bernhardt.io/2016/03/07/the-one-play-framework-productivity-tip-you-should-know-about/</guid><description>&lt;p>If there is one thing you need to know when it comes to enhancing your productivity when working with the &lt;a href="http://www.playframework.com">Play Framework&lt;/a> it&amp;rsquo;s the following tip because it will save you a lot of time during development. I&amp;rsquo;ve watched many developers repeat the same steps countless times in a day and every time I show this albeit simple tooling tip it&amp;rsquo;s like developing is a whole new experience again.&lt;/p>
&lt;p>So what&amp;rsquo;s this &amp;ldquo;magic&amp;rdquo; tip I am talking about? Since Play leverages type-safety and warns you early on that things go bad through compilation errors, your screen will often look like this:&lt;/p></description></item><item><title>Upgrading from React 0.11.2 to 0.14.7 in 374 easy steps</title><link>https://manuel.bernhardt.io/2016/02/25/upgrading-from-react-0-11-2-to-0-14-7-in-374-easy-steps/</link><pubDate>Thu, 25 Feb 2016 17:42:17 +0100</pubDate><guid>https://manuel.bernhardt.io/2016/02/25/upgrading-from-react-0-11-2-to-0-14-7-in-374-easy-steps/</guid><description>&lt;p>Today I set out to the task of upgrading a set of views crafted with the &lt;a href="https://facebook.github.io/react/">React&lt;/a> library. The upgrade was necessary because one part of a view using React stopped working in Chrome Version 48.0.2564.116 (64-bit). I don&amp;rsquo;t know why this happened, I didn&amp;rsquo;t find anything related to it and as it stands this was probably the only project on the Internet still running on this old version of React anyway. If not, you may or may not find this post useful. Or not. But at least it might be entertaining.&lt;/p></description></item><item><title>5 years of Scala and counting – debunking some myths about the language and its environment</title><link>https://manuel.bernhardt.io/2015/11/13/5-years-of-scala-and-counting-debunking-some-myths-about-the-language-and-its-environment/</link><pubDate>Fri, 13 Nov 2015 12:39:21 +0100</pubDate><guid>https://manuel.bernhardt.io/2015/11/13/5-years-of-scala-and-counting-debunking-some-myths-about-the-language-and-its-environment/</guid><description>&lt;p>I started using Scala 5 years ago instead of Java after starting (but never quite finishing) to read the first edition of &lt;a href="http://www.artima.com/shop/programming_in_scala_2ed">Programming in Scala&lt;/a>. First only present in tests, my first attempts at Scala code would quite soon invade small utility classes and before I knew it take over all of my projects.&lt;/p>
&lt;p>There are many rants about Scala out there. This isn&amp;rsquo;t one of them. I&amp;rsquo;m not here to complain, but rather to applaud.&lt;/p></description></item><item><title>A quick tour of JSON libraries in Scala</title><link>https://manuel.bernhardt.io/2015/11/06/a-quick-tour-of-json-libraries-in-scala/</link><pubDate>Fri, 06 Nov 2015 00:22:48 +0100</pubDate><guid>https://manuel.bernhardt.io/2015/11/06/a-quick-tour-of-json-libraries-in-scala/</guid><description>&lt;p>&lt;strong>Update (18.11.2015)&lt;/strong>: added spray-json-shapeless library&lt;br>
&lt;strong>Update (06.11.15)&lt;/strong>: added circe library&lt;/p>
&lt;p>Some time ago I wrote a &lt;a href="https://manuel.bernhardt.io/2014/02/04/a-quick-tour-of-relational-database-access-with-scala/">post on relational database access in Scala&lt;/a> since I was looking for a library and there were many of them available, making it hard to make a choice. It turns out that the situation is similar if not worse when it comes to JSON libraries in Scala.&lt;/p>
&lt;p>There are just plenty of them. You have no idea. (me neither until I wrote this post)&lt;/p></description></item><item><title>The Art of Meaningful Programming</title><link>https://manuel.bernhardt.io/2015/05/28/the-art-of-meaningful-programming/</link><pubDate>Wed, 27 May 2015 23:16:38 +0200</pubDate><guid>https://manuel.bernhardt.io/2015/05/28/the-art-of-meaningful-programming/</guid><description>&lt;p>As a child (I think I was around 6 at that time), I wanted to become an inventor, much like &lt;a href="http://en.wikipedia.org/wiki/Gyro_Gearloose">Gyro Gearloose&lt;/a>. My father wisely pointed out that this wasn&amp;rsquo;t a job that existed on the job market, but that the closest thing was likely to become an engineer of some kind. And so I ended up becoming a telecommunications engineer with a specialization in the development of distributed systems.&lt;/p>
&lt;p>Software is an excellent medium for expressing one&amp;rsquo;s creativity. It is cheap and malleable, and nowadays it is possible to see the result of what code does almost instantly. I haven&amp;rsquo;t yet figured out how to build a &lt;a href="http://disneycomics.wikia.com/wiki/Little_Helper">walking light-bulb&lt;/a> with software yet but give it 15 years and we&amp;rsquo;ll have APIs for this, too. But programming is not easy, which also means that next to actually building things, we software people spend a lot of time learning how to build things and arguing about how things should be built.&lt;/p></description></item><item><title>Reactive Play</title><link>https://manuel.bernhardt.io/2015/01/27/reactive-play/</link><pubDate>Tue, 27 Jan 2015 08:17:00 +0100</pubDate><guid>https://manuel.bernhardt.io/2015/01/27/reactive-play/</guid><description>&lt;p>&lt;strong>TL;DR:&lt;/strong> Play applications are not automagically performant. I&amp;rsquo;m writing a &lt;a href="http://manning.com/bernhardt">book&lt;/a> that shows how to use Play correctly, especially when used to working with threaded web-servers such as &lt;a href="http://tomcat.apache.org">Tomcat&lt;/a> or &lt;a href="http://eclipse.org/jetty">Jetty&lt;/a>. Save 50% with the code &lt;em>mlbernhardt&lt;/em>.&lt;/p></description></item><item><title>Generation Javascript</title><link>https://manuel.bernhardt.io/2014/12/30/generation-javascript/</link><pubDate>Tue, 30 Dec 2014 09:24:36 +0100</pubDate><guid>https://manuel.bernhardt.io/2014/12/30/generation-javascript/</guid><description>&lt;p>I&amp;rsquo;ll start by saying that this is not a rant, but rather a cry of despair that I&amp;rsquo;m repeating and that slowly - but steadily - seems to come to consciousness in our industry, like &lt;a href="http://www.breck-mckye.com/blog/2014/12/the-state-of-javascript-in-2015/">this one&lt;/a>. The phenomenon I&amp;rsquo;m about to describe is not only limited to the Javascript community either, that community seems a lot more affected than others.&lt;/p>
&lt;p>Up until this morning, I had been mumbling about those concerns mostly to myself, and to some colleagues and friends. Then I read &lt;a href="https://queue.acm.org/detail.cfm?id=2349257">this article&lt;/a> and I felt like I had to do something. This really is a good read, if you haven&amp;rsquo;t seen it yet, I recommend adding it to your reading list or Instapaper or whatsonot right away. The article, &lt;a href="https://queue.acm.org/detail.cfm?id=2349257">A generation lost in the Bazaar&lt;/a>, talks about Unix and how the lack of overall design or &amp;ldquo;bazaar&amp;rdquo; mentality (depicted in &lt;a href="http://en.wikipedia.org/wiki/The_Cathedral_and_the_Bazaar">The Cathedral and the Bazaar&lt;/a>) have made it extremely hard to get anything done without digging through a jungle of libraries that kind of repeat functionality, contain copy-pasted code, or depend on libraries that they perhaps don&amp;rsquo;t need at all.&lt;/p></description></item><item><title>A handful Akka techniques</title><link>https://manuel.bernhardt.io/2014/04/23/a-handful-akka-techniques/</link><pubDate>Wed, 23 Apr 2014 19:50:28 +0200</pubDate><guid>https://manuel.bernhardt.io/2014/04/23/a-handful-akka-techniques/</guid><description>&lt;p>I&amp;rsquo;ve been using &lt;a href="http://akka.io">Akka&lt;/a> for 3 years in a variety of projects and by now, I have a hard time imagining to deal with
some of the parts of my work without it. Sure, Scala provides other powerful paradigms for dealing with concurrency, but
I find Actors to be one of the most elegant concept when it comes to reasoning about it.&lt;/p>
&lt;p>There are a few techniques that I&amp;rsquo;ve used repeatedly in projects and that I would like to share. Make no mistake though&lt;/p></description></item><item><title>A quick tour of relational database access with Scala</title><link>https://manuel.bernhardt.io/2014/02/04/a-quick-tour-of-relational-database-access-with-scala/</link><pubDate>Tue, 04 Feb 2014 18:43:39 +0100</pubDate><guid>https://manuel.bernhardt.io/2014/02/04/a-quick-tour-of-relational-database-access-with-scala/</guid><description>&lt;p>&lt;strong>Update:&lt;/strong> Added Squeryl, thanks to &lt;a href="https://twitter.com/JoeZulli">@JoeZulli&lt;/a> for the heads-up&lt;br>
&lt;strong>Update 2:&lt;/strong> Added link to latest Squeryl release for Scala 2.10 and 2.9.2&lt;/p>
&lt;p>I recently started working with relational databases again from within Scala, after a while in JSON-land (mostly &lt;a href="http://www.mongodb.org/">MongoDB&lt;/a> and &lt;a href="http://www.elasticsearch.org/">elasticsearch&lt;/a>). During that time, I&amp;rsquo;d been happily working with lightweight libraries / DSLs that take care of case class serialization, such as the impeccable &lt;a href="https://github.com/novus/salat/">Salat&lt;/a> and &lt;a href="https://github.com/sksamuel/elastic4s">elastic4s&lt;/a>.&lt;/p>
&lt;p>So I started looking for a tool that would let me achieve the following:&lt;/p></description></item><item><title>Java2Days Sofia 2013</title><link>https://manuel.bernhardt.io/2013/12/21/java2days-sofia-2013/</link><pubDate>Sat, 21 Dec 2013 16:50:40 +0100</pubDate><guid>https://manuel.bernhardt.io/2013/12/21/java2days-sofia-2013/</guid><description>&lt;p>Two weeks ago, I went to speak about &lt;a href="http://www.scala-lang.org/">Scala&lt;/a> at the &lt;a href="http://2013.java2days.com/">Java2Days&lt;/a> conference in Sofia, Bulgaria. This was the 5th edition of the conference, and my first time there. A small group of speakers (to the extent of my knowledge, &lt;a href="http://www.joshlong.com">Josh Long&lt;/a>, &lt;a href="https://twitter.com/botchagalupe">John Willis&lt;/a> and &lt;a href="http://www.mysticcoders.com/blog/">Andrew Lombardi&lt;/a>) has been flying overseas every year to attend the conference since it&amp;rsquo;s first edition. Why, you ask? After having been there, I too know why: it&amp;rsquo;s a really nice conference!&lt;/p></description></item><item><title>Tips &amp; tricks for setting up a Play 2 project</title><link>https://manuel.bernhardt.io/2013/11/16/tips-tricks-for-setting-up-a-play-2-project/</link><pubDate>Sat, 16 Nov 2013 16:47:32 +0100</pubDate><guid>https://manuel.bernhardt.io/2013/11/16/tips-tricks-for-setting-up-a-play-2-project/</guid><description>&lt;p>Here are the slides from my talk at &lt;a href="http://devoxx.be" title="Devoxx 2013">Devoxx 2013 in Antwerp&lt;/a>: &lt;a href="https://speakerdeck.com/manuelbernhardt/tips-and-tricks-for-setting-up-a-play-2-project">https://speakerdeck.com/manuelbernhardt/tips-and-tricks-for-setting-up-a-play-2-project&lt;/a>&lt;/p>
&lt;div style="left: 0; width: 100%; height: 0; position: relative; padding-bottom: 56.1972%;">&lt;iframe src="https://speakerdeck.com/player/37ba4e89c08e4e50bee0d3324e974fd6" style="top: 0; left: 0; width: 100%; height: 100%; position: absolute; border: 0;" allowfullscreen scrolling="no" allow="encrypted-media;">&lt;/iframe>&lt;/div>
&lt;p>Devoxx was great, as always! A huge thank to Stephane and his crew for making it happen, year after year!&lt;/p>
&lt;p>
 &lt;figure style="text-align: center">
 &lt;img src="https://manuel.bernhardt.io/wp-content/photo-2.jpg" class="pure-img" alt="">
 &lt;figcaption>Devoxx wristbands 2012 and 2013&lt;/figcaption>
 &lt;/figure>

&lt;/p></description></item><item><title>Reactive Golf or Iteratees and all that stuff in practice, part 3</title><link>https://manuel.bernhardt.io/2013/10/26/reactive-golf-or-iteratees-and-all-that-stuff-in-practice-part-3/</link><pubDate>Sat, 26 Oct 2013 17:44:07 +0200</pubDate><guid>https://manuel.bernhardt.io/2013/10/26/reactive-golf-or-iteratees-and-all-that-stuff-in-practice-part-3/</guid><description>&lt;p>In &lt;a href="https://manuel.bernhardt.io/2013/10/17/reactive-golf-or-iteratees-and-all-that-stuff-in-practice-part-1/">part 1&lt;/a> and &lt;a href="https://manuel.bernhardt.io/2013/10/21/reactive-golf-or-iteratees-and-all-that-stuff-in-practice-part-2/">2&lt;/a> we&amp;rsquo;ve seen how to build a completely reactive chain to fetch a large stream of data from a REST API, transform it on the fly and send it over to indexing to &lt;a href="http://elasticsearch.org">ElasticSearch&lt;/a>.&lt;/p>
&lt;p>Now one question remains: does it actually work, and does it help solve a real problem?&lt;/p>
&lt;p>In order to answer to this question, let&amp;rsquo;s build a naive, blocking version of the pipe-line above. We&amp;rsquo;ll consume the stream, then transform it, and then send it over to ElasticSearch, in chunks:&lt;/p></description></item><item><title>Java Klassentreffen 2013: Scala Introduction slides</title><link>https://manuel.bernhardt.io/2013/10/24/scala-introduction-slides/</link><pubDate>Thu, 24 Oct 2013 15:25:09 +0200</pubDate><guid>https://manuel.bernhardt.io/2013/10/24/scala-introduction-slides/</guid><description>&lt;p>A bit late, but nonetheless: my slides from the &lt;a href="http://java.at/web/guest/jkt13">Java Klassentreffen 2013&lt;/a> in Vienna and Linz.&lt;/p>
&lt;div style="margin-bottom:5px">
 &lt;strong> &lt;a href="https://www.slideshare.net/ManuelBernhardt/java-klassentreffenvienna" title="Introduction to Scala" target="_blank">Introduction to Scala&lt;/a> &lt;/strong> from &lt;strong>&lt;a href="http://www.slideshare.net/ManuelBernhardt" target="_blank">Manuel Bernhardt&lt;/a>&lt;/strong>
&lt;/div></description></item><item><title>Reactive Golf or Iteratees and all that stuff in practice, part 2</title><link>https://manuel.bernhardt.io/2013/10/21/reactive-golf-or-iteratees-and-all-that-stuff-in-practice-part-2/</link><pubDate>Mon, 21 Oct 2013 18:29:43 +0200</pubDate><guid>https://manuel.bernhardt.io/2013/10/21/reactive-golf-or-iteratees-and-all-that-stuff-in-practice-part-2/</guid><description>&lt;p>Last week, we saw how to get data from a REST API and modify it to our liking in order to send it off for indexing to &lt;a href="http://elasticsearch.org">ElasticSearch&lt;/a>. Now, let&amp;rsquo;s see how to get the data into ElasticSearch in a resource-friendly manner.&lt;/p>
&lt;h2 id="indexing-with-elasticsearch-and-elastic4s">Indexing with ElasticSearch and elastic4s&lt;/h2>
&lt;p>ElasticSearch has a &lt;a href="http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/docs-index_.html">RESTful index API&lt;/a> through which to send data for indexing, like for example so (from the ElasticSearch documentation):&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;span class="lnt">2
&lt;/span>&lt;span class="lnt">3
&lt;/span>&lt;span class="lnt">4
&lt;/span>&lt;span class="lnt">5
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-shell" data-lang="shell">&lt;span class="line">&lt;span class="cl">$ curl -XPUT &lt;span class="s1">&amp;#39;http://localhost:9200/twitter/tweet/1&amp;#39;&lt;/span> -d &lt;span class="s1">&amp;#39;{
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s1"> &amp;#34;user&amp;#34; : &amp;#34;kimchy&amp;#34;,
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s1"> &amp;#34;post_date&amp;#34; : &amp;#34;2009-11-15T14:12:12&amp;#34;,
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s1"> &amp;#34;message&amp;#34; : &amp;#34;trying out Elastic Search&amp;#34;
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="s1">}&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>It also supports bulk requests, which is what we&amp;rsquo;ll need, since it makes little sense to issue one HTTP request for each document.&lt;/p></description></item><item><title>Reactive Golf or Iteratees and all that stuff in practice, part 1</title><link>https://manuel.bernhardt.io/2013/10/17/reactive-golf-or-iteratees-and-all-that-stuff-in-practice-part-1/</link><pubDate>Thu, 17 Oct 2013 20:24:13 +0200</pubDate><guid>https://manuel.bernhardt.io/2013/10/17/reactive-golf-or-iteratees-and-all-that-stuff-in-practice-part-1/</guid><description>&lt;p>I&amp;rsquo;m currently working on a project that involves synchronizing large amounts of data from backend systems for the purpose of making it searchable. Amongst other things, one domain the system deals with is &lt;a href="http://en.wikipedia.org/wiki/Golf">Golf&lt;/a> and the booking of tee times (i.e. a time at which to start playing). If I got things correctly, tee times are there in order to avoid getting hit by a player that starts later on (I haven&amp;rsquo;t played golf yet).&lt;/p></description></item><item><title>Scala with SublimeText</title><link>https://manuel.bernhardt.io/2013/09/20/scala-with-sublimetext/</link><pubDate>Fri, 20 Sep 2013 13:07:13 +0200</pubDate><guid>https://manuel.bernhardt.io/2013/09/20/scala-with-sublimetext/</guid><description>&lt;p>Three weeks ago, one of our cats set its mind to beat its long-distance jumping record on my desk, accross my laptop. Unfortunately for my laptop, there was a cup of tea standing next to it, and our cat didn&amp;rsquo;t care too much about adjusting the height of the jump.&lt;/p>
&lt;p>
 &lt;figure style="text-align: center">
 &lt;img src="https://manuel.bernhardt.io/wp-content/IMG_20130915_165229.jpg" class="pure-img" alt="">
 &lt;figcaption>Laptop-destroying cat&lt;/figcaption>
 &lt;/figure>

&lt;/p>
&lt;p>As a result, I am now working for the past 3 weeks with my old MacBook Pro Early 2008 (which I kept in a shelf for this purpose exactly). As a side effect though, I can&amp;rsquo;t work anymore with &lt;a href="http://www.jetbrains.com/idea/">IntelliJ IDEA&lt;/a>, because coding with Scala on this old machine (with little RAM) needs quite a bit of resources, and the IDE is too slow.&lt;/p></description></item><item><title>How to read the Play session from AngularJS</title><link>https://manuel.bernhardt.io/2013/08/01/how-to-read-the-play-session-from-angularjs/</link><pubDate>Thu, 01 Aug 2013 19:24:12 +0200</pubDate><guid>https://manuel.bernhardt.io/2013/08/01/how-to-read-the-play-session-from-angularjs/</guid><description>&lt;p>If you happen to work, like me, on a project that makes use of both the &lt;a href="http://www.playframework.com">Play framework&lt;/a> and &lt;a href="http://angularjs.org">AngularJS&lt;/a>, you may at some point need to read some data from the Play session in your AngularJS application. Play uses a &lt;a href="http://www.playframework.com/documentation/2.1.x/ScalaSessionFlash">client-side session&lt;/a>, which makes sharing the data with client-side applications easy.&lt;/p>
&lt;p>In order to access the session data on the client-side, you&amp;rsquo;ll need the following:&lt;/p>
&lt;h3 id="1-allow-the-play-session-to-be-read-by-javascript">1. Allow the Play session to be read by javascript&lt;/h3>
&lt;p>In &lt;code>application.conf&lt;/code>, set the &lt;code>session.httpOnly&lt;/code> flag to false:&lt;/p></description></item><item><title>The case for document-oriented databases</title><link>https://manuel.bernhardt.io/2013/07/28/the-case-for-document-oriented-databases/</link><pubDate>Sun, 28 Jul 2013 14:21:41 +0200</pubDate><guid>https://manuel.bernhardt.io/2013/07/28/the-case-for-document-oriented-databases/</guid><description>&lt;p>Last week, I started working with &lt;a href="http://angularjs.org">AngularJS&lt;/a> for a real-world project - I had played with Angular before, mainly to see how it differs from &lt;a href="http://knockoutjs.com">KnockoutJS&lt;/a> which I had been using intensively before. This post is not about AngularJS itself (I may write one later on when I have a better perspective about the framework), I&amp;rsquo;ll just say that my first impressions about it are:&lt;/p>
&lt;ul>
&lt;li>it lacks good documentation - the existing documentation doesn&amp;rsquo;t exactly have the right &amp;ldquo;feel&amp;rdquo;, and is incomplete&lt;/li>
&lt;li>when coming from Knockout, Angular feels rather invasive, given that it is a &amp;ldquo;full-blown&amp;rdquo; framework rather than &amp;ldquo;just&amp;rdquo; a MVVM mapping tool&lt;/li>
&lt;li>my current impression is that the learning curve looks like a roller-coaster - there&amp;rsquo;s moments of intense productivity interrupted with high amounts of &amp;ldquo;not getting anywhere, why on earth am I using this sh*t&amp;rdquo;&lt;/li>
&lt;/ul>
&lt;p>That being said, there&amp;rsquo;s one thing that AngularJS seems to get really right: it makes it possible to map documents to the UI without imposing its own design philosophy on the said document. With KnockoutJS for example, you&amp;rsquo;d have to make sure certain fields were provided as arrays, and generally had to know really well how the different bindings worked before knowing into what shape to bring your data so that the UI would do what you wanted.&lt;/p></description></item><item><title>CRUD trait for Slick models in the Play! framework</title><link>https://manuel.bernhardt.io/2013/07/08/crud-trait-for-slick-models-in-the-play-framework/</link><pubDate>Mon, 08 Jul 2013 20:09:41 +0200</pubDate><guid>https://manuel.bernhardt.io/2013/07/08/crud-trait-for-slick-models-in-the-play-framework/</guid><description>&lt;p>&lt;a href="http://slick.typesafe.com/">Slick&lt;/a> is a powerful library for functional database access, leveraging Scala language features such as implicit conversions and macro&amp;rsquo;s to allow type-safe interaction with databases.&lt;/p>
&lt;p>The &lt;a href="https://github.com/freekh/play-slick">play-slick&lt;/a> module allows easy integration with the &lt;a href="http://www.playframework.com">Play! framework&lt;/a> by providing e.g. support for database evolutions and other convenience methods.&lt;/p>
&lt;p>As I got to work with Slick more extensively, one thing that started to annoy me pretty soon is that I had to repeat boilerplate code for generic CRUD methods such as insert, update, delete, etc. At the same time, it didn&amp;rsquo;t look really easy to provide a CRUD trait for models, given that Slick&amp;rsquo;s design is heavily centered around the idea of drivers encapsulating the implementation details for all generic concerns (querying, insertion, etc.) and is therefore already making use of large portions of abstractions.&lt;/p></description></item><item><title>Quickly open errors in your IDE when developing Play applications</title><link>https://manuel.bernhardt.io/2013/06/14/quickly-open-errors-in-your-ide-when-developing-play-applications/</link><pubDate>Fri, 14 Jun 2013 11:08:23 +0200</pubDate><guid>https://manuel.bernhardt.io/2013/06/14/quickly-open-errors-in-your-ide-when-developing-play-applications/</guid><description>&lt;p>A few weeks ago, &lt;a href="http://www.jamesward.com/">James Ward&lt;/a> &lt;a href="http://www.jamesward.com/2013/05/15/auto-refresh-for-play-framework-apps">announced&lt;/a> a new &lt;a href="https://chrome.google.com/webstore/detail/play-framework-tools/dchhggpgbommpcjpogaploblnpldbmen">Google Chrome extension&lt;/a> (and &lt;a href="https://github.com/jamesward/play-auto-refresh">SBT plugin&lt;/a>) to automatically refresh &lt;a href="http://playframework.org">Play framework&lt;/a> applications during development in the browser. So I jumped on there being a Google Chrome extension and revived a feature of Play 1 that allows you to directly click on the error message in the browser to open the correct file and line in the IDE.&lt;/p>
&lt;p>Getting this to run is pretty simple, below the instructions for &lt;a href="https://www.jetbrains.com/idea/">IntelliJ IDEA&lt;/a> - if anyone has the equivalents for Eclipse, VIM, Emacs, etc. just send them to me and I&amp;rsquo;ll add them here!&lt;/p></description></item><item><title>How to disable the Shift + F10 “slow motion” animation on OS X and reclaim the keyboard shortcut</title><link>https://manuel.bernhardt.io/2013/06/04/how-to-disable-the-shift-f10-slow-motion-animation-on-os-x-and-reclaim-the-keyboard-shortcut/</link><pubDate>Tue, 04 Jun 2013 10:21:24 +0200</pubDate><guid>https://manuel.bernhardt.io/2013/06/04/how-to-disable-the-shift-f10-slow-motion-animation-on-os-x-and-reclaim-the-keyboard-shortcut/</guid><description>&lt;p>On OS X, when you press the Exposé keys (F9, F10, F11) with Shift as a modifier, you get the animation shown much, much slower. That&amp;rsquo;s nice and all, but this keyboard shortcut clashes with &lt;a href="http://www.jetbrains.com/idea/">IntelliJ IDEA&amp;rsquo;s&lt;/a> run shortcut, and there&amp;rsquo;s no option to turn this off via the default settings.&lt;/p>
&lt;p>So here&amp;rsquo;s how to do it by hand:&lt;/p>
&lt;p>Start by opening a terminal, and go to &lt;code>~/Library/Preferences&lt;/code>. There, open the &lt;code>com.apple.symbolichotkeys.plist&lt;/code> preference list by typing:&lt;/p></description></item><item><title>Java impressions after 2 years of abstinence</title><link>https://manuel.bernhardt.io/2013/06/03/java-impressions-after-2-years-of-abstinence/</link><pubDate>Mon, 03 Jun 2013 21:20:13 +0200</pubDate><guid>https://manuel.bernhardt.io/2013/06/03/java-impressions-after-2-years-of-abstinence/</guid><description>&lt;p>Today I wrote &lt;a href="https://github.com/manuelbernhardt/myTransportSchedule">my first useful Android app&lt;/a>, which shows the bus connections from the bus stop next to our flat to the subway line (I didn&amp;rsquo;t say it was going to be useful for you).&lt;/p>
&lt;p>
&lt;figure style="text-align: center">
 &lt;img src="https://manuel.bernhardt.io/wp-content/androidApp.png" class="pure-img" alt="">
&lt;/figure>

&lt;/p>
&lt;p>Since I didn&amp;rsquo;t want to start right away making things more complicated by adding Scala to the mix, I decided to write the application in plain old Java. I haven&amp;rsquo;t been writing much more than a line of Java in two years, I think - so here are my impressions after this evening&amp;rsquo;s experiment:&lt;/p></description></item><item><title>Dynamic multi-modular SBT project</title><link>https://manuel.bernhardt.io/2013/04/09/dynamic-multi-modular-sbt-project/</link><pubDate>Tue, 09 Apr 2013 12:18:46 +0200</pubDate><guid>https://manuel.bernhardt.io/2013/04/09/dynamic-multi-modular-sbt-project/</guid><description>&lt;p>As the &lt;a href="https://github.com/delving/culture-hub">Delving Culture-Hub&lt;/a> project grows, I found myself adding module definitions by hand to the &lt;a href="http://www.scala-sbt.org/">SBT&lt;/a> more often than what I&amp;rsquo;d wish for, and for each adjustment of a common value, having to go through all modules and adjust them.&lt;/p>
&lt;p>So after a while, I wondered whether it wouldn&amp;rsquo;t be possible to discover modules dynamically, rather than maintaining them by hand. It turns out that this is a bit tricky, &lt;a href="https://groups.google.com/forum/?fromgroups=#!topic/simple-build-tool/pNaz6ERZu1c">but still possible&lt;/a>.&lt;/p></description></item><item><title>Multi-modular development with Play 2.1</title><link>https://manuel.bernhardt.io/2013/03/26/multi-modular-development-with-play-2-1/</link><pubDate>Tue, 26 Mar 2013 15:53:30 +0100</pubDate><guid>https://manuel.bernhardt.io/2013/03/26/multi-modular-development-with-play-2-1/</guid><description>&lt;p>&lt;a href="http://www.playframework.com/documentation/2.1.0/Home">Play 2.1&lt;/a> makes it possible to write completely modular applications, and on top of this, to develop each module separately. I&amp;rsquo;ve been waiting for this for some time now, and even implemented a &lt;a href="https://github.com/delving/culture-hub/blob/13.03/app/Global.scala#L122">custom router based on plugins&lt;/a> while waiting for the framework to support modular routing. Now that the wait is over, let&amp;rsquo;s see how to take advantage of this feature.&lt;/p>
&lt;p>The Play documentation describes &lt;a href="http://www.playframework.com/documentation/2.1.0/SBTSubProjects">how to set-up a multi-modular project&lt;/a> via SBT sub-projects. What is important to understand here is that:&lt;/p></description></item><item><title>Activating logging in test mode in Play 2.0.x</title><link>https://manuel.bernhardt.io/2012/10/26/activating-logging-in-test-mode-in-play-2-0-x/</link><pubDate>Fri, 26 Oct 2012 09:38:47 +0200</pubDate><guid>https://manuel.bernhardt.io/2012/10/26/activating-logging-in-test-mode-in-play-2-0-x/</guid><description>&lt;p>Because of a permgen leak related to third-party libraries, the logging in test mode is disabled in Play 2.0.x (there&amp;rsquo;s a &lt;a href="https://groups.google.com/forum/?fromgroups=#!topic/play-framework/ZFGHd_99Uhk">fix coming up in Play 2.1&lt;/a>). In some cases, seeing what happens while running a test can be useful - e.g. when debugging calls to various Akka actors that don&amp;rsquo;t quite behave as expected.&lt;/p>
&lt;p>Luckily there&amp;rsquo;s a workaround, which is to specify a logger for logback by hand when starting play or SBT:&lt;/p></description></item><item><title>MongoDB-based Cache for Play 1.2.x and Play-Scala</title><link>https://manuel.bernhardt.io/2011/11/18/mongodb-based-cache-for-play-1-2-x-and-play-scala/</link><pubDate>Fri, 18 Nov 2011 22:33:57 +0100</pubDate><guid>https://manuel.bernhardt.io/2011/11/18/mongodb-based-cache-for-play-1-2-x-and-play-scala/</guid><description>&lt;p>In case anyone needs this: &lt;a href="https://gist.github.com/1377952">https://gist.github.com/1377952&lt;/a>&lt;/p>
&lt;p>You&amp;rsquo;ve got to bootstrap it in some bootstrap job like so:&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code class="language-scala" data-lang="scala">&lt;span class="line">&lt;span class="cl">&lt;span class="nc">ScalaCacheAccessor&lt;/span>&lt;span class="o">.&lt;/span>&lt;span class="n">set&lt;/span>&lt;span class="o">(&lt;/span>&lt;span class="k">new&lt;/span> &lt;span class="nc">MongoCacheImpl&lt;/span>&lt;span class="o">)&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>It&amp;rsquo;s only tested with the Press module so far (shared state is evil anyway 😉 )&lt;/p></description></item><item><title>Writing custom de/serializers for Jerkson</title><link>https://manuel.bernhardt.io/2011/11/01/writing-custom-deserializers-for-jerkson/</link><pubDate>Tue, 01 Nov 2011 19:54:45 +0100</pubDate><guid>https://manuel.bernhardt.io/2011/11/01/writing-custom-deserializers-for-jerkson/</guid><description>&lt;p>Since I wrote my &lt;a href="http://logician.eu/index.php/2011/09/16/play-scala-and-json/">previous post&lt;/a> on how to use &lt;a href="http://scala.playframework.org">Play! Scala&lt;/a> with &lt;a href="https://github.com/codahale/jerkson">Jerkson&lt;/a>, I was asked a number of times how to make use of custom de/serialization for classes. This happens when e.g. the case class you want to de/serialize has a POJO or another complex type that you&amp;rsquo;d like to have more control over, such as e.g. the &lt;a href="http://www.mongodb.org/display/DOCS/Object&amp;#43;IDs">BSON ObjectId&lt;/a> or Play&amp;rsquo;s &lt;a href="http://scala.playframework.org/documentation/scala-0.9.1/anorm">Anorm&lt;/a> PK.&lt;/p>
&lt;p>Here&amp;rsquo;s a wrap-up on how you can easily create custom de/serializers and use them within your Play! Scala application. Let&amp;rsquo;s take the example of the BSON ObjectId, which you will most likely run into if you use MongoDB in the backend.&lt;/p></description></item><item><title>Play! Scala and JSON</title><link>https://manuel.bernhardt.io/2011/09/16/play-scala-and-json/</link><pubDate>Fri, 16 Sep 2011 22:59:50 +0200</pubDate><guid>https://manuel.bernhardt.io/2011/09/16/play-scala-and-json/</guid><description>&lt;p>&lt;em>Update: If you need to have custom de/serialization of some types, check out &lt;a href="http://logician.eu/index.php/2011/11/01/writing-custom-deserializers-for-jerkson/">this new post&lt;/a>&lt;/em>&lt;/p>
&lt;p>I&amp;rsquo;ve been working with &lt;a href="http://scala.playframework.org/">Play! Scala&lt;/a> for a couple of months now, and the experience is really good - the combination of the Scala language and the sound design principles of Play! make web-development a real pleasure.&lt;/p>
&lt;p>One of the aspects I have been fighting with for a while (and which had initially put me off writing my first bigger Play! application with Play! Scala) is the lack of simple support for JSON de/serialization. With simple, I mean the possibility to turn a case class into a JSON string and back, and to additionally have access to a couple of more advanced features that are often required (e.g. implementing custom serialization of specific types).&lt;/p></description></item><item><title>Selenium IDE plugin for the Play! framework</title><link>https://manuel.bernhardt.io/2011/03/23/selenium-ide-plugin-for-the-play-framework/</link><pubDate>Wed, 23 Mar 2011 15:34:34 +0100</pubDate><guid>https://manuel.bernhardt.io/2011/03/23/selenium-ide-plugin-for-the-play-framework/</guid><description>&lt;p>Two months ago we started using the &lt;a href="http://www.playframework.org">Play! framework&lt;/a> for our work at &lt;a href="http://www.oxiras.com">Oxiras&lt;/a> (as I am writing these lines, the Oxiras website is still totally empty, this should change soon however).&lt;/p>
&lt;p>As we started making UI tests using the excellent integration with the &lt;a href="http://seleniumhq.org/">Selenium&lt;/a> test runner, we quickly noticed that also having an integration with the &lt;a href="http://seleniumhq.org/projects/ide/">Selenium IDE plugin&lt;/a> would make our lives much easier. So I looked a bit around, found that creating a Selenium IDE formatter was not all too hard and &lt;a href="http://manuelbernhardt.github.com/play-selenium-plugin/">here we go&lt;/a> with what I can call my first Firefox plugin.&lt;/p></description></item><item><title>Information Retrieval</title><link>https://manuel.bernhardt.io/2011/02/11/information-retrieval/</link><pubDate>Fri, 11 Feb 2011 11:58:17 +0100</pubDate><guid>https://manuel.bernhardt.io/2011/02/11/information-retrieval/</guid><description>&lt;p>This morning I spent some time looking for information on how to deploy a legacy webservice on Apache Karaf.&lt;/p>
&lt;p>This post isn&amp;rsquo;t about Karaf and OSGi and webservices though, but a reflection on how to efficiently find information that can lead towards a specific technical problem on the Internet. For quite some time now I feel that this task has become much more complicated in the past 2-3 years than it used to.&lt;/p></description></item><item><title>Deploying a GWT application as OSGi module with Apache Karaf and Maven</title><link>https://manuel.bernhardt.io/2010/12/15/deploying-a-gwt-applicatio-as-osgi-module-with-apache-karaf-and-maven/</link><pubDate>Wed, 15 Dec 2010 15:20:14 +0100</pubDate><guid>https://manuel.bernhardt.io/2010/12/15/deploying-a-gwt-applicatio-as-osgi-module-with-apache-karaf-and-maven/</guid><description>&lt;p>In a project I&amp;rsquo;m currently working on we use the OSGi platform in order to achieve higher modularity (the project is about building a framework for massive data ingestion and processing for a high-availability service, and the processing is dealt with via workflows that are composed of a number of plugins that we don&amp;rsquo;t develop, hence the need for modularity).&lt;/p>
&lt;p>We use the &lt;a href="http://karaf.apache.org/" target="_blank">Apache Karaf&lt;/a> framework, which offers neat extension points and means to customize it. One of the nice features is the &lt;a href="http://felix.apache.org/site/apache-felix-web-console.html">WebConsole&lt;/a> that can also be extended, which would provide the means to add a GUI for the users. However, this happens through providing a Servlet implementation, which isn&amp;rsquo;t really handy these days when wanting to develop a bit more complicated GUIs.&lt;/p></description></item><item><title>Debugging ANT tasks in IntelliJ IDEA</title><link>https://manuel.bernhardt.io/2010/09/08/debugging-ant-tasks-in-intellij-idea/</link><pubDate>Wed, 08 Sep 2010 20:14:20 +0200</pubDate><guid>https://manuel.bernhardt.io/2010/09/08/debugging-ant-tasks-in-intellij-idea/</guid><description>&lt;p>I recently started using &lt;a href="http://www.jetbrains.com/idea/">IntelliJ IDEA&lt;/a> in addition to &lt;a href="http://eclipse.org/">Eclipse&lt;/a> after seeing it being used by some dutch colleagues of mine. And I must say that I do like it more and more every day — it just has all these many little things that fill so well to Java.&lt;/p>
&lt;p>One thing I do miss though is the ability to debug ANT tasks. In Eclipse, you can make an external launcher, select one or more targets, and run them in debug mode. With IDEA, that just doesn&amp;rsquo;t seem to work. I did install the &lt;a href="http://plugins.intellij.net/plugin/?idea&amp;amp;id=4526">ANT debugger plugin&lt;/a> which makes it possible to debug through the build file, but that&amp;rsquo;s not still what I wanted.&lt;/p></description></item></channel></rss>