https://jnior.com/category/knowledgebase/java-code-sample/messagepump-javacodesample/