小编Aru*_*han的帖子

SQS-交付延迟30分钟

从SQS的文档中,我们可以配置一条消息以使其对消费者隐藏的最大延迟时间是15分钟- -http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-delay-queues.html

假设我需要隐藏一天的邮件,模式是什么?例如。我想模仿做某事的每日cron。

谢谢

amazon-sqs amazon-web-services

8
推荐指数
3
解决办法
8527
查看次数

Spring Boot的ResourceNotFoundException在哪里?

我们曾经org.springframework.boot.context.config.ResourceNotFoundException在 Spring Boot 1.5.4 中使用过。Spring Boot 2.0 中这个在哪里(2.0.4.RELEASE)

spring-boot

7
推荐指数
1
解决办法
8990
查看次数

Spring启动CommandLineRunner异常处理

我们使用Spring-boot作为命令行应用程序.我们使用javax.validation来验证命令行参数.

现在,如果我们有验证错误,我们如何打印友好的错误消息?我们不想显示堆栈跟踪.

我们在运行Spring-boot作为CommandLineRunner时是否可以使用ExceptionHandler机制?

谢谢阿伦

资源

    @SpringBootApplication
    public class Deploy implements CommandLineRunner {
    private static final Logger LOGGER = LoggerFactory.getLogger(Deploy.class);

    @Autowired
    private DeployConfig config;

    @Autowired
    private DeployService deployService;

    /**
     * mvn clean package spring-boot:repackage
     * java -jar target/spring-boot-example-1.0.0-SNAPSHOT.jar --spring.profiles.active=qa --version=1.0
     *
     * @param strings arguments
     * @throws Exception
     */

    @Override
    public void run(String... strings) throws Exception {
        try {
            deployService.deploy(config);
        } catch (Exception ve) {
            LOGGER.error("Error : {}", ve.getMessage());
        }

        LOGGER.info("Created stack={}", config.getVersion());
    }

    public static void main(String... args) {
        LOGGER.info("Starting …
Run Code Online (Sandbox Code Playgroud)

java validation spring spring-boot

6
推荐指数
1
解决办法
1万
查看次数

Nginx proxy_pass通过https_proxy

我正在尝试使用此配置设置Nginx。要访问backend.mygreat.server.com,我必须通过我的公司代理,即myproxy.server.com:80。

因此,我在/ etc / environment中添加了它

https_proxy=myproxy.server.com:80
Run Code Online (Sandbox Code Playgroud)

但是,nginx无法访问https://backend.mygreat.server.com:443。我在nginx日志中看到504作为HTTP状态。

我可以使用wget或curl来加载页面(通过公司代理进行)

  server {
        listen  443;
        server_name  mygreat.server.com;
        ssl  on;
        ssl_protocols  TLSv1.1 TLSv1.2;
        ssl_prefer_server_ciphers on;
        ssl_ciphers EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA384:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH:EDH+aRSA:!aNULL:!eNULL:!LOW:!RC4:!3DES:!MD5:!EXP:!PSK:!SRP:!SEED:!DSS:!CAMELLIA;

        ssl_certificate /etc/nginx/ssl/mygreat.server.com.pem;
        ssl_certificate_key /etc/nginx/ssl/mygreat.server.com.key;

        access_log  /var/log/nginx/access.ssl.log;

        location / {
          proxy_set_header X-Real-IP  $remote_addr;
          proxy_set_header Host-Real-IP  $http_host;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header X-Real-Pcol http;

          proxy_intercept_errors on;
          error_page 301 302 307 = @handle_redirects;      

          proxy_pass https://backend.mygreat.server.com:443;
        }

        location @handle_redirects {
            set $saved_redirect_location '$upstream_http_location';
            proxy_pass $saved_redirect_location;
        }    
    }
Run Code Online (Sandbox Code Playgroud)

任何帮助是极大的赞赏。

谢谢

更新:

这是来自Nginx的示例错误日志

2017/10/18 06:55:51 [warn] 34604#34604: *1 upstream server temporarily disabled …
Run Code Online (Sandbox Code Playgroud)

nginx http-proxy proxypass

5
推荐指数
1
解决办法
8501
查看次数

如何描述VPC的安全组?

有没有办法在特定的VPC中描述安全组?

这是我想要运行的:

aws ec2 describe-security-groups --group-name "<group-name>" --filter Name=vpc-id,Values=<my-vpc-id>
Run Code Online (Sandbox Code Playgroud)

但是它返回了这个错误:

A client error (VPCIdNotSpecified) occurred when calling the DescribeSecurityGroups operation: No default VPC for this user
Run Code Online (Sandbox Code Playgroud)

我感谢您的帮助,

谢谢

amazon-web-services aws-cloudformation aws-cli aws-security-group

3
推荐指数
1
解决办法
3195
查看次数