How to send Docker logs to Google Cloud Logging

In the last weeks we migrated most of our infrastructure to Google Cloud using many of the provided services (Kubernetes Engine, Stackdriver Monitoring, Container Registry, Cloud SQL, …).

Before we used logspout to aggregate all the logs generated in our Docker containers on papertrail. So we were quite happy to see that there is a good log aggregation service included out of the box for applications running on Google Kubernetes Engine (GKE).

Having most of the logs inside of Google Cloud Logging we were wondering if it is possible to ditch papertrail completely and to redirect the log from all our Docker containers to Google Cloud Logging even if they are running on external servers.

Read more →

The Mac Mini is 1,000 Days old now

The Mac Mini Turns 1,000 Days Old Today

Last Wednesday we discussed in our team that we would need another Mac Mini for hosting a zoom room and another Jenkins build node for our iOS projects.

When I looked at the MacRumors Buyer’s Guide it showed that the Mac Mini was not updated for exactly 1000 days - what a coincidence 😉

But it is really sad that there has been no update for the Mac Mini in such a long time. Though Apple recently told the press “The Mac Mini remains a product in our lineup” they are not really supporting that statement by actions.

Read more →

MySQL alter table Geschwindigkeit

Angeregt durch die Diskussion mit Andre in unserer letzten Podcast Episode “Episode 78 – PROD Deployment” habe ich mir ein Testsetup erstellt, um zu prüfen, ob das Hinzufügen von Spalten zu Tabellen mit viel Inhalt in neueren MySQL Versionen wirklich schneller geworden ist. Das Ergebnis ist ziemlich eindeutig JA:

Es sieht also so aus als ob ein Update hier wirklich die erhofften Verbesserung bringen wird. Den Test mit dem pt-online-schema-change habe ich noch nicht durchgeführt, davon erwarte ich mir auch noch Einiges.

Read more →

TypesScript 1.8 Beta

wurde heute hier vorgestellt: Announcing TypeScript 1.8 Beta

Für mich genialstes neues Feature: der TypeScript Compiler compiliert jetzt auch JavaScript. Dadurch kann man alle seine JS Files gleich mit in den Build Prozess geben und dann nach und nach in TS konvertieren.

Außerdem spart man sich die Definition Files (.d.ts) wenn der Compiler die JS Files gleich mit analysieren kann.

Ich glaub ich muss die Beta gleich mal in unserem größten JavaScript/TypeScript-Mix-Projekt testen.

Read more →

Grails 2.2.x and the problem with inner classes

We have been using Grails 2.2.x in some of our projects since it came out last year. Last week when I tried to upgrade another project because it was time to develop some new features I ran into a strange problem after upgrading from 2.1.3 to 2.2.1:

org.codehaus.groovy.grails.web.pages.exceptions.GroovyPagesException: Error processing GroovyPageView: Error executing tag : Error executing tag : java.lang.VerifyError: (class: com/troii/project/tags/SomeTag$Info, method: getSession signature: ()Ljavax/servlet/http/HttpSession;) Incompatible object argument for function call
	at com.googlecode.psiprobe.Tomcat70AgentValve.invoke(Tomcat70AgentValve.java:38)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:722)
Caused by: org.codehaus.groovy.grails.web.taglib.exceptions.GrailsTagException: Error executing tag : Error executing tag : java.lang.VerifyError: (class: com/troii/project/tags/SomeTag$Info, method: getSession signature: ()Ljavax/servlet/http/HttpSession;) Incompatible object argument for function call

I had never seen a java.lang.VerifyError exception before and the second strange thing was that the exception only occured when deploying the war in a tomcat not when starting the app with grails run-app.

Read more →

Java Bean Getters/Setters

Many Java developers think they know everything about Java Beans and the correct getter/setter styles, but there are some hidden traps 😉

Let’s do a little quiz!

How should the correct and getter/setter for a property with the following field look like?

private String name;

This is an easy one:

public String getName() {
  return name;
}

public void setName(String name) {
  this.name = name;
}

Notice that the first letter of the field was made uppercase.

Read more →

Signing Android APK files under JDK7

We are using maven to build our Android applications in Jenkins for testing and for publishing them to the Play Store. Recently I started to have problems with the Play Store saying that the APK files were not signed or not aligned so I upgraded the Android Maven plugin and adapted the pom.xml files. Finally I was able to submit the signed and aligned APK files again to the Play Store – everything fine again, at least I thought so.

Read more →

Spannende Wochen für RIM

Es sind spannende Wochen, die da auf RIM zukommen. In den nächsten Tagen wird RIM ihr neues Betriebssystem BlackBerry 10 und ihre neuen BlackBerry Geräte vorstellen. Die Neuvorstellung repräsentiert für RIM und die Marke BlackBerry quasi einen Neustart in vielerlei Hinsicht.

Das neue Betriebssystem basiert auf QNX, wie bereits das System das auf dem Playbook gelaufen ist. RIM hat das Playbook OS allerdings sehr viel weiter entwickelt, und in BlackBerry 10 wieder die gesamten Funktionen eingebaut, für die BlackBerry bekannt wurde (Synchronisierung von Mail, Kalendar, Kontakten, Todo’s usw.) plus ein paar zusätzlicher Funktionen (z.B. Balance für Work/Private Trennung). Komplett neues Betriebssystem heisst, dass sich alles ziemlich “fluffig” anfühlt – ähnlich wie bei iOS und Windows Phone ist das UI fast verzögerungsfrei, ruckelt nicht und alles ist schön animiert. Komplett neu heisst aber auch, dass sämtliche Anwendungen, die es bisher für BlackBerry gab, neu für BlackBerry 10 geschrieben werden müssen bzw. portiert werden müssen.

Read more →

What to ignore

With the latest improvements we made at troii to our development workflow, we discussed what should be committed to a source code repository and what files should be ignored. We already had the rule in place, that nothing should be put into the repository, that is generated from other sources (typically .class files, .war, .jar, …) – this rule is very common and agreed by almost every developer.

How to handle another set of files usually leads to a lot of discussion: IDE settings, e.g. Eclipse .settings, .project, .classpath or IDEA IntelliJ .iml and .idea directory). Up until a year ago we mainly used Eclipse and I used to store the IDE configuration files in the repository. With switching to IntelliJ and working more with git branches, I startet to think about this again, because I had the feeling that those settings files changed more frequently.

Read more →

Hibernate schema update does not create database indices

In one of my Grails consulting projects we tried to define database indices via the static mapping element in the domain classes. A team member tried it an told me that this does not work so I digged a bit deeper to find out what the problem was.

I created a simple test project, configured hbm2ddl auto to update, like I am used to and let Grails create a MySQL database schema. It seemed lie my colleague was right, the defined indices were not created (using Grails 1.3.7). Doing some web research brought up this Stackoverflow posting suggesting that indices are only created when hbm2ddl auto was set to create (or create-drop) - which seemed to be the case.

Read more →