Shared info of IoT & Cloud, Banking, Angular Wicket, Spring Reactive, AI, Flutter, E-comm, Java Telecomm and More.

Monday, July 6, 2020

Doing microservices with JHipster

Today many companies are developing applications using Microservices, and Microservices with spring boot is chosen by many big companies in Vietnam.
In JHipster framework, Microservices is also supported. JHipster is a free and open-source application generator used to quickly develop modern web applications and Microservices using Angular or React (JavaScript library) and the Spring Framework.

Some technologies and tools are:

  • Yeoman, a front-end scaffolding tool
  • Spring Boot
  • Angular 8, ReactJS: frontend Javascript frameworks.
  • Swagger, for API documentation
  • Maven, Npm, Yarn, Gulp and Bower are dependency managers and build tools
  • Jasmine, Protractor, Cucumber and Gatling are test frameworks
  • Liquibase is for database versioning

We need to  install Java 8, Git (version control system), NodeJS, Yeoman, Yarn and may be Gulp and Bower also on the computer.

Microservices vs Monolithic architecture

The first question JHipster will ask you is the kind of application you want to generate. You have the choice between two architecture styles:
  • A “monolithic” architecture uses a single, one-size-fits-all application, which contains both the front-end code, and the back-end Spring Boot code.
  • A “microservices” architecture splits the front-end and the back-end, so that it’s easier for your application to scale and survive infrastructure issues.
A “monolithic” application is much easier to work on, so if you don’t have any specific requirements, this is the option we recommend, and our default option.
However, A “monolithic” application is still an Spring Boot application with Microservices support.

Microservices architecture overview

The JHipster microservices architecture works in the following way:
  • A gateway is a JHipster-generated application (using application type microservice gateway when you generate it) that handles Web traffic, and serves an Angular/React application. There can be several different gateways, if you want to follow the Backends for Frontends pattern, but that’s not mandatory.
  • Traefik is a modern HTTP reverse proxy and load balancer that can work with a gateway.
  • The JHipster Registry is a runtime application on which all applications registers and get their configuration from. It also provides runtime monitoring dashboards.
  • Consul is a service discovery service, as well as a key/value store. It can be used as an alternative to the JHipster Registry.
  • JHipster UAA is a JHipster-based User Authentication and Authorization system, which uses the OAuth2 protocol.
  • Microservices are JHipster-generated applications (using application type microservice application when you generate them), that handle REST requests. They are stateless, and several instances of them can be launched in parallel to handle heavy loads.
  • The JHipster Console is a monitoring & alerting console, based on the ELK stack.

In the diagram below, the green components are specific to your application and the blue components provide its underlying infrastructure.

From above picture, we can see that Eureka Server has been wrapped into Jhipster Registry, because the standard architecture of Eureka Server is something like following:

Docker installation

Guide to install docker on windows: https://docs.docker.com/toolbox/toolbox_install_windows/https://github.com/docker/toolbox/releases
After installation, click on shortcut on desktop of computer to start docker

Then the terminal will appear with messages

Type the docker run hello-world command and press RETURN.

In the first times, It will show errors and then download hello-world example. If you run that command in the second times, It will show above messages. That means the installation of docker is okay.

Install Compose on Windows desktop systems
Docker Desktop for Windows and Docker Toolbox already include Compose along with other Docker apps, so most Windows users do not need to install Compose separately. Docker install instructions for these are here:


Links:
https://www.jhipster.tech/microservices-architecture/
https://spring.io/blog/2015/07/14/microservices-with-spring

Sunday, July 5, 2020

SSO java-servlet-application-with-keycloak

There are some concepts relating to SSO - single sign on in software applications.

What is OpenID?

OpenID allows you to use an existing account to sign in to multiple websites, without needing to create new passwords.
You may choose to associate information with your OpenID that can be shared with the websites you visit, such as a name or email address. With OpenID, you control how much of that information is shared with the websites you visit.
With OpenID, your password is only given to your identity provider, and that provider then confirms your identity to the websites you visit.  Other than your provider, no website ever sees your password, so you don’t need to worry about an unscrupulous or insecure website compromising your identity.
So when talking about OpenID it means we are talking about authentication topics.

Saturday, July 4, 2020

Spring Security Overview

Spring Security is a powerful and highly customizable authentication and access-control framework. It is the de-facto standard for securing Spring-based applications.
Spring Security is a framework that focuses on providing both authentication and authorization to Java applications. Like all Spring projects, the real power of Spring Security is found in how easily it can be extended to meet custom requirements

Saturday, May 9, 2020

Angular 2 with ZK

With the emerging of reactjs and angular2, zk and other old ui java frameworks are standing before of going to history library but now angular2 has been integrated into zk and make it having more custom chosen for users so that zk framework is still used for maintainance and new java projects.

Angular 2 is integrated in zk by using  client command binding to communicate with a Java ViewModel at the server-side.

Sunday, September 1, 2019

Getting started with React Native and Redux

This article is a simple step-by-step of how to start a project with React Native and Redux.
Source Code (Branch init)

Create-react-native-app

Following the path of its excellent web brother, I recommend the use of the create-react-native-app to bootstrap your new project. This one configures all the build tools necessary to create a React Native app, and gives you some excellent Expo integrations.
First thing to do is to install CLI tool with
npm install -g create-react-native-app
Now, run the following command with the name you want to give to your project
react-native init my_awesome_app
Go forward to the new folder, and run
react-native run-android

Spring Boot + React Redux and MySQL CRUD example

This article will build React Redux Http Client & Spring Boot Server example that uses Spring Data JPA to interact with MySQL database and React as a front-end technology to make request and receive response.
Technologies
– Java 1.8
– Maven 3.3.9
– Spring Tool Suite 3.9.0.RELEASE
– Spring Boot 2.0.1.RELEASE
– Webpack 4.4.1
– React 16.3.0
– Redux 3.7.2
– React Redux 5.0.7
– axios 0.18.0
– MySQL 5.7.16

Sunday, August 25, 2019

Devstack download: migrating from JSF to ReactJS

At Bandwidth, our UI front end was originally written using JSF (java server faces). This made sense at the time because we had a lot of Java developers and it was easier for them to work with. As time moved on and we expanded our team we got more front-end developers on board. They were pushing for a more modern front end stack that will help improve efficiency for front-end development. That is how we ended up deciding to use ReactJs.
I think one of the trickiest parts of the change was deciding how to go about it. It takes a lot of time and effort to make the change and we had to convince everyone that it would be worth it. Since there was already a movement to revamp our signup process, it seemed like a perfect opportunity to write that using ReactJs and Redux. It also had the plus side of not needing to be authenticated so you really couldn’t pick a better piece to migrate first. You can click the link below to check out our new signup page and see the results!

Wednesday, June 26, 2019

Jakarta EE and JSF 2.x

Jakarta EE

In September 2017, Oracle announced its intention to transition Java EE to the Eclipse Foundation. Java EE has since been rebranded to Jakarta EE, and JSF 2.3 (Eclipse Mojarra) has been adopted for continuation. The next major release of the JSF specification will be Eclipse Mojarra 3.0. (source from JavaWorld).

How to change the default Netbeans 8.0.2 project directory?

  • edit the file
    C:\Users\adminuser\AppData\Roaming\NetBeans\8.0.2\config\Preferences\org\netbeans\modules\projectui.properties
  • set the key/value
    lastOpenProjectDir=C:\\Java\\NetBeansProjects
  • Create project and chose Project Location = C:\Java\NetBeansProjects
    next time, when creating new project, the new project location will be set



Friday, May 31, 2019

BPM - Business Process Management là gì

BPM = Business Process Management  = Quản lý quy trình nghiệp vụ

BPM có khó hiểu, trìu tượng lắm không? Nếu xét về khái niệm, hiểu nôm na nó là gì, nó hoạt động như thế nào thì khẳng định là KHÔNG khó hiểu; tuy nhiên để xây dựng triển khai BPM thì cần phải biết lập trình, biết lưu trữ dữ liệu vào cơ sở dữ liệu, biết tích hợp quy trình kế toán chạy ngầm bên dưới, biết liên kết với API của các phần mềm khác trong toàn hệ thống, nghĩa là dữ liệu cần phải lưu trữ và cập nhật, lấy ra từ các phương tiện trữ máy tính. Sau đây là định nghĩa về BPM theo cách hiểu của tôi dựa trên tham khảo từ internet và có chút tiếp xúc với 1 phần mềm BPM (software-ag):

BPM là một hệ thống phần mềm (kết hợp các yêu cầu phần cứng) liên quan tới mô hình hóa (modeling), tự động hóa (automation), thực thi (execution), kiểm soát (control), đo lường (measurement) , tối ưu hóa các mục tiêu về quy trình; bằng việc kết hợp thông tin các hệ thống khác trong đơn vị/tổ chức như ECM, CRM, HRM,.. để tạo ra một quy trình tổng thể và từng bước thực hiện các quy trình con khác trong hệ thống nhằm mục đích quản lý nhất quán các thông tin&hoạt động về quy trình của hoạt động sản xuất kinh doanh trong doanh nghiệp(hay tổ chức, chính phủ,..) cũng như các hoạt động liên quan tới khách hàng, nhân viên, đối tác.

Popular Posts

Blog Archive