Posts

Showing posts from October, 2018

Multi / Parallel Threading in Java – using ExecutorService

Image
Case Scenario: Multiple request coming for inserting data into database in asynchronized way. Need to be ensure this request not making any bottleneck in database connection and that process usage (thread usage) under controllable. From below code snippet can understand how to implement the same in simple way, keep in mind that avoided persisting queuing system because only need to emboss parallel threading. Process Flow Process Flow Each Process Chanel class Each Process Chanel class  Process Channels Handler Class Process Channels Handler Data Transferring POJO Class

How to call subclass method from superclass and assign superclass type into sub class by dynamically?

Image
Real Case Scenario There are two DTO classes which for transferring data having common properties. With these common properties need to do some business logics which cover more than 1000 lines of code and update the present DTO and return as result. Data receiving and sending from server in the form of above DTO and that can only predict at run time which DTO is this. Below structure using for implementing the same with maximum code reusability. Here  only embossing how can call subclass method from superclass and ensure only accepting the POJO class which have common nature.  In abstract class have comment which saying where need to add common logics, or call a common utility class. Class hierarchy Data sharing POJO class    Code Snippet of POJO Class Super Class Code Snippet Specific C lasses (Subclasses) Test Run Class

Installing / Upgrading MySql 8 in Red Hat Linux / CentOS

Image
Step by step commands for installing or upgrading existing mysql 5.7 into 8.0.  Here used CentOS and  community server https://dev.mysql.com/downloads/mysql/ Download mysql mysql-8.0.12-1.el7.x86_64.rpm-bundle.tar Step 1           Sometimes there may some dependency error occurred when removing existing(here mysql 5.7) database.                                              yum remove postfix mariadb-libs Step 2           For removing all existing mysql installation                           rpm -qa | grep -i mysql | xargs rpm -e Step 3         Command for installing new version (here only added needed installation files)                       ...