I'm experiencing a strange issue with Amazon SNS. When I publish a message using the AWS UI (publish to topic button), messages are delivered immediately.
But when I publish a message to the same topic from inside a lambda function, messages will either not be delivered, or will be delivered after some more messages are published by future invocations of the lambda.
What could be different?
Update
I tried publishing with the AWS CLI cool, and that works fine also.
I'm using the Java SNS library for my lambda. I'm using the default credentials of the lambda. I construct the PublishRequest with just the topic ARN, message, and subject. The publish call returns successfully, and I see it my logs in the cloudwatch logs.
What would cause an SNS message to delay in being delivered until more SNS messages are sent? I'm testing out with both Email and SQS subscriptions - both behave the same.