Skip to content
This repository has been archived by the owner on Nov 29, 2022. It is now read-only.

Commit

Permalink
delete delay time to send message
Browse files Browse the repository at this point in the history
  • Loading branch information
문정기 committed Feb 20, 2020
1 parent f1a7c96 commit 43700c6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Add Function `getQueueAttributes` and Dto `SqsQueueAttributeDto` in `SqsService`

### Fixed
- Fix Function `sendMessage` that When Sending message to queue, the delivery delay time follows what queue applies
- Fix Function `sendMessage` that doesn't contain delay time in param to send message to use default value
: `If you don't specify a value, the default value for the queue applies.`
: https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-sqs-2012-11-05.html#sendmessage

### Removed
- Removed fourth param `delay_seconds` from function `sendMessage`: ref #Fixed-01
Expand Down
5 changes: 1 addition & 4 deletions lib/AWS/SqsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,11 @@ public function getQueueAttributes(string $queue_url): ?SqsQueueAttributeDto
*/
public function sendMessage(string $queue_url, array $attributes, string $message): void
{
$queue_attribute_dto = $this->getQueueAttributes($queue_url);

if (StringUtils::isEmpty($queue_url) || $queue_attribute_dto === null) {
if (StringUtils::isEmpty($queue_url)) {
throw new MsgException('invalid queue url');
}

$params = [
'DelaySeconds' => $queue_attribute_dto->delay_seconds,
'MessageAttributes' => $attributes,
'QueueUrl' => $queue_url,
'MessageBody' => $message,
Expand Down

0 comments on commit 43700c6

Please sign in to comment.