Skip to content

Instantly share code, notes, and snippets.

package com.levelsbeyond;
import java.util.Date;
import java.util.concurrent.Callable;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
/**
* Thread Test
http://www.scala-sbt.org/release/tutorial/Installing-sbt-on-Linux.html
http://spray.io/introduction/getting-started/#getting-started
@hitxiang
hitxiang / .env
Last active June 19, 2018 02:48
go sftp client sample
sftp.user=xxx
sftp.connection=xxxx:port-num
sftp.private_key_path=xxx
package main
import (
"encoding/json"
"fmt"
"net/http"
"time"
"github.com/hashicorp/vault/api"
"github.com/hashicorp/vault/builtin/credential/aws"
kubectl -n zack-app run zack-vault-test --image=golang --command -- sleep 10000000
kubectl -n zack-app get pods
# copy folder
kubectl -n zack-app cp vault-kubernetes-authenticator zack-vault-test-75998c55fd-dqkv8:/go
kubectl -n zack-app exec -it zack-vault-test-75998c55fd-dqkv8 -- /bin/bash
# Debug sample
@hitxiang
hitxiang / Dockerfile
Last active July 9, 2019 09:15
setup postfix in centos 6
#From cespi/php-5.3:cli-latest
From centos:centos6.9
RUN yum update -y \
&& yum install -y postfix cyrus-sasl-plain php rsyslog
COPY entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/entrypoint.sh
#COPY .env /.env
# 1, export environment variables
@hitxiang
hitxiang / Deployment in openshift
Created November 4, 2019 08:00 — forked from sudhirpandey/Deployment in openshift
creating spring boot with prometheus metrics (step by step)
#To be able to deploy the app as service in openshift we can follow various routes.
#I have follwed the binary build and deployment method..
https://access.redhat.com/documentation/en-us/red_hat_jboss_middleware_for_openshift/3/html/red_hat_java_s2i_for_openshift/get_started#source_to_image_s2i_build
#Other methods are also discussed in the recoommened guide above for being able to do deployment. for private source repository
Image secret is need while doing s2i builds from the repo
#https://developers.redhat.com/blog/2017/02/23/getting-started-with-openshift-java-s2i/ provides other useful ways of deployment
@hitxiang
hitxiang / QuickfixjMessageJsonTransformer
Last active March 26, 2024 04:56 — forked from CN6033/fix2json.java
FIX message to JSON convertor
public class QuickfixjMessageJsonTransformer {
private DataDictionary dataDictionary;
public QuickfixjMessageJsonTransformer(){};
public QuickfixjMessageJsonTransformer(DataDictionary dd) {
this.dataDictionary = dd;
}
public String transform(Exchange exchange) {
// camel message
org.apache.camel.Message in = exchange.getIn();
@hitxiang
hitxiang / gist:345c8f699b4ad1271749e00b7517bef6
Last active October 6, 2020 05:04
Thread dump for fix client app
{"app_time":"2020-10-04T20:33:03.741Z","message":"parsed message: pos=88,lim=88,rem=0,offset=88,state=4 8=FIXT.1.1\u00019=65\u000135=0\u000134=2491\u000149=BO1\u000152=20201004-20:33:03.735\u000156=TAETF_BO1\u000110=120\u0001","logger_name":"quickfix.mina.message.FIXMessageDecoder","thread_name":"NioProcessor-30","level":"DEBUG"}
{"app_time":"2020-10-04T20:33:21.740Z","message":"parsed message: pos=97,lim=97,rem=0,offset=97,state=4 8=FIXT.1.1\u00019=74\u000135=1\u000134=2492\u000149=UniETF_BO1\u000152=20201004-20:33:21.735\u000156=TAETF_BO1\u0001112=TEST\u000110=140\u0001","logger_name":"quickfix.mina.message.FIXMessageDecoder","thread_name":"NioProcessor-30","level":"DEBUG"}
{"app_time":"2020-10-04T20:33:21.741Z","message":"==== TEST FIXT.1.1:TAETF_BO1->BO1:BackOffice AdminMessageReceived====","logger_name":"route8","thread_name":"QFJ Message Processor","level":"INFO"}
"\"Reference Handler\"
java.lang.Thread.State: RUNNABLE
at [email protected]/java.lang.ref.Reference.waitForReferencePendingList(N
@hitxiang
hitxiang / a.md
Last active November 5, 2020 12:22
Quickfix sequence

The sequence of outgoing message:

  • toAdmin/toApp
  • persist outgoing messages in messgestore(fileStore in our case)
  • increase sequence number of sender
  • logging of messages
  • send messages

The sequence of incoming message: