Skip to content

Instantly share code, notes, and snippets.

View anair-it's full-sized avatar
🎮
Distributed

Anoop Nair anair-it

🎮
Distributed
View GitHub Profile
@anair-it
anair-it / Spring Chained Tx Management.md
Last active June 7, 2024 06:38
Best efforts 1Phase Commit using Spring chained transaction managemer and Apache Camel

Best efforts 1 Phase commit

This is a non-XA pattern that involves a synchronized single-phase commit of a number of resources. Because the 2PC is not used, it can never be as safe as an XA transaction, but is often good enough if the participants are aware of the compromises. The basic idea is to delay the commit of all resources as late as possible in a transaction so that the only thing that can go wrong is an infrastructure failure (not a business-processing error). Systems that rely on Best Efforts 1PC reason that infrastructure failures are rare enough that they can afford to take the risk in return for higher throughput. If business-processing services are also designed to be idempotent, then little can go wrong in practice.

Scenarios

Consider a jms based service, where there is an inbound Queue manager (QM1), an outbound queue manager (QM2) and a database (DB). Here are the scenarios that I would like to cover using Best efforts 1 PC commit process:

Happy path

  1. Start MQ transaction on QM1 2
@anair-it
anair-it / Zookeeper and Exhibitor.md
Last active June 27, 2017 19:27
Zookeeper and Exhibitor

Overview

Applications use Apache Zookeeper to coordinate distributed systems. Soabase Exhibitor originally developed by Netflix is a management tool for Zookeeper. It provides APIs to interact with the Zookeeper cluster. This document will cover the usage of non-destructible Exhibitor APIs.

Troubleshooting Zookeeper Processes

If zookeeper process(es) stops,

  • Exhibitor will restart the zookeeper process. Data gets replicated. Application support team need not be notified
  • There may be slowness in app processing till the cluster is up
@anair-it
anair-it / Proxy config for git and maven.md
Created March 21, 2018 15:59
Configure proxy settings to work with corporate and at home

Follow below steps to enable/disable proxy in git and maven in Windows PC.

  • Proxy configuration is turned on by default. To manually turn on, run "proxon" in git bash shell
  • To turn off proxy, run "proxoff" command in git bash shell

Add proxy commands in git bash file

Assuming you have git bash installed

  • Open c:\Users\[ME]\.bashrc
  • Add following snippet
@anair-it
anair-it / Minishift.md
Last active September 24, 2019 21:41
Minishift/OKD usage

Minishift - OKD

Minishift is the single node version of OpenShift container platform that you can run locally. Reference

Install

https://docs.okd.io/latest/minishift/getting-started/index.html I've personally tested this in Ubuntu and Mac OS. Not sure about Windows 10.

Getting started

  1. Create a profile and install few addons before running Minishft
  • Decide on a profile name usually a project name. In this example I'm using the name "anair" and using Minishift to run in v3.11