When you are developing software, you will most likely stumble upon situations where you must perform frequent, but minor, code changes. Changes that do not alter your software’s basic functionality, changes so simple that from a developer’s perspective are more like a different configuration for your code but are still a bit too complex to use a simple configuration file.
In this article I will show you how to use Apache FreeMarker to implement dynamic and complex configurations in Java projects that can be configured from outside the application.
At this year’s [FOSDEM] conference I did a 30 minutes presentation on [Monitoring Legacy Java Applications with Prometheus]. The talk gives an overview of some of the options you have for monitoring Java applications with [Prometheus] when you cannot modify the application’s source code:
The video is available below.
Which programming language should we use to write monitoring check_plugins? This question rose some discussion and this post is trying to give some hints.
Typical Java backend applications need to integrate with existing 3rd party services. In most cases, calls to these 3rd party services are authenticated. Frequently, Java applications are required to use login credentials for authenticated calls: A username and a password.
This scenario raises a problem: How can we store the password needed for calling the 3rd party service? We could store it in a properties file, but then everyone with access to the properties file learns the password. We could provide the password as a command line parameter or environment variable, but then everyone with access to the startup script learns the password. We could hard-code it in our application, but then everyone with access to the JAR file learns the password. We could encrypt the password using a master key, but then we have the same problem again: How to store the master key?
The common solution is to use a secure data store provided by the operating system. Our application runs on Windows Server, so we use the Windows Data Protection API (DPAPI) for protecting our secret passwords. This blog post shows how to use the DPAPI in Java applications.
If you ever needed to request HTTP resources with Java, you probably came across several solutions put together from a surprising number of lines. And you probably ended up with using a third party library to achieve your goal in a reasonable manner.
Good news: besides [Java 9 modules], the next JDK version comes with a brand new HTTP client, and it not only brings support for HTTP/2, but also a sleek and comprehensive API. Let’s have a closer look at the new features.
So, 2017 has arrived - this is the year when Java 9 will finally be released. And with it, the brand new module system called Jigsaw. In January, Marc Reinhold has announced that [JDK 9 is feature complete], so we have every reason to be optimistic that the final release will actually ready in July. So it is about time to get acquainted with project Jigsaw, also known as Java 9 modules.
Eine Konferenz in einem Vergnügungspark? Klang zunächst so ungewöhnlich, wie spannend. Zugegebenermaßen konnten wir uns im Vorfeld auch nicht genau vorstellen, wie so etwas aussehen wird. Und bereits beim Check-In im Hotel wurde klar: Das wird kein rein monotoner Talk-Marathon. Die beiden Hotels, welche von ConSol bezogen wurden, hatten jeweils ein Motto (asiatisch und afrikanisch) und wussten dieses auch für die Gäste, teils sehr detailverliebt, darzustellen. Nachfolgend wollen wir ein paar unserer persönlichen Eindrück schildern:
Jatumba ConSolis! Zwei aufregende Tage gehen zu Ende und was können wir euch berichten? Das JavaLand hat einen super Start in der Welt der Konferenzen hingelegt! Sowohl die Speaker als auch die Atmosphäre ließen keine Zweifel offen, hier entsteht etwas Großes. Neben sieben parallelen Tracks, einem Hacker-Garten und zahlreichen Community-Aktivitäten gab es einen kompletten Freizeitpark zu entdecken.
Slides can be found here: http://rawgithub.com/ConSol/reveal.js/2013-jbossOneDayTalk/index.html.
See you tomorrow!
The last full conference day of the Devoxx was again packed full with very interesting talks of various kind. It started with a keynote about the roadmap of JEE 7. Summarizing we can expect some smooth refinements of the platform (exept maybe the support for virtualization out of the box). Here are our impression on the talks of Thursday. Please expect our summary blog post on monday since we are all now in rush to get out things done and to catch train, plain etc. We hope, you enjoyed the blog flood so far ;-)
If you have ever sent or received mail messages via Java, chances are high that you have used JavaMail for this task. Most of the time JavaMail does an excellent job and a lot of use cases are described in the JavaMail FAQ. But there are still some additional quirks you should be aware of when doing advanced mail operations like adding or removing attachments (or “Parts”) from existing mails retreived from some IMAP or POP3 store. This post gives a showcase for how to remove an attachment from a mail at an arbitrary level which has been obtained from an IMAP store. It points to the pitfalls which are waiting and shows some possible solutions. The principles laid out here are important for adding new attachments to a mail as well, but that’s yet another story.