Tuesday, August 3, 2021

Install Maven on MacOS Catalina

 There might be many ways to install Maven on mac but I found the best way to install maven on mac is to using homebrew:


Step1:  install homebrews (if you don't have already)

Follow this URL : how-to-install-homebrew-on-mac


Step 2 : Install Maven:

https://mkyong.com/maven/install-maven-on-mac-osx/


Extra tips.

Where I can find maven local repository:

>> ~/.m2

Sunday, June 27, 2021

What are Design Fundamentals?

 Building scalable, production-ready applications is both art and science.



Design Fundamentals comes in a lot of different flavours. Specifically they can be divided in to four categories. Categories that are equally important.






First Category 

Underlying or Foundational Knowledges . 


  • For Example: 
  • Client Server Model
  • Network Protocol
Software Architectural Pattern


Second Category


Key Characteristics of systems

  • Availability 
  • Latency,
  • Throughput 
  • Redundancy,
  • consistency 


Third Category

Actual Component of a system

Example: 
  • Load Balancer 
  • Proxy
  • Cache
  • Rate limiting
  • leader election


Forth Category:

Actual Tech, Real existing product or services


Example: 
  • Zoo Keeper
  • Nginx
  • Redis
  • Amazon S3
  • Google Cloud Storage



Saturday, December 12, 2020

How Computer works


How Computer Works





How Computer Executes a Program


How Data is transmitted over the cable 




How Does Internet Works



Sunday, April 5, 2020

How to return static content from nginx

     

Some times you might need to return static response from nginx. for example validating file upload limit


  error_page 413 @413_xml;
  location @413_xml {
            default_type "text/xml; charset=UTF-8";
            return 413 '<?xml version="1.0" encoding="UTF-8"?><result><status><interfaceId>cabinet.file.insert</interfaceId><systemStatus>NG</systemStatus><message>Image size Error(Capacity)</message><requestId>$request_id</requestId><requests/></status><cabinetFileInsertResult><resultCode>3008</resultCode></cabinetFileInsertResult></result>';
        }

Saturday, January 11, 2020

Spring : Aspect-Oriented Programming

AOP is the acronym for aspect-oriented programming, which refers to a type of programming that aims to increase modularity by allowing the separation of cross-cutting concerns. A cross-cutting concern is a functionality that is tangled with business code, which usually cannot be separated from the business logic. Auditing, security, and transaction management are good examples of cross-cutting concerns.

The following are other features that might be implemented as cross-cutting concerns.
  • Logging
  • Data validation
  • Caching
  • Internationalization1
  • Error detection and correction
  • Memory management
  • Performance monitoring
  • Synchronization

Thursday, February 21, 2019

RabbitMQ - How to setup and Test from Mule 3.9

  • Install RabbitMQ
    • Step 1: Install Erlang
    • Step 2: Install RabbitMQ
  • Enable RabbitMQ Web Console
    • RabbitMQ Login Page
    • RabbitMQ Overview Page
    • Start RabbitMQ Service in Windows
  • Setting up Mule
    • Create New Mule App and Design Flow
    • Add AMQP-0-9 Connector Global Element
    • Create A Queue in RabbitMQ
    • Create A Virtual Host in RabbitMQ
  • Test RabbitMQ From Mule
    • Publish a message in RabbitMQ
    • Test the mule-3.9 app
    • RabbitMQ Test Project in Mule-3.9

Install RabbitMQ

Here is the quick installation guideline for Ubuntu 18.04
Step 1: Install Erlang
RabbitMQ needs Erlang to run. To install the latest version of Erlang, add the repository below
sudo sh -c 'echo "deb https://packages.erlang-solutions.com/ubuntu $(lsb_release -sc) contrib" >> /etc/apt/sources.list.d/erlang.list'

wget https://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc
sudo apt-key add erlang_solutions.asc

sudo apt update
sudo apt install erlang
Step 2: Install RabbitMQ
Add RabbitMQ Repository, Add Repository Key, Install RabbitMQ and Enable on Startup. 
sudo sh -c 'echo "deb https://dl.bintray.com/rabbitmq/debian $(lsb_release -sc) main" >> /etc/apt/sources.list.d/rabbitmq.list'

wget -O- https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc | sudo apt-key add -
wget -O- https://www.rabbitmq.com/rabbitmq-release-signing-key.asc | sudo apt-key add -

sudo apt update
sudo apt install rabbitmq-server

sudo systemctl enable rabbitmq-server
sudo systemctl start rabbitmq-server
For other Operating Systems please see the links below:

Enable RabbitMQ Web Console

RabbitMQ provides a web console to manage it easily. To enable the console, run the commands below
sudo rabbitmq-plugins enable rabbitmq_management
After that, open your browser and browse to the server name or IP address followed by port # 15672
You should see RabbitMQ web management console to logon. The default username and password is guest.
Username: guest
Password:  guest
RabbitMQ Login Page
RabbitMQ Overview Page
Start RabbitMQ Service in Windows
In windows system the RabbitMQ Service starts automatically. If not then you need to start it manually after installation
as like the image below. Then enable RabbitMQ Management console as shown in the following CLI.

Setting up Mule

Now open AnypointStudio and enter the AnyPointStudio Exchange Login Page.
Login and install AMQP connector mule component. 
Create New Mule App and Design Flow
Now create a new Mule project and add the following components to Mule flow:
Add AMQP-0-9 Connector Global Element
Add a AMQP-0-9 Connector Global Element to the mule flow with following properties
Create A Queue in RabbitMQ
Logon to RabbitMQ Web-console with guest user and create a queue with name "queue" 
Create A Virtual Host in RabbitMQ
Create a vhost with name "/test"
Set up logger log message and run the project.

Test RabbitMQ From Mule

Publish a message in RabbitMQ
Now publish a message in the queue named queue 
Test the mule-3.9 app
Check mule console log to check the output
RabbitMQ Test Project in Mule-3.9
For your convenience the sample mule-3.9 project has been attached below
RabbitMQ Test App using Mule-3.9

5 Strategies for Getting More Work Done in Less Time

Summary.    You’ve got more to do than could possibly get done with your current work style. You’ve prioritized. You’ve planned. You’ve dele...