0
안녕하세요 Spring 통합을 사용하고 및 RestControllerSpring RestController에서 비동기 게이트웨이를 시작한 다음 메시지를 다음 채널로 전달하는 방법은 무엇입니까?
<int:gateway id="reportsService"
service-interface="me.service.MyReportingGateway"
default-request-channel="reportsRequestChannel" />
<int:channel id="reportsRequestChannel" >
<int:dispatcher task-executor="reportServiceExecutor" /></int:channel>
<task:executor id="reportServiceExecutor" pool-size="5" />
<int:service-activator input-channel="reportsRequestChannel" output-channel="reportRouterChannel">
<bean id="reportServiceExecutor" class="me.service.SpecReporting"/>
</int:service-activator>
<int:channel id="reportRouterChannel" />
<int:router input-channel="reportRouterChannel" method="routeReport" ref="reportRouter"></int:router>
<bean class="me.service.ReportRequestRouter" id="reportRouter">
</bean>
<int:channel id="report01Channel">
<int:queue capacity="10"></int:queue>
</int:channel>
<int:channel id="report02Channel">
<int:queue capacity="10"></int:queue>
</int:channel>
<!-- for the channels -->
<int:poller default="true" fixed-delay="1000" id="poller"></int:poller>
<int:service-activator input-channel="report01Channel"
output-channel="CallbackChannel" ref="filewriter" method="writeFile">
</int:service-activator>
<int:service-activator input-channel="report02Channel"
output-channel="CallbackChannel" ref="filewriter" method="writeFile">
</int:service-activator>
<bean class="me.service.CsvFileWriter" id="filewriter"></bean>
<int:channel id="CallbackChannel" />
<int-http:outbound-gateway id="httpOutbound"
request-channel="CallbackChannel"
http-method="GET"
url="http://localhost:8080/services/ping" />
내 RestController에 게이트웨이를 주입 한 게이트웨이 주입 :
@Autowired
MyReporting reportsService;
를 상기 제어기에있어서 내부 메소드를 호출
HttpStatus httpStatus = HttpStatus.OK;
ReportingResponse arr = new ReportingResponse();
AppError ae = new AppError();
ae.setCode("ANP-SM-1000");
ae.setDescription("Everything Criss!!");
arr.setErrors(ae);
logger.debug("Invoking: reportsService.createReport...");
// Async - this will start the report generation process
reportsService.createReport(reportId,rInput);
return new ResponseEntity<ReportingResponse>(arr, httpStatus);
void return을 사용하여 executor-executor 채널을 구성한 이래 어떻게해야합니까? 이 스레드는 reportRouterChannel 인 다음 채널로 이동 하시겠습니까?