Home » Java (page 30)

Java

Understanding H2 InMemory Database with Spring Boot

spring-interview-questions-answers

Introduction Basically the database setup involves several steps before we can use it through configured datasource in our application. This actually is required in case of actual project implementations. However, there are situations where we just need a POC to be done for something, and the whole database setup thing still becomes an obligation. Similarly, for unit tests, it would ...

Read More »

Spring Boot Microservices , Docker and Kubernetes workshop – part2

In the previous post we created our first micro service “ProductService” using SpringBoot and Docker. In this part we will go into details of how to manage multiple microservices using Spring Cloud, netflix libraries, API gateways . For our order management system, let’s say,  a minimal relationship could be something like this : So, let’s build 2 more services called “orderService” ...

Read More »

Behavioural Design Patterns: Mediator

Previously we had a look at the iterator pattern. The mediator pattern is way different on what it tries to achieve. It is one of the behavioural patterns and its purpose is to alter the way objects communicate with each other. Instead of the objects communicating with each other directly the mediator will handle the objects interaction. For example imagine ...

Read More »

Build a RESTful API in Go using AWS Lambda

java-interview-questions-answers

In this post we will learn to design, build, and deploy a RESTful API in Go using AWS Lambda. Before starting, let me give you a brief introduction about AWS Lambda. What is AWS Lambda? AWS Lambda is a serverless compute service that runs our code in response to events and automatically manages the underlying compute resources for us. We can use AWS Lambda ...

Read More »

Java optional parameters

When you design a method in a Java class, some parameters may be optional for its execution. No matter it is inside a DTO, a fat model domain object, or a simple stateless service class, optional method parameters are common. From this article you will learn how to handle optional parameters in Java. We’ll focus on regular method, class constructors ...

Read More »

In any incomprehensible situation go scripting

spring-interview-questions-answers

Scripting is one of the most popular ways to make your application adjustable for client needs right at runtime. As always, this approach brings not only good, e.g. there is a well-known trade-off between flexibility and manageability. This article is not one of those which theoretically discuss pros and cons, it practically shows different ways of how to adopt scripting ...

Read More »

J2Pay – Complete Example

java-interview-questions-answers

Introduction In this section we will be looking in great detail of how to use a gateway and invoke all four methods successfully i.e. purchase, refund, void and rebill. For this example we will be using Authorize gateway. Let’s begin. First of all we will get the Authorize gateway object. Gateway gateway = GatewayFactory.getGateway(AvailableGateways.AUTHORIZE); But what if you would like ...

Read More »

J2Pay – API Responses

java-interview-questions-answers

Introduction The magical thing in this library is its unique responses no matter whatever gateway is. Once you understand API responses it will be easy for you to use this response for further transactions i.e. refund, void or rebill. First of all as we read in the beginning all responses are JSON. All responses are divided into two json keys. ...

Read More »

J2Pay – Getting Started

Getting started will guide you how to start using J2pay quickly in very simple steps. Download J2Pay is available on maven. <dependency> <groupId>com.tranxactive</groupId> <artifactId>j2pay</artifactId> <version>2.4.0</version> </dependency> You can also download the jar file here Example In this example we will execute Purchase and Rebill transactions. First we will get the desired gateway i.e Authorize Gateway gateway = GatewayFactory.getGateway(AvailableGateways.AUTHORIZE); Since we ...

Read More »