Category Archives: Web

Spring Boot & Angular 5 PWA Dev Environment Setup

Spring Boot Angular App Development Environment

In this post, you will learn about how to quickly create development environment to build an app using Spring Boot and Angular 5. Angular 5 app and Spring Boot is deployed as one single unit on Tomcat server. The following points are covered: Create a Spring Boot Spring Starter Project Create an Angular Service Worker Project Modify POM.xml for Copying Angular App Assets Create a deployment script for automated build and deployments Create a Spring Boot Spring Starter Project Within Eclipse IDE, create a Spring Starter Project for sample Spring Boot app. You may download to SpringSuite Tool Suite (STS) from Eclipse marketplace to have options such as Spring starter …

Continue reading

Posted in AngularJS, Java, Web. Tagged with , , , .

How-to Tutorials for Spring Security OAuth2 & REST API

spring security oauth2 and rest api

In this post, I have listed down some of the top pages which I came across while doing exploring implementation for Spring Security OAuth2 for REST APIs based apps. This page will be updated with good links in time. Secure a Spring Boot REST API With JSON Web Token + Reference to Angular Integration This one is very helpful (by-far-the-best) for developers doing Angular App on the client side and Spring Boot app on the server side. Really a great step-by-step tutorial. Kudos to Author, Nouhoun Y. Diarra. Covers some of the following topics. Github project can be found on this page. Configure spring security Configure authorization server Configure resource server …

Continue reading

Posted in Application Security, Java. Tagged with , , .

Elasticsearch Interview Questions & Answers – Set 1

elasticsearch interview questions and answers

In this post, you will learn about fundamentals and best practices with ElasticSearch based on the following: Revision notes on Elasticsearch fundamentals A set of questions to test your knowledge and, in turn, help you learn Elasticsearch concepts related to index and shards; These questions could as well help you prepare for interviews related to ElasticSearch A set of interview questions ElasticSearch Fundamentals – Revision Notes Each Elasticsearch shard is a Lucene index The number of shards and replicas can be defined per index at the time of creation of the index. The number of replicas per shard can later be changed. Shard in ElasticSearch is primarily a Lucene index …

Continue reading

Posted in ElasticSearch, Interview questions, Java. Tagged with , , .

How to Create AWS Lambda Deployment Jar using Maven

how to create AWS Lambda Deployment Jar file

One of the key aspects of AWS Lambda Function in Java is creating deployment package (jar or zip file) for uploading/deploying on AWS Lambda service. In this post, you will learn about different ways in which you could create a Deployment Jar file for deploying it as AWS Lambda project using Maven. The following are different ways: Deployment jar using Maven and Eclipse IDE Deployment jar using Maven and command prompt I recommend using Maven and commmand prompt technique for creating deployment jar package. Before getting started, download AWS Toolkit for Eclipse from Eclipse Marketplace. Here is the information on getting setup with AWS Toolkit for Eclipse Deployment jar using …

Continue reading

Posted in AWS, Java. Tagged with , , .

ElasticSearch Create, Query, Delete Index – Java Example

Elasticsearch Create Delete Search Index Java Example

ElasticSearch Java APIs can be used to create, update, query (retrieve items) and delete the index. In this post, you will learn about using Java APIs for performing CRUD operations in relation with managing indices and querying items in ElasticSearch. Create an empty index with data type mapping Create/update the index using BulkRequest APIs Search Index using QueryBuilder and SearchRequestBuilder APIs Delete the index Create an Empty Index with Data-type Mapping Create/Update the Index using BulkRequest APIs Pay attention to some of the following: Create an instance of TransportClient Prepare bulk request for inserting multiple entries in index Delete the Index Pay attention to some of the following: Create an …

Continue reading

Posted in ElasticSearch, Java, Search. Tagged with , .

ElasticSearch Fuzzy Query Example in Java

elasticsearch fuzzy query in Java

ElasticSearch fuzzy query can be used in scenarios when the user searches with mistyped keywords or misspellings. Alternatively, it can also be used for performing the search for similar words based on Levenshtein Edit Distance, which can be defined as the minimum number of single-character edits (insertions, deletions or substitutions) required to change one word into the other. In this post, Fuzzy Search using ElasticSearch Java API is demonstrated. Some of the following points are covered: Getting Setup with ElasticSearch and Kibana ElasticSearch Library POM Entries Using Fuzzy Query API for fuzzy search Using Match Query API for fuzzy search Using Bool Query API for Fuzzy Search Getting Setup with …

Continue reading

Posted in ElasticSearch, Java, Search. Tagged with , .

Spring Boot JPA MySQL Sample App – Code Example

spring boot jpa mysql code example

Creating a Spring Boot app with MySQL data source is something every Java developer come across when thinking of creating a quick POC or app. This post is aimed to provide quick code samples which can be used to quickly create a MySQL-based Spring boot app. In this post, you will learn about code examples in relation to getting setup with Spring Boot app which interacts with MySQL database. The following are some of the topics covered: Define properties in application.properties file Create/Configure Database-related Beans Create Entity Classes (Domain) Create Database Implementation Classes (DAOs) Define Service Classes for interacting with Data Access Objects Invoke service class from SpringBoot main program …

Continue reading

Posted in Java, Web. Tagged with , , .

AWS DynamoDB PutItem Java Example to Create Items

dynamodb putitem example in Java

In this post, you will learn about Java code example related to creating an entry in the DynamoDB table using PutItem API. The following are some of the points considered later in this article: Configure Dev Environment with AWS Credentials Update POM.xml or Gradle file to include DynamoDB library Use PutItem API to create an Item in DynamoDB table PutItem API example with Spring Boot app Configure Dev Environment with AWS Credentials Make sure you have configured your dev environment with appropriate Access Key ID and secret access key. You could do that by executing the command such as following: If you have configured it correctly, you should be able …

Continue reading

Posted in AWS, Java. Tagged with , .

Build IVR System using Amazon Polly, Lambda and Twilio

Build IVR with Amazon Polly, S3, Lambda and Twilio

Building an intelligent IVR system with a Bot handling the interaction with your end users and bringing in humans based on pre-defined events would bring a lot of automation and remove mundane manual activities which takes up lot of time for a person. This can be achieved using cloud services provided by cloud providers such as Amazon, Google, Azure etc and communication service providers such as Twilio. In this post, you will learn about how to create or build an intelligent or smart IVR system using some of the following: Use Amazon Polly to create one or more custom text-to-speech audios and store the same at predefined locations in AWS …

Continue reading

Posted in AI, AWS, Java, Tutorials. Tagged with , , .

Amazon Polly Text-to-speech with AWS S3, Twilio Java App

Amazon Polly - S3 - Twilio - Spring Boot - Java

Amazon Polly can be used with Twilio phone service and AWS S3 to create an automated alert system which does (achieves) some of the following: Convert text to speech (using Amazon Polly) Upload audio (speech stream) created using Polly service on AWS S3 bucket Use Twilio Call service to play the audio to the destined phone number The following represents the application architecture diagram (communication flow viewpoint) representing communication between  Spring Boot app and Amazon Polly, Amazon S3 and Twilio Service to achieve automated phone alerts based on text-to-speech conversion. This can be used to create automated alert/notification system around following use cases which makes phone call to concerned personal …

Continue reading

Posted in AI, AWS, Java.

Java Code to Invoke Twilio Rest API to Play Audio

Java and Twilio Rest API for Phone Calls

This post represents sample Java code (example) to demonstrate how to invoke Twilio Rest API to play pre-recorded audio in a phone call made to the users. The code could be used to in some of the following usecase: Alert users via phone call in relation to different kind of critical events such as security issues, production downtime, production issues etc. Play different kind of messages to users in relation to different occasions such as birthdays, anniversaries etc. The code can be used to play audio stored at locations such as cloud platform storage (AWS storage, Google/Azure storage etc.) The key is to provide public access (READ permission) to these …

Continue reading

Posted in Java. Tagged with , .

Twilio & AWS S3 using Java & Spring Boot – Code Example

twilio and AWS S3 with Java and Spring Boot

Twilio is a very popular communication service which could be used to send SMS, make the phone or video calls to people in different countries. In this post, you will learn about creating Java and Spring Boot app in relation to how to use Twilio phone service to make a phone call and play audio stored at AWS S3 bucket. The following are some of the related use cases: Play security and other alerts via phone calls Play messages of any kind via phone calls The following are some of the topics which would be covered in this post: Define VoiceService interface defining APIs Create Twilio Voice Service implementation Load …

Continue reading

Posted in AWS, Java. Tagged with , , , .

AWS Temporary Credentials with Java & Spring Boot

AWS Temporary Security Credentials - AWS STS

AWS Security Token Service (STS) is an Amazon web service which enables you to request temporary, limited-privilege credentials for AWS Identity and Access Management (IAM) users or for users that you authenticate (federated users). By default, the AWS Security Token Service (AWS STS) is available as a global service, and all AWS STS requests go to a single endpoint at https://sts.amazonaws.com. You can optionally send your AWS STS requests to endpoints in any of the AWS regions shown in the table that follows. In this post, you would learn how to use AWS security token service to create temporary security credentials with Spring Boot and Java app. I would recommend …

Continue reading

Posted in AWS, Java, Tutorials. Tagged with , , .

10 Spring Framework Interview Questions for Freshers

Spring framework interview questions for freshers

Spring Framework is one of the most popular and widely used Java frameworks which makes it very easy to create a Java application/web application using several out-of-box framework components provided by Spring. Thus, it is imperative that beginners starting to do Java web app would end up using Spring framework for building the app. From that perspective, it becomes of great importance for beginners to take note of some of the basic concepts related to which interview questions can be asked. In this post, you will learn some of the Spring framework fundamentals concepts which could be asked in form of interview questions and answers. These questions and answers may …

Continue reading

Posted in Career Planning, Freshers, Interview questions, Java. Tagged with , , .

Amazon S3 with Spring Boot & Java – Sample Code

amazon S3 with Spring Boot and Java

Amazon Simple Storage Service (S3) is an AWS object storage platform which helps you to store the files/data in form of objects, and, store and retrieve any amount of data from anywhere – websites and mobile apps, corporate applications, and data from IoT sensors or devices. Each file stored in Amazon S3 (as an object) is represented using a key. The following are some of the usecases where S3 could be used. Thus, it becomes of utmost importance to understand how to interact with Amazon S3 API using AWS SDKs including AWS Java SDK. Backup & recovery Data archiving Big data analytics Disaster recovery Cloud-native application data Hybrid cloud storage …

Continue reading

Posted in AWS, Java, Tutorials. Tagged with , , .

Amazon Polly Hello World with Java & Spring Boot

amazon polly with spring boot and java

Amazon Polly is one cool AWS service which can be used to achieve requirements such as creating business, security alerts via phone call. When integrated with communication providers such as Twilio, several value-added services could be created using Amazon Polly AWS service. In this post, you will learn about creating a sample Java app which uses Amazon Polly service for converting text to speech. You should be able to listen to the following text using the program given below: Hello World! How are you doing? This is Polly. I am happy to talk with you. The following are some of the aspects covered in this post: Create a Spring Boot app …

Continue reading

Posted in AI, AWS, Cloud, Java, Tutorials. Tagged with , , , .