Skip to content

Instantly share code, notes, and snippets.


Rohit Kelapure kelapure

View GitHub Profile
kelapure /
Last active Aug 19, 2020
Code Rewrite Options For Removing Technical Debt
kelapure /
Created Oct 20, 2019
How to print the Topology of a KStream or a KTable when you have no access to the topology
private void print(Object stream) throws IllegalAccessException {
Field field = ReflectionUtils.findField(KStreamImpl.class, "builder");
InternalStreamsBuilder builder = (InternalStreamsBuilder) field.get(stream);
field = ReflectionUtils.findField(InternalStreamsBuilder.class, "internalTopologyBuilder");
InternalTopologyBuilder internalTopologyBuilder = (InternalTopologyBuilder)field.get(builder);
TopologyDescription topologyDescription = internalTopologyBuilder.describe();
kelapure /
Last active Mar 9, 2019
Script to pull out the properties of your application from the config server. Name of the app is spring-music89 and the config service instance is called csi
cf create-service-key csi config-server-key
cf service-key csi config-server-key | tail -n 6 > config-server-key.json
# Get details form config-server-key.json file
access_token_uri=$(cat config-server-key.json | jq -r ".access_token_uri")
client_id=$(cat config-server-key.json | jq -r ".client_id")
client_secret=$(cat config-server-key.json | jq -r ".client_secret")
ClassLoader cl = ClassLoader.getSystemClassLoader();
URL[] urls = ((URLClassLoader)cl).getURLs();
for(URL url: urls){
kelapure / xml
Last active Feb 24, 2019
View xml
kelapure /
Created Feb 11, 2019
The script that executes any batch job on the PCF as a task, waits for the result and prints out associated logs
task_id=$(cf run-task $APP_NAME "${CMD}" | grep "task id:" | awk '{print $3}')
task_name=$(cf tasks $APP_NAME | grep "^$task_id " | awk '{print $2}')
task_status=$(cf tasks $APP_NAME | grep "^$task_id " | awk '{print $3}')
kelapure / debugging-poor.rb
Last active Dec 5, 2018
Poor man's profiler for Ruby
View debugging-poor.rb
# chp2/wrapper.rb
require "json"
require "benchmark"
def​ measure(&block)
no_gc = (ARGV[0] == "--no-gc")
kelapure / Application
Last active Nov 30, 2018
View Application

Technical Stack Buckets/ Application Tags

  1. Modern Microservices with Spring and other microframeworks
  2. Batch
  3. ETL
  4. SPA
  5. Web MVC , Older REST - Server side rendering of UI
  6. Portlets based UI
  7. Cloud Native Eclipse Microprofile
  8. Service Composition / Data Integration / Data Munging
class DebugUtils {
private static final boolean transactionDebugging = true;
private static final boolean verboseTransactionDebugging = true;
public static void showTransactionStatus(String message) {
System.out.println(((transactionActive()) ? "[+] " : "[-] ") + message);
// Some guidance from:,1
public static boolean transactionActive() {