我正在尝试运行一个创建集群的λ代码,但没有任何反应,也许我误解了Node上的用法(因为我对它并不熟悉).
功能很简单:
// configure AWS Dependecies
var AWS = require('aws-sdk');
exports.handler = function(event, context) {
// EMR Client
var emr = new AWS.EMR({apiVersion: '2009-03-31', region: 'us-east-1'});
var params = {... dozens of params describing jobs ...};
var AWSRequest = emr.runJobFlow(params);
AWSRequest
.on('success', function(response){ console.log("success => " + response)})
.on('error', function(response){ console.log("error => " + response)})
.on('complete', function(response){ console.log("complete => " + response)})
.send( function(err, data){
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
context.done(null, …Run Code Online (Sandbox Code Playgroud) 我正在将 Spring Batch 与 AsyncItemProcessor 一起使用,并且事情的表现出乎意料。让我先展示一下代码:
按照Spring Batch 项目中所示的简单示例进行操作:
@EnableBatchProcessing
@SpringBootApplication
@Import({HttpClientConfigurer.class, BatchJobConfigurer.class})
public class PerfilEletricoApp {
public static void main(String[] args) throws Exception {// NOSONAR
System.exit(SpringApplication.exit(SpringApplication.run(PerfilEletricoApp.class, args)));
//SpringApplication.run(PerfilEletricoApp.class, args);
}
}
Run Code Online (Sandbox Code Playgroud)
- 编辑
如果我只是让主进程休眠,请给 slf4j 几秒钟的时间来写入刷新日志,一切都会按预期进行。
@EnableBatchProcessing
@SpringBootApplication
@Import({HttpClientConfigurer.class, BatchJobConfigurer.class})
public class PerfilEletricoApp {
public static void main(String[] args) throws Exception {// NOSONAR
//System.exit(SpringApplication.exit(SpringApplication.run(PerfilEletricoApp.class, args)));
ConfigurableApplicationContext context = SpringApplication.run(PerfilEletricoApp.class, args);
Thread.sleep(1000 * 5);
System.exit(SpringApplication.exit(context));
}
Run Code Online (Sandbox Code Playgroud)
}
-- 结束编辑
我正在读取一个带有字段的文本文件,然后使用 AsyncItemProcessor 进行多线程处理,其中包括 URL 上的 Http GET 以获取一些数据,我还使用 NoOpWriter …
spring asynchronous spring-integration spring-batch spring-boot
asynchronous ×1
aws-lambda ×1
emr ×1
gruntjs ×1
node.js ×1
spring ×1
spring-batch ×1
spring-boot ×1