AWS SNS subscription not sending to HTTP

I have an SNS set up on an EC2 environment. Using SES I send emails, and want to send any bounces onto SNS, and then onto a HTTP page.

The topic has 2 subscriptions, email & HTTP. Both subscriptions have been confirmed. The email subscription works fine and I receive my json email no problem, but I get nothing on my php page, it doesn't even seem to be called.

php code:

if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
    $logString .= "Message Not A Postrn";
    http_response_code(405);
}

try {
    $message = Message::fromRawPostData();
    $logString .= "Message Receivedrn";

    $validator = new MessageValidator();
    $validator->validate($message);
    $logString .= "Message Validatedrn";
} catch (Exception $e) {
    $logString .= "Message Not Validatedrn";
    http_response_code(404);
}

if ($message->get('Type') === 'SubscriptionConfirmation') {
    $logString .= "Subscription Messagern";
    (new Client)->get($message->get('SubscribeURL'))->send();
    $logString .= "Subscription Response Sentrn";
} else if ($message->get('Type') === 'Notification') {       
    $logString .= $message['MessageId'] . ': ' . $message['Message'] . "rn";
}

Any thoughts apart from "Make sure the subscription is confirmed" would be much appreciated!

链接地址: http://www.djcxy.com/p/32224.html

上一篇: 订阅一个主题不需要确认申请?

下一篇: AWS SNS订阅不会发送到HTTP