Created
September 10, 2017 15:43
-
-
Save visparashar/6856291f74a2e326b07669c0b3a806f0 to your computer and use it in GitHub Desktop.
Main Class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.vp.activemq; | |
import com.vp.activemq.consumer.HelloWorldConsumer; | |
import com.vp.activemq.producer.HelloWorldProducer; | |
/** | |
* Hello world! | |
* | |
*/ | |
public class App | |
{ | |
public static void main( String[] args ) throws InterruptedException | |
{ | |
thread(new HelloWorldProducer(),false); | |
thread(new HelloWorldProducer(),false); | |
thread(new HelloWorldProducer(),false); | |
thread(new HelloWorldProducer(),false); | |
thread(new HelloWorldProducer(),false); | |
thread(new HelloWorldProducer(),false); | |
thread(new HelloWorldProducer(),false); | |
thread(new HelloWorldProducer(),false); | |
thread(new HelloWorldProducer(),false); | |
Thread.sleep(1000); | |
thread(new HelloWorldConsumer(),false); | |
thread(new HelloWorldConsumer(),false); | |
thread(new HelloWorldConsumer(),false); | |
thread(new HelloWorldConsumer(),false); | |
thread(new HelloWorldConsumer(),false); | |
thread(new HelloWorldConsumer(),false); | |
thread(new HelloWorldConsumer(),false); | |
thread(new HelloWorldConsumer(),false); | |
thread(new HelloWorldConsumer(),false); | |
} | |
public static void thread(Runnable run , boolean flag){ | |
Thread blockThread = new Thread(run); | |
blockThread.setDaemon(flag); | |
blockThread.start(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment