小编Die*_*ães的帖子

用于创建EMR群集的Lambda不会触发群集创建

我正在尝试运行一个创建集群的λ代码,但没有任何反应,也许我误解了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)

amazon-web-services node.js emr gruntjs aws-lambda

9
推荐指数
1
解决办法
2136
查看次数

带有 Spring Boot 的 Spring 批处理在子进程使用 AsyncItemProcessor 之前终止

我正在将 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

2
推荐指数
1
解决办法
2715
查看次数