Use Jersey and Spring in AWS Lambda

AWS Lambda is actually made to be used by implementing small functions which can be started quickly. So your code artifact should be as small as possible for a fast startup time. However, in the Java world there are nice frameworks like Jersey and Spring which can help you writing code for an API a lot! Unfortunately these frameworks can take up to a few MB and blow up your artifact, but you might have your reasons to use them in AWS Lambda, e.g. because you’re migrating an existing project to AWS Lambda. So let’s see, how you can use Jersey and Spring together in AWS Lambda! The code can be found in my GitHub repository lambda-jersey-spring-example.

Continue reading

Starter Projects For AWS Lambda Using NodeJS And Java

Today I want to show you three starter projects for AWS Lambda using CloudFormation and SAM – Serverless Application Model. I always like if I have some boilerplate code and can get started quickly without copying code or project structures from an existing (and mature) project. Therefore I thought it’s good to have them in one repository. You can find them on GitHub. The projects can be used for NodeJS and Java. Also one project contains both: usage of Java and NodeJS Lambdas in one CloudFormation template.

Continue reading

Fast AWS Lambda Code Updates And Improved Lambda Logs

This year I’ve started working with Amazon Web Services (AWS) and most notably AWS Lambda. It’s awesome what Amazon is providing here! It’s cheap, easy to start with when using SAM – Serverless Application Model and easy to integrate with other services. But there are also downsides (which were also discussed a lot on HN). Just to name a few: a) logging is a mess, b) debugging is not possible at all or c) CPU power only comes with more memory. Though I can’t change b) and c), I could do something for a). Furthermore it was also a pain for me to update the Lambda code quickly, because I am using CloudFormation. A CloudFormation update takes a lot of time and summed up to 2:30 min for every update in my case – not acceptable for just changing one line of code. Therefore I decided to write some small CLI tools to overcome the logging problem and code updates with AWS Lambda.

Continue reading

Set up JMapViewer for OSM data

Recently I had to work with OSM data at University and we had to provide the data by visualising them with JMapViewer. It’s a small project which supports you to connect your OSM data with a Java Swing application. For example this is useful for user interactions when calculating routes with OSM data. So I started investigating the project and found their documentation: It just gives a quick overview of the project, but no nice starting guide. Therefore I want to provide such a (short) tutorial here.

Continue reading

Deploy a Multi-Module Maven Project to Heroku

Recently I was building a private hobby project where I wanted to use Heroku to deploy some Microservices and get some experience with it. Since I’m a Java enthusiast, I wanted to use a Multi-Module Maven project to also share some classes to the different microservices. So my mission was to deploy each submodule to a different Heroku app (I know this is completely against the nature of Microservices to code them all in the same language and have them in one big project like a Monolith – but I have my reasons). Getting started with Heroku was quite simple, because they have a very nice guide to setup and run your first app in the cloud. Unfortunately Heroku only supports one Procfile per project, therefore it’s not so easy to deploy multiple submodules to it. But there is way: You can use Config Variables. Let’s see step by step how to use this!

Continue reading

How to test a web app with popups using Selenium

Some time ago I had to test a web app where a popup was triggered if the user hovers over a specific link. This is not as easy as testing if an element contains a specific text. But it’s possible using Selenium Actions. These class provides methods to perform some custom gestures on a page, like moving to an element. Here is an example how to do this: Continue reading

Using AngularJS and Spring together

With this blog post I want to provide an example webapp using Spring and AngularJS since both are very popular technologies. The webapp is created using Spring Initializr, Spring Boot and an example AngularJS project. It’s a step-by-step tutorial with some explanations. The repository can be found in this repository:

Continue reading

Add Spring to JavaFX

Yesterday I wanted to add Spring to my Pandoc project and I had a lot of trouble with it. My problem was that I wanted to split my FXML files into multiple files and make each file controlled by a separate controller. This is – without Spring – not a real problem, because you just create your controller classes, add fx:controller=”YourController” to each FXML file and everything’s fine. But problems arise if you now want to have some objects to be autowired by Spring. I read a lot of tutorials about the topic, but every tutorial just showed the problem if you have only one main controller for your root FXML file. By the way this and this are nice tutorials to get in touch with the problem.

Continue reading

First steps with JavaFX

Today I want to write about my first steps with JavaFX and try to go through my first application step by step. I only provide some examples and in this case it’s not a copy-and-run example! You must read the documentation which is mentioned below. In order to see the full code of the application, browse the sources in my GitHub project:

This week I had a small problem: I had to convert some wiki pages from a GitHub project from markdown format to another format like *.docx. So, I remembered a friend told me a few weeks ago about Pandoc which can convert a lot of documentation formats to a lot more of documentation formats. I gave it a try: searched for “Pandoc download” and found an installer for Windows. Unfortunately I’m a person who prefers GUIs, thus I was a little bit disappointed as I realized that I had to use the console for conversion. But after converting I was fascinated that it worked pretty well and fast, I only had to do a few changes, because if you want to convert multiple input files, Pandoc merges all input files together to one file. A few hours later I decided to create a GUI and started a JavaFX project.

Continue reading