-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathApp.java
30 lines (23 loc) · 849 Bytes
/
App.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package org.bal.starter;
import org.bal.config.ProducerConfiguration;
import org.bal.producer.Producer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import static java.lang.Thread.sleep;
@SpringBootApplication(scanBasePackageClasses = {ProducerConfiguration.class}, scanBasePackages = "org.bal")
public class App implements CommandLineRunner {
@Autowired
private Producer producer;
public static void main(String[] args) {
SpringApplication.run(App.class, args);
}
@Override
public void run(String... args) throws Exception {
for (int i = 0; i < 1000; i++){
producer.send("Message is: " + System.currentTimeMillis());
sleep(10);
}
}
}