Java Code Geeks » Adam Warski http://www.javacodegeeks.com/ Java 2 Java Developers Resource Center Fri, 27 Feb 2015 20:00:31 +0000 en-US hourly 1 http://wordpress.org/?v=4.1.1 In today’s post-OO world, is dependency injection still relevant?http://www.javacodegeeks.com/2015/02/in-todays-post-oo-world-is-dependency-injection-still-relevant.html http://www.javacodegeeks.com/2015/02/in-todays-post-oo-world-is-dependency-injection-still-relevant.html#comments Fri, 27 Feb 2015 14:00:25 +0000 http://www.javacodegeeks.com/?p=37464 It’s 2015. Most of the new popular languages are more or less functional. The old ones, like Java, gain functional programming elements. In Scala, people are increasingly leaning towards the pure side, using more FP and less OO. So – Dependency Injection? Really? You could say that DI is just using (constructor) parameters. I’m saying […]

 

]]>
http://www.javacodegeeks.com/2015/02/in-todays-post-oo-world-is-dependency-injection-still-relevant.html/feed/ 0
Clustering reactmq with akka-clusterhttp://www.javacodegeeks.com/2014/11/clustering-reactmq-with-akka-cluster.html http://www.javacodegeeks.com/2014/11/clustering-reactmq-with-akka-cluster.html#comments Fri, 07 Nov 2014 08:00:23 +0000 http://www.javacodegeeks.com/?p=32661 In the last two posts on reactmq, I described how to write a reactive, persistent message queue. The queue has the following characteristics:                   there is a single broker storing the messages, with potentially multiple clients, either sending or receiving messages provides at-least-once-delivery; receiving a message blocks […]

 

]]>
http://www.javacodegeeks.com/2014/11/clustering-reactmq-with-akka-cluster.html/feed/ 0
Making the Reactive Queue durable with Akka Persistencehttp://www.javacodegeeks.com/2014/07/making-the-reactive-queue-durable-with-akka-persistence.html http://www.javacodegeeks.com/2014/07/making-the-reactive-queue-durable-with-akka-persistence.html#comments Mon, 07 Jul 2014 19:00:59 +0000 http://www.javacodegeeks.com/?p=27405 Some time ago I wrote how to implement a reactive message queue with Akka Streams. The queue supports streaming send and receive operations with back-pressure, but has one downside: all messages are stored in-memory, and hence in case of a restart are lost. But this can be easily solved with the experimental akka-persistence module, which […]

 

]]>
http://www.javacodegeeks.com/2014/07/making-the-reactive-queue-durable-with-akka-persistence.html/feed/ 0
Evaluating persistent, replicated message queueshttp://www.javacodegeeks.com/2014/07/evaluating-persistent-replicated-message-queues.html http://www.javacodegeeks.com/2014/07/evaluating-persistent-replicated-message-queues.html#comments Sat, 05 Jul 2014 12:00:36 +0000 http://www.javacodegeeks.com/?p=27277 Message queues are useful in a number of situations; for example when we want to execute a task asynchronously, we enqueue it and some executor eventually completes it. Depending on the use case, the queues can give various guarantees of message persistence and delivery. For some use-cases, it is enough to have an in-memory message […]

 

]]>
http://www.javacodegeeks.com/2014/07/evaluating-persistent-replicated-message-queues.html/feed/ 2
Benchmarking SQShttp://www.javacodegeeks.com/2014/06/benchmarking-sqs.html http://www.javacodegeeks.com/2014/06/benchmarking-sqs.html#comments Sun, 29 Jun 2014 12:00:18 +0000 http://www.javacodegeeks.com/?p=27072 SQS, Simple Message Queue, is a message-queue-as-a-service offering from Amazon Web Services. It supports only a handful of messaging operations, far from the complexity of e.g. AMQP, but thanks to the easy to understand interfaces, and the as-a-service nature, it is very useful in a number of situations. But how fast is SQS? How does […]

 

]]>
http://www.javacodegeeks.com/2014/06/benchmarking-sqs.html/feed/ 0
Cluster-wide Java/Scala application deployments with Docker, Chef and Amazon OpsWorkshttp://www.javacodegeeks.com/2014/06/cluster-wide-javascala-application-deployments-with-docker-chef-and-amazon-opsworks.html http://www.javacodegeeks.com/2014/06/cluster-wide-javascala-application-deployments-with-docker-chef-and-amazon-opsworks.html#comments Sun, 15 Jun 2014 22:00:22 +0000 http://www.javacodegeeks.com/?p=26559 Docker is great for running isolated containers on a single node. However, most software systems run on multiple nodes, so in addition to Docker, we need some way of specifying which containers should run on which nodes. The specific problem that I want to solve is the following: I have two Scala daemons, which I […]

 

]]>
http://www.javacodegeeks.com/2014/06/cluster-wide-javascala-application-deployments-with-docker-chef-and-amazon-opsworks.html/feed/ 0
Reactive Queue with Akka Reactive Streamshttp://www.javacodegeeks.com/2014/06/reactive-queue-with-akka-reactive-streams.html http://www.javacodegeeks.com/2014/06/reactive-queue-with-akka-reactive-streams.html#comments Wed, 11 Jun 2014 13:00:13 +0000 http://www.javacodegeeks.com/?p=26403 Reactive streams is a recently announced initiative to create a standard for asynchronous stream processing with built-in back-pressure, on the JVM. The working group is formed by companies such as Typesafe, Red Hat, Oracle, Netflix, and others. One of the early, experimental implementations is based on Akka. Preview version 0.3 includes actor producers & consumers, […]

 

]]>
http://www.javacodegeeks.com/2014/06/reactive-queue-with-akka-reactive-streams.html/feed/ 0
Big data: when single node is better than clusteredhttp://www.javacodegeeks.com/2014/03/big-data-when-single-node-is-better-than-clustered.html http://www.javacodegeeks.com/2014/03/big-data-when-single-node-is-better-than-clustered.html#comments Sat, 08 Mar 2014 13:00:51 +0000 http://www.javacodegeeks.com/?p=22546 There’s a lot of hype about “big data” and a general trend to try to apply Hadoop to almost every problem. However, sometimes it turns out that you can get much better results by writing an old-fashioned, but optimised, single-node version of your algorithm. The specific case I’m writing about is generating recommendations (what items […]

 

]]>
http://www.javacodegeeks.com/2014/03/big-data-when-single-node-is-better-than-clustered.html/feed/ 0
Using Scala traits as modules, or the “Thin Cake” Patternhttp://www.javacodegeeks.com/2014/03/using-scala-traits-as-modules-or-the-thin-cake-pattern.html http://www.javacodegeeks.com/2014/03/using-scala-traits-as-modules-or-the-thin-cake-pattern.html#comments Sat, 01 Mar 2014 13:00:56 +0000 http://www.javacodegeeks.com/?p=22202 I would like to describe a pure-Scala approach to modularity that we are successfully using in a couple of our Scala projects. But let’s start with how we do Dependency Injection (see also my other blogs). Each class can have dependencies in the form of constructor parameters, e.g.:             class […]

 

]]>
http://www.javacodegeeks.com/2014/03/using-scala-traits-as-modules-or-the-thin-cake-pattern.html/feed/ 0
Using JavaCV with Scala and SBThttp://www.javacodegeeks.com/2014/02/using-javacv-with-scala-and-sbt.html http://www.javacodegeeks.com/2014/02/using-javacv-with-scala-and-sbt.html#comments Fri, 07 Feb 2014 05:00:41 +0000 http://www.javacodegeeks.com/?p=21269 Recently I’ve been doing some simple face detection in a Scala-based project. The “industry standard” for such kind of tasks is OpenCV; face detection is one of its basic use-cases.                 However OpenCV is written in C/C++, so obviously to use it from Scala a JVM interface is […]

 

]]>
http://www.javacodegeeks.com/2014/02/using-javacv-with-scala-and-sbt.html/feed/ 0