Posts

Setup Local AWS SQS Service with Elastic MQ and Spring Cloud

IntroductionAmazon Simple Queue Service (SQS) is a service on Amazon Web Services that provides a scalable message queuing service for loosely-coupled and reliable communication among distributed software components and microservices. In this article, we will setup a local Elastic MQ service, which will simulate a SQS service and use Spring Cloud to push messages to that queue. With a minimal amount of configuration, this service can be deployed to a EC2 instance and integrate with an actual SQS service.

We will be focusing on the standard SQS queue. The other option, a FIFO Queue is limited to 300TPS(300 transactions per second) and is not a valid use-case for many high-throughput applications.

Characteristics of a Standard SQS Queue
Fully-managed, high throughput messaging queue. Standard queues have nearly-unlimited transactions per second (TPS).

Designed for concurrency with multiple message producers and consumers. Multiple parts of your system can send or receive messages…

Integrate Wiremock into Spring Boot Java Web Application for Mocking External Dependencies

Introduction WireMock is a mock server for HTTP-based APIs. Some might consider it a service virtualization tool or a mock server. It enables you to stub out an API or other external dependency you depend on to expedite local development. It supports testing of edge cases and failure modes that the real API won't reliably produce. It also is useful in mocking out external dependencies in unit and integration tests. It has excellent integration with jUnit.

Add Wiremock Dependency First you will want to add the Wiremock dependency. You can download the regular dependency or the fat JAR stand-alone version that contains all it's dependencies. We will be using the standard dependency here. Add the following dependency to your build.gradle

build.gradle dependencies { testCompile('com.github.tomakehurst:wiremock:2.1.12') }

Add Wiremock Unit test Here is the complete unit test that you can use for testing your integration with Wiremock. This unit test uses a jU…

Error with Gradle Build SonarQube Plugin Registering Findbugs Plugin

Image
How to Fix the Error: Unable to register extension org.sonar.plugins.findbugs.FindbugsConfiguration when Running Gradle sonarqube task

Using Gradle, Sonarqube and Findbugs you may get the following error when you try to execute the command:

./gradlew clean build sonarqube

Here is the error:FAILURE: Build failed with an exception.
* What went wrong:Execution failed for task ':sonarqube'.> Unable to register extension org.sonar.plugins.findbugs.FindbugsConfiguration
* Try:Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Root Cause
This bug seems to occur when there is a mismatch of versions that don't play nice together.

For instance here are the versions of our stack:

Sonar Version: 5.3SonarQube Gradle Plugin:  2.0.1
Update Findbugs plugin on Sonar:
First, we had to update our Sonar server:

Navigate to the Update Center


Update the findbugs plugin and restart the sonar instance

Update your Gradle Dependenc…

Install a Local Instance of AWS DynamoDB

Image
STEP 1:  Press Command+Space and type Terminal and press enter/return key.
STEP 2:  Install Brew(If you don't already have it installed.)  Run this command in the Terminal app.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
Then press enter and wait for the command to finish. STEP 3:  Use Brew to install and download dynamoDB so that you can run it locally. brew install dynamodb-local
Launch your DynamoDB local instance like this:
To have start dynamodb-local now and restart at login as a background service using brew services:   brew services start dynamodb-local Or, if you don't want/need a background service you can just run:   /usr/local/bin/dynamodb-local
You can then access a JS Shell in a browser such as Chrome:
URL to hit the Javascript shell for your locally running DynamoDB instance:
http://localhost:8000/shell/
This is what you will see what you load up your DynamoDB Shell.  If you see…

Suppress FindBugs Warnings in a Java and Spring Boot Web Application using Gradle

Image
How to Suppress FindBugs Warnings using Annotations in a +Spring Boot and +Java Application

If your build is breaking because of a FindBugs issue and it is a false-positive or you are unable to resolve the issue because of other considerations, you can add an Annotation to ignore the Findbugs warning.


Update your Gradle Dependencies
You will want to add the following compile time dependency to your build.gradle file.
compile group: 'findbugs', name: 'findbugs', version: '1.0.0'
dependencies { compile group: 'findbugs', name: 'findbugs', version: '1.0.0'}

Get the Findbugs Issue ID You will need a specific ALL_CAPS identifier so that FindBugs knows what bug to ignore.

Locate the FindBugs Report
In your build message, you will see a link to the findbugs report:
file:///Users/canata/IdeaProjects/projectname/build/reports/findbugs/main.html

You can also find the report in your build artifact.  Right-click and open in your preferred browser to …

Whirlwind Tour of JavaOne and Oracle Openworld 2015

JavaOne 2015 Roundups and Summary Articles

I recently had the wonderful opportunity of attending JavaOne and Oracle Openworld 2015 and have extensively blogged about the social and technical aspects of the conference!
Get a taste of the many events and exhibits on display and an insider's view on the conference.  I will also be presenting the most important takeaways regarding the future direction of Java including an in-depth discussion of changes coming in Java 9 and how to best prepare for those upcoming changes.
If you are local to the Richmond,VA then check out our meetup on the topic!
http://www.meetup.com/Richmond-Java-Users-Group/events/225877596/


JavaOne 2015 Day 1 Roundup
#JavaOne Day 1 roundup: https://t.co/1UpcvxZuIz - Keynote, Welcome event, #jdk9#java 10/11 previews #JavaOne2015pic.twitter.com/NynOszVTuf— Ippon USA (@IpponUSA) October 26, 2015
JavaOne 2015 Day 2 Roundup
#JavaOne Day 2 roundup: Focus on #JDK9 and project #jigsaw - https://t.co/ljYuDMEA49#JavaOne2015#java9pic.…

Running a new jHipster Application using Compass and the main CSS file is not loading

Image
How to fix a Newly Created jHipster Application not Loading the Main CSS File 
If you see an error similar to the following upon first startup of a jHipster application you have just created:

Failed to load resource: the server responded with a status of 404 (Not Found) http://127.0.0.1:8080/assets/styles/main.css




Then you will need to run the grunt task, grunt compass.


Install Compass You will need to first install Compass, an open-source CSS Authoring Framework before you can run the Grunt task to create the main.css file which is missing.
Using node:
npm install compass
Reference the following link for more info about installing compass using npm https://www.npmjs.com/package/compass
Run Grunt Task
After you install Compass, you will then need to run the grunt task.  In in IntelliJ you can click the grunt task runner at the bottom of your screen or go to Tools -> Open Grunt Console.

Restart your Application
Try refreshing and restarting your application and the styling should now…