Tuesday, January 19, 2016

Solace JMS issue

Solace JMS provider implementation has an obvious bug, in SolMessageProducer.java, method
protected void sendMessage(Destination destination, Message message, int deliveryMode, int priority, long timeToLive)

the parameter priority is never used, it sets the priority to 0 directly:
solMsg.setJMSPriority(0);

It causes that the JMSPriority cannot be set to other value. It exists until the current version: sol-jms-7.1.2.226

QBrowser is an excellent Java Swing GUI client. It can browse the queue/topic with minor modification.
https://java.net/nonav/projects/mq/sources/mq5/content/mq/src/share/java/examples/applications/qbrowser/QBrowser.java?rev=38

Hermes should be more powerful, but it's too complex and you can only treat it as a black box. I cannot configure it to connect Solace based on the below document. Already set SECURITY_PRINCIPAL to username@vpn Got the error
jndi lookup failed - 401 incomplete authentication configuration

http://dev.solacesystems.com/integration-guides/hermes-jms/

The JMS API provides no mechanism for browsing a topic. Messages usually disappear from a topic as soon as they appear: if there are no message consumers to consume them, the JMS provider removes them. Although durable subscriptions allow messages to remain on a topic while the message consumer is not active, no facility exists for examining them.

Wednesday, January 13, 2016

Git note

Git (DVCS)
Eclipse help on EGit is a good document to start Git
1. There is no master repository. No need to be online to perform actions.
2. Every changesets contain pointers to the previous changeset (with a unique hash value). Makes merge much easier.
3. Origin is the name of the default remote, but you can have many remotes per repository.
4. It's generally considered good practice to rebase changes prior to pushing to a remote tree to avoid these kind of fan-outs, but it's not necessary to do so.

Git Complete: The definitive, step-by-step guide to Git

1. Install Git
2.
Sign up and create a repository github-demo on (init with readme)
https://github.com
3.
Origin is the name of the default remote, but you can have many remotes per repository.
git config --list --show-origin
git version
git config --global user.name "xxx xxx"
git config --global user.email "xxxxxx@gmail.com"

You can verify this by the following two commands:
git config user.email
git config user.name

git config --global --list
git clone https://github.com/auspix/github-demo.git
git status
git add start.txt  --put the file from working directory to staging area
git commit -m "Adding start txt file" --move the file from staging to local repository
git push origin master --origin refers to the github copy of our repository, master refers to our default and only branch in the repository

4. Start with a fresh project
git init fresh-project
cd fresh-project/.git
cd ..
git status
5.
Download bootstap project from http://www.initializr.com/
cd C:\git\other_repo\initializr-verekia-4.0
git init
git status
git add .
git status
git commit -m "My first commit, inline"
git pull origin master --get changes from remote repo to local to make sure we are up-to-date, should always to a pull before a push
git push origin master
git help
git help pull
git help push
6.
go to the home folder, notepad++ .gitconfig
git config --global core.editor "'C:/Apps/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin"
git commit -am "Adding more messages" --to integrate add and commit into one single command
git ls-files    --show all tracked filese
git add .      --add all files under current folder recursivly
git reset HEAD level1-file.txt   --move back the file from staging to working area (opposite to git add level1-file.txt)
git checkout -- level1-file.txt  --discard changes in working directory and return to last commit
7.
git mv start.txt start2.txt  --rename the file name
git add -A      --add all files include the renaming and deletion, if you rename from OS, then use this command
git rm             --to delete the git indexed file
git log        --to show the commit history
git log -- level3-fileNEW.txt  --show the specified file log
8.
git diff                 --show the difference between working area and staging area
git diff HEAD       --show the difference between working area and local repo
git diff --staged HEAD  --show the difference between staging area and the local repo
git diff -- TheFile           --only compare the specified file
git diff master origin/masetr  --compare local repo with remote repo (origin/maseter)
9.
git branch mynewbranch    --create new branch
git checkout mynewbranch --switch to the new branch

10.
notepad++ .gitignore
fast forward merge is only possible if there's no commit on the target branch just like there's never new branch
git merge copyright-branch --no-ff      --disable fast forward merge
git checkout master
git merge simple-changes -m "Merging from branch simple-changes"

11.
git stash         --record the current state of the working directory and the index, but go back to a clean working directory.
git stash apply   --Like pop, but do not remove the state from the stash list.
git stash list    --show the stash
git stash drop    --drop the stash

12.
git tag myTag     --just a marker/label on current command (for milestone ...)
git tag --list
git tag --delete myTag

git push -u origin myNewBranch  # Pushes your newly created local branch "myNewBranch"
                                 # to the remote "origin".
To list all the remotes, run git remote


git pull = git fetch+ git merge。pull的话,拉取远程分支并与本地分支合并,fetch只是拉远程分支,怎么合并,可以自己再做选择。