Posts

Showing posts with the label Spring Boot

Making REST Calls Retryable in Biking Weather Suitability Forecast Application

One frustration I had noticed with my Biking Weather Suitability Forecast Application was that I found it often would not show results until I reloaded the page, and a look at the application logs showed that the REST calls to one of the APIs called had failed or timed out. After doing some research into using Spring's Retryable options for methods, I decided to make the DailyReportCollectionService method getCurrentDailyReports() retryable, so that it would be attempted a second time after a one second pause if the first try didn't succeed in returning complete data, with a third and final attempt made as the " Recover " option. First, I added the following two required dependencies to the dependencies section of the application's pom.xml file. <dependency> <groupId>org.springframework.retry</groupId> <artifactId>spring-retry</artifactId> </dependency> <dependency...

Website FINALLY Adapted to Apple Silicon

Back in March, I took advantage of a sale at Costco, advanced the inevitable update, and bought a blue-colored iMac. With its Apple M1 chip , after reinstalling essential packages using Homebrew , I had to make multiple changes to the Apache and Tomcat server configurations to allow my website, and the Tomcat server serving the biking weather suitability forecast application, to work properly again. Since these explorations - including a dead end trying to switch from using Apache to Nginx for the web server, given what seems to be the trend and the latter's apparent strength being reverse proxy work - were done very sporadically, it took me until this month finally to get it right. One thing I am glad I did relatively early in the process was to make the new configuration folders git repositories, so I could review the history of document changes and, more importantly, reverse them if needed. This was done using the following steps for the Apache (httpd) folder: cd /...

A Simple Example of Using Spring Aspect Oriented Programming to Log the Beginning and End of All Methods in All Classes in a Package

I have often seen, in development work, certain types of code fragments that get repeated many times throughout the code, which would seem a prime use case for Aspect Oriented Programming (AOP). I thought I would try creating an aspect to do debug logging in my Biking Weather Suitability Forecast application as follows: Do the following debug logging items for all methods in all classes in the biz.noip.johnwatne.bikingweather.service package. Log the start of a method's execution, including the name of the method and listing the parameters passed to it. For methods that return an Object or value, log the item returned. For void methods, indicate the end of the method's execution. Allow toggling the enabling of the aspect's code based on the value of a property in the application's properties file. This allows temporarily enabling the logging while testing new development, then disabling it, or, alternatively, having environment-specific properties files that woul...

Sunrise and Sunset Times Added to Biking Weather Suitability Forecast App

Although it is pretty much the end of the biking season for the year as I write this, I have added an upgrade to my Biking Weather Suitability Forecast app: the sunrise and sunset times for the location. For now, this means Richfield, Minnesota. Perhaps someday I will get to making the app more customizable for the user.

My Biking Weather Suitability Forecast Web App

I have added a new page for my new " Biking Weather Suitability Forecast Web App ". Find more information about the app at the page; for now, it is hard-coded to focus on suitability using hard-coded criteria and for Richfield, Minnesota, only. The forecasts can probably be considered "close enough" for the rest of the Twin Cities metro area.