예제 #1
0
 private static void completeBatch(ApplicationContext context) throws InterruptedException {
   OrderGateway orderGateway = context.getBean(OrderGateway.class);
   orderGateway.completeBatch(10);
   Thread.sleep(5_000);
 }
예제 #2
0
 private static void placeOrders(int orders, ApplicationContext context) {
   OrderGateway orderGateway = context.getBean(OrderGateway.class);
   IntStream.range(0, orders).parallel().forEach(i -> orderGateway.placeOrder());
 }