Skip to content

Commit c873894

Browse files
bug symfony#53910 [Messenger] Fix SQS visibility_timeout type (valtzu)
This PR was merged into the 5.4 branch. Discussion ---------- [Messenger] Fix SQS visibility_timeout type | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Introduced in symfony#53524 | License | MIT Getting an error after `composer update`: ``` Error thrown while running command "messenger:consume -- async". Message: "HTTP 400 returned for "https://sqs.eu-west-1.amazonaws.com/)". Code: SerializationException Message: STRING_VALUE can not be converted to an Integer Type: Detail: " ``` `async-aws/sqs` v2 is using JSON instead of `x-www-form-urlencoded` so now all of the sudden, types do matter. If you set `visibility_timeout` in the DSN, it will be sent as a string to SQS – so we need to cast it explicitly. Commits ------- 6683d4c Fix SQS visibility_timeout type
2 parents 0ffaa0a + 6683d4c commit c873894

File tree

1 file changed

+1
-1
lines changed
  • src/Symfony/Component/Messenger/Bridge/AmazonSqs/Transport

1 file changed

+1
-1
lines changed

src/Symfony/Component/Messenger/Bridge/AmazonSqs/Transport/Connection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public static function fromDsn(string $dsn, array $options = [], ?HttpClientInte
129129
'buffer_size' => (int) $options['buffer_size'],
130130
'wait_time' => (int) $options['wait_time'],
131131
'poll_timeout' => $options['poll_timeout'],
132-
'visibility_timeout' => $options['visibility_timeout'],
132+
'visibility_timeout' => null !== $options['visibility_timeout'] ? (int) $options['visibility_timeout'] : null,
133133
'auto_setup' => filter_var($options['auto_setup'], \FILTER_VALIDATE_BOOLEAN),
134134
'queue_name' => (string) $options['queue_name'],
135135
];

0 commit comments

Comments
 (0)