AWS CodeStar and Cloud Formation Parameterization

I’m in the process of getting familiar with AWS and Serverless architecture and thought I’ll share some basics with you. I have created a sample project using AWS CodeStar that utilizes Python and AWS Lambda. When analyzing the buildpsec.yml and template.yml I found that in template.yml you don’t have any CodeUri location that would point to the artifact used by Lambda. At the same time in buildspec.yml you can find following command:...

November 16, 2018 · 2 min

AWS Lambda Local Invocation Using SAM Local and Localstack

The biggest struggle I had in my mind when thinking about serverless and AWS itself was - how the hell to properly test it and create development environment? There is no way to hit production without properly and in easy way testing all parts of AWS services. I could identify 2 biggest players in this area: “delivered by AWS directly - SAM Local (abbreviation of Serverless Application Module) with its local option,” “localstack with its large set of docker images for AWS services....

November 16, 2018 · 3 min

Jackson JSON Processor for Payara JAX-RS serialization/deserialization

Want to use Payara / Glassfish with JAX-RS and Jackson to serialize/deserialize objects to/from JSON? Pay extra attention as it might bite you as it had bit me. I was more than sure that Payara is using Jackson as JSON processor (I’ve checked pom.xml dependencies of Payara and found that Jackson 2.5.1 is defined there). Therefore, I started using all those nice @JsonProperty or @JsonAutoDetect annotations while scratching my head why is Payara ignoring them but still did “some” serialization using some defaults, i....

January 31, 2017 · 2 min

Prepare Your Application for Slow Network Connection

Some time ago I started to play with AngularJS to create a simple side-project app. During this work I realized that I don’t like the differences between how the application works depending on the environment where I deploy it (localhost - faster and Docker on VPS - slower). The UX was quite poor for slower network connection and I decided to do something about that. The user experience was increased by applying some simple rules like:...

January 11, 2017 · 3 min

Keycloak on Docker with Nginx SSL proxy

JBoss Keycloak is available as a Docker image. It’s all fun and games until you’ll try to run it behind SSL reverse proxy like I do for all my services. Despite settings all required HTTP headers on the proxy side (Nginx in my case) like: proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; it fails to pass all the requests to the Docker Keycloak image (running on Wildfly server)....

January 9, 2017 · 2 min

How Obeying to TDD Saved me Time

Obeying to the TDD (Test Driven Development) saved me a lot of time so I decided to write about it. It nicely shows the real-life advantage you can get from following TDD. Now, to keep it short - few days ago I was writing some business logic that did some audit recording changes. For the sake of brevity imagine it was something between those lines: public void recordAudits(Data data) { if (data....

January 8, 2017 · 2 min

Boolean methods and variables

When you have some non-trivial boolean statement used in if like: private void evict(Data data) { // ... if (data.getDate() >= MATURITY_DATE && data.type == DataType.UNDEF) { // do the eviction } } To make it easier to read and maintain, it’s a good idea to extract it to a local variable or method: private void evict(Data data) { // ... boolean isEligibleForEviction = data.getDate() >= MATURITY_DATE && data.type == DataType....

July 20, 2016 · 3 min

New blogging platform

I’ve finished the migration process of my blog. I’ve decided to get rid of the Wordpress, as I was not using even 20% of its features and, moreover, it felt a bit too heavy for my needs. I’ve decided to give Jekyll a try and therefore moved to the static website generation. It should save a lot of bandwidth and time for each post to load. It is also more simple (not to say ascetic) when it comes to the graphics and colors....

June 22, 2015 · 1 min

IntelliJ IDEA Working Directory

When you’re switching from one IDE to another, even if the codebase is the same, some differences might occur. This happens e.g. when using relative paths. Assume you have a multi-module Maven project with a structure somewhat like below: +—myApp | \—myApp.component | \—myApp.component.business Trying to execute in IDE the following code present in the myApp.component.business: private final String POM_PATH = "pom.xml"; // ... PomEquippedResolveStage Maven.configureResolver() .workOffline() .loadPomFromFile( POM_PATH ); In Eclipse, by default, it will load the pom....

September 26, 2014 · 1 min

Quick Glance at JArchitect

Few months ago Dane from JArchitect team was kind enough to provide me with a license for JArchitect 3.1.0 Professional Edition, a multiplatform (GNU/Linux, Mac, Windows) software for static code analysis. While I was really swamped with my every-day work (and personal life) I didn’t have really much time to take a closer look at it that time. Few days ago I’ve said to myself ’that’s enough’ and X-rayed one of our company projects using JArchitect....

August 18, 2013 · 7 min