Deploying and running Docker containers on Marathon

Last article I explained how you can build your Mesos infrastructure, so, from here I'd assume you have it working already. First of all, we are going to build a simple application. It is going to be a Java application running on a Docker container, but, you can deploy whatever you want. build.gradle buildscript { repositories { jcenter() } dependencies { classpath 'com.github.rholder:gradle-one-jar:1.0.4' } } apply plugin: 'java' apply plugin: 'gradle-one-jar' repositories { jcenter() } task uberJar(type: OneJar, dependsOn: build) { mainClass = 'hello.marathon.Main' archiveName = 'hello-marathon-all.jar' } dependencies { compile 'com.…

Keep reading

Building a Microservice Infrastructure using Mesos, Marathon and Zookeeper

This post will be the first of a "series" that I'm planning about an infrastructure for Microservices. First of all, a few concepts: According to their web site, Mesos is a distributed systems kernel. Mesos abstracts every machine resource of a cluster to build a "super computer", exposing it as an unique resource pool. Marathon, in the other hand, is a resource manager that runs on top of Mesos. Using Marathon you will be able to deploy containers and applications into a Mesos cluster. Zookeeper is…

Keep reading

The basic you should know before building your REST api

There is no recipe to build a REST api, but, there are a lot of good practices that could be followed, so, I gathered the most used and well accepted practices that you should know before building yours. Index Most commonly used HTTP methods GET POST PUT PATCH DELETE Most commonly used HTTP status Don't use verbs in the resource uri Always use JSON as the content-type Envelop your response Make client-side errors well explained in the response Support versioning, but avoid to use it Support async and callback operations…

Keep reading

Configuring multiple datasources using SpringBoot and Atomikos

Since I didn't find any article explaining how to use the auto configuration to configure Atomikos on SpringBoot, I decided to write this post. I hope it can be useful to someone. ;) Dependencies Assuming you are developing a web application and want to use Atomikos to provide distributed transactions over multiple datasources, you will need only two dependencies: def springBootVersion = 'YOUR_SPRING_BOOT_VERSION_HERE' compile group: 'org.springframework.boot', name: 'spring-boot-starter-jta-atomikos', version: springBootVersion compile group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: springBootVersion The application.yml If you are using…

Keep reading

Why you should consider using Apache DeltaSpike

We always hear about the Spring vs Java EE fight. Do we always have to use one of them? For sure, they give you a lot of facilities, but, do we need all of those features that they bring with them every time? Well, actually you don't need to choose one of them always. There are a lot of other alternatives that help you build your applications, so, why not take a look at few of them? I'm here to show an alternative called Apache DeltaSpike. Apache DeltaSpike is a…

Keep reading