JBoss: Developer's Guide - Elvadas Nono Woguia - E-Book

JBoss: Developer's Guide E-Book

Elvadas Nono Woguia

0,0
34,79 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

Have you often wondered what is the best JBoss product to solve a specific problem? Do you want to get started with a specific JBoss product and know how to integrate different JBoss products in your IT Systems? Then this is the book for you.

Through hands-on examples from the business world, this guide presents details on the major products and how you can build your own Enterprise services around the JBoss ecosystem.

Starting with an introduction to the JBoss ecosystem, you will gradually move on to developing and deploying clustered application on JBoss Application Server, and setting up high availability using undertow or HA proxy loadbalancers.

As you are moving to a micro service archicture, you will be taught how to package existing Java EE applications as micro service using Swarm or create your new micro services from scratch by coupling most popular Java EE frameworks like JPA, CDI with Undertow handlers.

Next, you will install and configure JBoss Data grid in development and production environments, develop cache based applications and aggregate various data source in JBoss data virtualization.

You will learn to build, deploy, and monitor integration scenarios using JBoss Fuse and run both producers/consumers applications relying on JBoss AMQ.

Finally, you will learn to develop and run business workflows and make better decisions in your applications using Drools and Jboss BPM Suite Platform.

Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:

EPUB
MOBI

Seitenzahl: 280

Veröffentlichungsjahr: 2017

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



JBoss: Developer's Guide
A complete guide to the JBoss ecosystem

Elvadas Nono Woguia

BIRMINGHAM - MUMBAI

JBoss: Developer's Guide

Copyright © 2017 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

First published: August 2017

Production reference: 1290817

Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.

ISBN 978-1-78829-619-9

www.packtpub.com

Credits

Author

Elvadas Nono Woguia

Copy Editor

Shaila Kusanale

Reviewers

Meissa Sakho

Peter Guo Pei

Alain Dang Quang PHAM

Project Coordinator

Ritika Manoj

Commissioning Editor

Smeet Thakkar

Proofreader

Safis Editing

Acquisition Editor

Larissa Pinto

Indexer

Mariammal Chettiyar

Content Development Editor

Aditi Gour

Graphics

Jason Monteiro

Technical Editor

Ralph Rosario

Production Coordinator

Shantanu Zagade

About the Author

Elvadas Nono Woguia is a software engineer, consultant, and open source technology enthusiast living in Paris. Elvadas studied computer science at Ecole Polytechnique Yaounde in Cameroon, and also holds a specialized master in IT systems management from Ecole Centrale Paris. He has now been working for 10 years in EMEA IT industry for various companies and customers, and is currently employed by Red Hat as Middleware and PAAS consultant.Elvadas is a certified Oracle Web Component Developer Expert and a Certified Red Hat Platform As a Service Delivery Specialist. He currently helps Red Hat customers on their open source journey to design modern and scalable architectures, and build, customize, and integrate various middleware and cloud technologies and products around JBoss and Openshift ecosystems.In his free time, Elvadas loves playing and watching soccer. He shares tech posts with the open source community on his blog on the Red Hat developers website. He cares about humanitarian causes; he founded and worked to bring peace and light among the needy through this charitable organization UrgenceSolidaires.

About the Reviewer

Peter Guo Pei is a Canadian big data and web technology expert. In the recent years, he has also worked on various mobile technologies. He lives in the quiet town of Langley along the US-Canadian border with his fantastic wife and two amazing kids. He studied information science in Fudan University, Shanghai.

He has worked for various IT companies in China, US, and Canada, including Sun Microsystems, Tandem, Wang, Kodak, and Motorola. He has also worked for major retailers.

He loves to travel with his family, and plans to volunteer for Tokyo 2020, be part of this historic event, enjoying Japan’s rich history, wonderful people, and exquisite food.

I would like to thank my fantastic wife Yan and my two amazing kids-–my daughter Angel and son Jimmy. You have always been the sunshine of my life.

www.PacktPub.com

For support files and downloads related to your book, please visit www.PacktPub.com.

Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details.

At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.

https://www.packtpub.com/mapt

Get the most in-demand software skills with Mapt. Mapt gives you full access to all Packt books and video courses, as well as industry-leading tools to help you plan your personal development and advance your career.

Why subscribe?

Fully searchable across every book published by Packt

Copy and paste, print, and bookmark content

On demand and accessible via a web browser

Customer Feedback

Thanks for purchasing this Packt book. At Packt, quality is at the heart of our editorial process. To help us improve, please leave us an honest review on this book's Amazon page at https://www.amazon.com/dp/1788296192.

If you'd like to join our team of regular reviewers, you can e-mail us at [email protected]. We award our regular reviewers with free eBooks and videos in exchange for their valuable feedback. Help us be relentless in improving our products!

Table of Contents

Preface

Introduction

What you need for this book

Who this book is for

Conventions

Reader feedback

Customer support

Downloading the example code

Downloading the color images of this book

Errata

Piracy

Questions

Introduction to the JBoss Ecosystem

Beos bank project

JBoss Developer Studio

Installation

Integration Stack

The Forge console

Working with the Forge CLI

Creating Maven projects

Creating a Java class

Adding attributes to classes

Building projects with Forge

Summary

Developing and Hosting Scalable Web Applications

Installation and configuration

Architecture and features

Practical JBoss

Lab - setting up a simple JBoss EAP domain

JBoss EAP 7 installation

Configuring authentication

Creating a management to manage your EAP domain

Configuring host authentication

Setting up the domain host and interfaces

Checking the management interfaces

Reviewing the domain controller configuration

Configuring slaves - host-slave.xml

Starting the domain

Lab - using the JBoss CLI

Creating server groups

Creating a server instance

Clustered high available money TransferWebApp

Implementing a clustered money transfer web page

JBoss CLI deployment

JBoss as maven plugin

Session replication demo

Archiving automatic cluster failover

Session distribution on limited nodes and passivation

Cluster isolation by server groups

Creating datasources

 Creating a module

Creating a MySQL driver

Datasource

Testing the datasource

Lab accessing databases with JPA

 Referencing a datasource

 Creating entities

Inserting a MoneyTransferRequest

Leveraging the existing features to define security policies

Creating a database security domain

Plugging a security domain in a web application

Deploying the application and checking the secure pages

Customizing/overriding security policies

Creating a custom login module

 Deploying the module on JBoss

Summary

Custom Web Deployment using Undertow and Swarm

Undertow - purpose and architecture

Creating your first Undertow server

Undertow request life cycle

Undertow handlers

Path handlers

Reverse proxy handler

Microservices with Undertow

Reading money transfer details

Running the application

Load balancing with an Undertow subsystem

Innovative microservice packaging with WildFly Swarm

Summary

Storing and Accessing Distributed Data

JBoss Data Grid architecture

Versioning

Running configuration

Working with caches

Library mode in Java SE

Cache Listener

Client-Server mode

Clustering and visualizing caches

Building the Datagrid cluster

Visualizing the cluster

Replicated and distributed

Cache advanced usages

REST API

Cache expiration and eviction

XML configuration

Grid computing

Distributed Streams

Distributed execution

Cache security

Summary

Exposing Data as a Service

Introduction to data virtualization

JBoss data virtualization architecture

JBoss Data Virtualization installation

Installing JDV Server

Setting up JDV features in JBoss Developer Studio

Developing virtual databases

Business case

Data preparation

Modeling data sources with JBoss data virtualization

Creating the beosbank-datavirt Teiid Model project

Creating a MySQL source model

Creating a Postgres source model

Creating a MongoDB source model

Building Virtual Base Layers

Creating the AF_Transactions_VBL model

Building and deploying federated data views

Accessing virtual databases

Virtual procedures

Summary

Integrating Applications with JBoss Fuse

JBoss Fuse architecture

Installing JBoss Fuse

Basic Fuse installation

Creating a Fuse cluster with Fabric8 and Apache Zookeeper

Developing and deploying OSGi applications on the JBoss Fuse platform

Content- and source-based routering

Creating a project

Creating the business logic

Preparing the beosbank-moneytransfer-cacheloader test environment

MySQL database

JBoss Datagrid and infinispan visualizer

Running Fuse applications on a standalone Karaf container

Running beosbank-moneytransfer-cacheloader on Fuse Fabric

Creating a profile

Deploying the profile in the fabric

Updating profiles and properties to use the encrypted password

Proxying web services

Business case

Solution

File processing and data transformation

Summary

Delivers Information Safely and Connects IoT

JBoss AMQ architecture and installation

JBoss AMQ architecture

JBoss AMQ insallation

Connecting clients to routers and brokers

Lab description

Simulate the network

Create and start Fidelity broker instances

Create the router

Router configuration

Connecting IoT devices

AMQ topologies

Summary

Making Better Decisions in Your Applications

JBoss BRMS components and architecture

Installing the JBoss BRMS platform

Authoring business rules with JBoss BRMS

Authoring rules in Business Central

Creating a rule-based project

Creating a data object

Creating business rules 

Creating test scenarios in BRMS

Implementing a decision table

 Real-time decisions with BRMS

Complex event processing

Summary

Developing Workflows

Process modeling with JBoss BPMS

Installing JBoss BPM

The BPMN2 notation

 The Beosbank practical sample

Creating the beosbank-bpms-withdrawal project

Modeling withdrawal data objects

Modeling the WelcomeUserProcess

The process configuration

Greeting manual task

Filling in the withdrawal form user task

Modeling the checkUserInput BRMS task

Modeling the WelcomeScript task and go back gateway

Building and running the process

Integrating the WelcomeUser in a parent process

Summary

Preface

Introduction

The JBoss ecosystem is very large and dynamic; the JBoss community drives innovation every day to bring the best projects and products to the world. This book does not pretend to cover all possible and imaginable JBoss products in detail, but this book aims to be the best and fastest getting-started guide for Enterprise application development with the JBoss brand.

The book covers five main parts:

Part 1 explores the basics, Users will be presented the global project we will cover progressively during this book, JBoss developer studio.

This part also presents the BeOS Bank project example that will drive the chapters and labs.

Chapter 1, Introduction to the JBoss Ecosystem, presents the users with the project, that will serve as a guide throughout this book. The chapter also introduces JBoss developer studio's features in order to improve developer productivity.

Part 2 covers web application development and deployment with the JBoss EAP and Undertow.

Chapter 2, Developing and Hosting Scalable Web Applications, takes a look at developing and hosting scalable web applications using JBoss Application Server. The user will learn how to develop and deploy scalable web applications and monitor their states on JBoss Application Server. Users will also get hands-on JBoss EAP configuration tips to tune the platform to respond to various operational events.

Chapter 3, Custom Web Deployment Using Undertow and Swarm, explains that Undertow is the default web server included in JBoss Application Server. In the last chapter, users implicitly used the embedded version of Undertow in JBoss AS to host applications; this chapter is about handling custom deployment scenarios by embedding Undertow in Java applications on one hand but also teaching how to package existing Java EE component as microservices using Wildfly Swarm. The user will also learn how to set up highly available deployments and build microservices with Undertow

Part 3 is centered on data management tools in the JBoss ecosystem. It covers data caching with JBoss Data Grid and data refactoring using JBoss data virtualization.

Chapter 4, Storing and Accessing Distributed Data, deals with data caching in a JBoss ecosystem with JBoss Data Grid/Infinispan; various configuration tips will be experimented through labs and coding sessions. The chapter also shows how to store and retrieve data from local and remote caches, how to develop and deploy cache-based applications, how to listen to cache event, and how to leverage the Advanced Cache API.

Chapter 5, Exposing Data as a Service, outlines data virtualization with JBoss Data Virtualization tools through illustrated examples; you will discover how to create aggregated, unified, and virtualized views from disparate data sources, how to create source models and virtual models, how to query join data from various sources, and finally, how to expose data views as a service.

Part 4 is about Enterprise Service Bus (ESB) and messaging. We will discuss JBoss Fuse ESB's features and development guide as the well as JBoss AMQ messaging platform.

Chapter 6, Integrating Applications with JBoss Fuse, is organized around application and component integration. After a brief presentation of the JBoss Fuse architecture, it progressively teaches how to develop, deploy, and monitor various OSGi integration scenarios on JBoss Fuse Platform, and explore some integration patterns with Apache Camel through illustrated cases.

Chapter 7, Delivers Information Safely and Connects IoT, discusses how to weakly couple distributed systems using the JBoss AMQ messaging platform. Through practical business cases, users will learn how to set up broker configuration, and how to build and run applications that rely on JBoss AMQ to share data in a safe and reliable way.

Part 5; at the end of the journey, a company is governed by processes and rules; this part covers both business rule and business process application development with JBoss products.

Chapter 8, Making Better Decisions in Your Applications, introduces artificial intelligence programming using the JBoss ecosystem. JBoss Business Rule Management System (BRMS) and Drools Rule Language (DRL) features are explored to build rule-based applications, decision tables, and complex event handlers.

Chapter 9, Developing Workflows, takes you through how to develop workflow applications using JBoss Business Process Management Suite. Process/activities modeling tasks/event handling are explained through practical use cases. Human interaction through forms is covered to enable users to design and test real-life advanced business processes.

What you need for this book

To run the sample provided in this book, you will need at least the following software and a GitHub account.

Install JDK 8

Install Maven 3.5

Chapters sources used artifacts from:

Maven central repository

http://central.maven.org/maven2/

Red Hat GA repository

https://maven.repository.redhat.com/ga/

Clone the book repository with its git submodule using the command:

git clone --recursive [email protected]:jbossdevguidebook/chapters.git

Here is a full software list used in this book and their download links. Common tools like JBoss developper studio and Integration Stack are installed in the first chapter, At the begining of others chapters, a specific section explains how to install specific JBoss products when required:

Software

Download Links

Chapters

devstudio-10.3.0.GA-installer-standalone.jar

https://developers.redhat.com/download-manager/file/devstudio-10.3.0.GA-installer-standalone.jar

all

Java SE Development Kit 8u91 or higher

http://www.oracle.com/technetwork/java/javase/downloads/

all

JBoss Developer Studio Integration Stack 10.3.0.GA

http://tools.jboss.org/downloads/devstudio_is/neon/10.3.0.GA.html

https://devstudio.redhat.com/10.0/stable/updates/integration-stack/10.3.0.GA/devstudio-integration-stack-10.3.0.GA-updatesite.zip

all

Apache Maven 3.X, version 3.5.0 recommended

https://maven.apache.org/download.cgi

all

jboss-eap-7.0.0.zip

https://developers.redhat.com/download-manager/file/jboss-eap-7.0.0.zip

2,4,5,8,9

HA-Proxy version 1.7.3 or higher

http://www.haproxy.org/

2

MySQL Community Server 5.6.37

https://dev.mysql.com/downloads/mysql/5.6.html#downloads

2,3,4,6

wildfly-11.0.0.Alpha1.zip

http://wildfly.org/downloads/

3

jboss-datagrid-7.0.0-server.zip

https://developers.redhat.com/download-manager/file/jboss-datagrid-7.1.0-server.zip

4

Infinispan Visualizer : master branch

https://github.com/infinispan/visual.git

4,6

jboss-dv-6.3.0-1-installer.jar

https://developers.redhat.com/download-manager/content/origin/files/sha256/b4/b466affbcc1740bf2c7c73b60bb6ffa7e1ec844fc08447224ab15aa3bcee3949/jboss-dv-6.3.0-1-installer.jar

https://developers.redhat.com/products/datavirt/download/

5

Docker & Docker Compose version 17.03.1-ce, build c6d412e or higher

https://docs.docker.com/v17.03/

5

jboss-fuse-karaf-6.3.0.redhat-187.zip.

https://developers.redhat.com/download-manager/file/jboss-fuse-karaf-6.3.0.redhat-187.zip

6

jboss-amq-7.0.0.redhat-1-bin.zip

https://developers.redhat.com/download-manager/content/origin/files/sha256/cd/cd45bd5cd6812bc5c2065b2e5e1a3251190f75ea639410aed6b2cdd87209b311/jboss-amq-7.0.0.redhat-1-bin.zip

https://developers.redhat.com/products/amq/download/

7

VirtualBox v5.0.26 r108824 or higher

https://www.virtualbox.org/wiki/Downloads

7

Red Hat Enterprise Linux 7.3.0 +

For Developper

https://developers.redhat.com/products/rhel/download/

7

Extra Packages for RHEL

https://fedoraproject.org/wiki/EPELhttps://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

7

jboss-brms-6.4.0.GA-deployable-eap7.x.zip

https://developers.redhat.com/products/brms/download/

Deployable for EAP 7 (192 MB)

8

jboss-bpmsuite-6.4.0.GA-deployable-eap7.x.zip

https://developers.redhat.com/products/bpmsuite/download/

Deployable for EAP 7 (228 MB)

9

Who this book is for

If you are a Java developer who wants to have a complete view of the JBoss ecosystem or quickly explore a specific JBoss product, this is the book you want. Integrators and consultants familiar with JBoss who want to integrate several JBoss products within their ongoing project will also find this book useful.

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: Client applications can then consume data from virtual databases using standard interfaces such as the ODBC, JDBC, and REST protocols.

A block of code is set as follows:

$ export EAP_HOME=$HOME/books/jbossdev/installs/jboss-eap-7.0$ cd $EAP_HOME/bin$ ./standalone.sh

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "JBoss is fully Java Authentication and Authorization Service (JAAS)"

Warnings or important notes appear in a box like this.

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book--what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply [email protected], and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide atwww.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for this book from your account athttp://www.packtpub.com. If you purchased this book elsewhere, you can visithttp://www.packtpub.com/supportand register to have the files emailed directly to you. You can download the code files by following these steps:

Log in or register to our website using your email address and password.

Hover the mouse pointer on the

SUPPORT

tab at the top.

Click on

Code Downloads & Errata

.

Enter the name of the book in the

Search

box.

Select the book for which you're looking to download the code files.

Choose from the drop-down menu where you purchased this book from.

Click on

Code Download

.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

WinRAR / 7-Zip for Windows

Zipeg / iZip / UnRarX for Mac

7-Zip / PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/JBoss-Developers-Guide. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Downloading the color images of this book

We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from https://www.packtpub.com/sites/default/files/downloads/JBossDevelopersGuide_ColorImages.pdf.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books maybe a mistake in the text or the code we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visitinghttp://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go tohttps://www.packtpub.com/books/content/supportand enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us [email protected] a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us [email protected], and we will do our best to address the problem.

Introduction to the JBoss Ecosystem

JBoss initially referred to an application server edited by JBoss Inc. The first JBoss version was designed by Marc Fleury; he incorporated the JBoss Company in 1999 with an innovative business model around services, training, and certifications.

JBoss is fully written in Java, and it obtained the Java 2 Enterprise Edition version 1.4 certification in 2004. This standardization by SUN Microsystems largely contributed to propel the Jboss application server into large accounts to the point of making it a first choice element while deploying enterprise Java applications.

This situation has naturally fueled the appetite in companies looking for external growth, and it was almost natural that Red Hat Inc. acquired Jboss in 2006 to embrace the service industry.

One decade after, the most important acquisition in history, Red Hat has not only worked to significantly improve the JBoss application server, but has also been designing a strong portfolio of middleware and application development products, which also have the JBoss denomination.

Today, the Red Hat JBoss Middleware portfolio is mainly maintained by the open source community and the Red Hat JBoss division. It covers a set of products to enable developers to have the tools they need to create, integrate, deploy, and manage enterprise applications. Regarding the product delivery strategy, there are two main editions for each product: a community edition driven by the open source Community, and an Enterprise edition taken from the community stream.

The community edition is open source and is available to all for free while the Enterprise edition is accessible through a subscription. With the subscription model, companies, organizations, and individuals with an active subscription are allowed to download and use Red Hat certified and tested enterprise software; the editor, in return, provides them with guidance, support, patches, updates, and services around the product through an online network.

Even if there are two distinct editions, it is truly an open organization; bug fixes, for example, from the community version are reported in the commercial edition and vice versa. Red Hat provides and maintains the tested configuration for each product enterprise version release.

The JBoss ecosystem is very large indeed, from developers tools to application platforms. JBoss products now cover the following categories: applications and web servers, enterprise service buses, messaging, data management platforms, rules, workflow management, services, APIs and many other features.

You may have often wondered what is the best JBoss product to solve a specific problem or need, how to get started with a specific JBoss product, or how to integrate different JBoss products in your IT systems.

Through hands-on labs from the business world, this book presents practical use cases that you can leverage to build your own enterprise services around the JBoss ecosystem. In this chapter, we will cover the following topics:

Presenting the global project that will serve as a compass throughout the book

Installing and setting up the JBoss developer studio

Setting up the integration stack, to start our Jboss development journey

Creating our first project

Creating objects using the Forge console

Beos bank project

Beos bank is a financial institution that operates worldwide, and its main locations are in five continents: Mexico, Boston, Chennai, Paris, and Baham. Beos bank provides various digital financial services, including mobile banking and instant payment. It also allows individuals and companies to realize money transfers and cross-border remittances. As a lead developer, the reader will have the responsibility to drive the Beos bank digital transformation using JBoss products. The following projects have been identified to make Beos bank the next billion-dollar company:

Money transfer web application

:Users have been complaining about the instability of the current web transfer portal--sometimes servers go down during transfer operations and user data is lost. You have to set up a new architecture to deploy the money transfer application to support new business reorganization. Develop a new transfer application allowing users to send money to a recipient using JSF, and use JBoss EAP to host and cluster the application. Configure and test the session replication between 02 or 03 nodes. Deploy a HA cluster behind an undertow load balancer and check load balancing features; persist transfers data using JPA and JBoss data sources.

Banking API Management System

:Use Undertow to build and deploy serverless microservices for staff/user authenticated money transfer requests. Use Undertow to reduce the server park and help Beos bank enter the microservices and container world; this program will also help the bank achieve ISO 50001 certification.

Withdraw remittances

:Beos bank has a centralized database to host transfer data; some countries are complaining about the response time to validate a transaction: poor network connections, timeouts, and so on. Use a JBoss data grid cluster to keep in different countries. Use the JBoss data grid Hot Rod client to validate user remittances

.

Cash and currency management

:Beos bank would like to be agile enough to quickly adapt to new regulation policies and would like the transfer fees and commissions to depend on both the sender and receiver countries. Coding this rule, use the BRMS decision table to compute transfer fees based on country and ranges. Use the Virtual Data Model from Yahoo and partners to convert currency rates, and use JBoss Data Virtualization to refactor the price catalog from different countries.

Fraud detection system

:Some illegal transactions have been identified; use BRMS rules, Complex Event processing, and a real-time decision server to detect frauds and illegal transactions. Use the Virtual Data Model from Yahoo and partners to convert currencies.

Invoices and accounting

: Use the JBoss Fuse OSGi flow to process/send bills, and use JBoss Fuse to send a file to regulatory institutions.

Promotions and coupons

:Use JBoss AMQ to notify the partner working on loyalty cards, and use JBoss AMQ to communicate with a mission critical-bank approval system with no message lost. Configure Active MQ to support various runtime and production incidents.

Customer relationship management

:Users are complaining about some Beos bank processes in some countries. Design the incriminated Beos bank business processes with JBoss BPM and improve the process.

In all the book, we will be relying on System.out.println(String out) to print some output on the console when needed; for more advanced ouputs you can refer to String.format method to format the output before printing it to the console.

To understand all the coding stuff related to this project, we will work with a brilliant project called JBoss Developer Studio.

JBoss Developer Studio

JBoss Developer Studio (JBDS) is a development environment created on top of Eclipse and is currently developed by the Red Hat JBoss division. Some companies such as Exadel, the Eclipse foundation, and open source individuals are also working on the JBoss Developer Studio project. JBDS empowers users with a set of plugins, called JBoss Tools; it supports multiple programming models, frameworks, and technologies, including Maven, SVN, and Git.

JBoss Developer Studio is modular like Eclipse and supports development with multiple JVM versions. At the time of writing this book, the last JBDS release version is 10.3.0. JBDS is available as other Jboss products on the Red Hat developer portal--developers.redhat.com; you need a social account (GitHub, Stack Overflow, Linkedin, Twitter, Facebook, Google, or Microsoft) and credentials to download the software.

Installation

JBoss Developer studio installation requires the following configuration:

4 GB RAM (minimum 2 GB RAM)

2 GB hard disk space

JDK 8 to run, but it can deploy applications using lower versions

Download devstudio-10.3.0.GA-installer-standalone.jar and begin the installation using the following command:

java -jar devstudio-10.3.0.GA-incstaller-standalone.jar

This installation needs JRE 8 to proceed; once launched, the GUI installer starts an installation workflow where you will have to click on the Next button to move to the next step:

The installation wizard has nine steps, which are easy to follow:

Read and accept the terms of the license agreement:

Installation is done by default in /Applications/devstudio; you can change this directory to use a custom one:

Select the default Java 8 Virtual machine and click on Next button:

JBDS can scan specific directories to reference your existing JBoss servers.

We will not add a specific location for now; we will just move on to the next steps:

The installer displays the installation path, the component to be installed, as well as the available and required space on your computer. Click on the Next button to proceed with the installation:

In step 7/9 details of each installed component are printed on screen. Wait for the overall installation process to complete:

Click on Done to finish, with the Run Red Hat JBoss Developer after installation option checked. Select a fresh workspace to reach the welcome view.

We will use the $HOME/jbdevgWorkspace folder for our installation throughout this book:

This completes the JBDS installation. Once the JBDS installation is complete, you need to ensure that all the development plugins are also installed. While working with JBoss, the integration stack provides a set of plugins and features to ease the development process; let's install the JBoss integration stack plugin.

Integration Stack

By default, JBoss Tools is installed along with JBDS; this is not the case for the JBoss Integration Stack, which provides users with a toolset to integrate applications. It works with Apache Camel, JBoss Data virtualization, and various others features related to Integration.

The most simple way to install the JBoss Integration Stack is from the Red Hat central view:

Check the listed options:

JBoss Fuse Development

JBoss Data Virtualization Development

JBoss Business Process and Rule Development

JBoss Integration and SOA Development

Integration stack plugins can also be installed from a ZIP file at http://tools.jboss.org/downloads/devstudio_is/.

Click on the install/update button and complete the installation steps. Each plugin has its own working problem to solve, and the user manual, as far as possible, refers to the official documentation of the plugin. In the current section, we install both the JBoss Developer Studio and the Integration stack plugin. We are now ready to create projects and work on them within the IDE. JBDS has an integrated console, called the Forge console, to perform some tasks quickly. In the next section, we will perform various project tasks using this console.

The Forge console

The Forge console provides an integrated command-line interface in the IDE. The Forge console command actions automatically synchronize the workspace views. Forge brings out a powerful command line interface to interact with the IDE. Forge is also available as an Eclipse wizard for users who really don’t want to remember the commands. We will perform various Forge console tasks on a new Java project called Name bank-forge-demo.

Working with the Forge CLI

In order to interact with the Forge CLI, the console needs to be started. In the quickview, search for Forge console; click on the green button to start the Forge CLI:

The command line starts, and a shell is opened on the current workspace directory. You can now enter various commands to create projects, and to interact with the project model and objects. Now, let's see how to create a project using the Forge console.

Creating Maven projects

Use the command list to see the commands available and the man command to get help on a specific command's usage. Forge commands work both interactively and with options. To create a new project, use the project-new command, and provide answers to the interactive questions asked.

[

jbdevgWorkspace

]

$ project-new beosbank-forge-demo***INFO*** Required inputs not satisfied, entering interactive mode

*

Project name:

beosbank-forge-demo

? Top level package [org.beosbank.forge.demo]:

com.beosbank.forge.demo

? Version [1.0.0-SNAPSHOT]

HIT ENTER to pick the default version

? Final name:

beosbank-forge-demo

? Project location

[/Users/enonowog/jbdevgWorkspace]:

? Use Target Location Root? (If specified, it won't create a subdirectory inside the specified Project location) [y/N]:

N

[0] (x) war

[1] ( ) jar

[2] ( ) parent[3] ( ) forge-addon[4] ( ) resource-jar[5] ( ) ear[6] ( ) from-archetype[7] ( ) genericPress <ENTER> to confirm, or <CTRL>+C to cancel.

* Project type: [0-7] 1

[0] (x) MavenPress <ENTER> to confirm, or <CTRL>+C to cancel.

* Build system: [0] 0[0] ( ) JAVA_EE_7[1] ( ) JAVA_EE_6[2] ( ) NONE