io.github.muxiaobai.spring_boot.service.DemoMoreService Maven / Gradle / Ivy
The newest version!
/**
* Project Name:spring-boot
* File Name:DemoService.java
* Package Name:io.github.muxiaobai.spring_boot.service
* Date:2019年3月21日下午7:31:58
* Copyright (c) 2019, All Rights Reserved.
*
*/
package io.github.muxiaobai.spring_boot.service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import io.github.muxiaobai.spring_boot.remoteService.RemoteServiceCall;
/**
* ClassName:DemoService
* Function: TODO
* Reason: TODO
* Date: 2019年3月21日 下午7:31:58
* @author Mu Xiaobai
* @version
* @since JDK 1.8
*/
@Service
public class DemoMoreService {
@Autowired
private RemoteServiceCall remoteCall;
LinkedBlockingQueue queue = new LinkedBlockingQueue();
public Map doRemote(String orderCode) throws InterruptedException, ExecutionException{
Request request = new Request();
request.orderCode = orderCode;
//jdk1.8
CompletableFuture