Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

env variables config #139

Open
Strick3r opened this issue Apr 19, 2018 · 2 comments
Open

env variables config #139

Strick3r opened this issue Apr 19, 2018 · 2 comments

Comments

@Strick3r
Copy link

Hi!
I'm using symfony 4 and when I try to set the config parameters fom env variables, a throw execption is launched because try to check if the queue name finish with ".fifo"

//qpush.yaml
uecode_qpush:
logging_enabled: true
providers:
opta:
driver: aws
region: '%env(AWS_SQS_REGION)%'
queues:
opta_messaging:
provider: opta
options:
message_timeout: 30
queue_name: '%env(resolve:AWS_SQS_QUEUE_NAME)%'
push_notifications: false
notification_retries: 3
message_delay: 0
message_expiration: 0
fifo: true
content_based_deduplication: false
messages_to_receive: 1
receive_wait_time: 3

//.env
###> aws/aws-sdk-php-symfony ###
AWS_SQS_REGION=us-east-2
AWS_SQS_QUEUE_NAME=testing.fifo
###< aws/aws-sdk-php-symfony ###

The env variables are encripted, then the real name is not set. As you see I trie to use the resolve in the env variable, but not function.

Thank you.

@ebarault
Copy link

I'm also struggling with this

This block checks the name of the queue at compile time and hence any attempt to use '%env(...)%' in the bundle's config fails as the following regex executes on the actual string '%env(...)%'

// Check queue name ends with ".fifo"
$isQueueNameFIFOReady = preg_match("/$(?<=(\.fifo))/", $values['options']['queue_name']) === 1;
if ($values['options']['fifo'] === true && !$isQueueNameFIFOReady) {
     throw new InvalidArgumentException('Queue name must end with ".fifo" on AWS FIFO queues');
}

Would it be possible to remove this check, or would you think of an alternative?

@Strick3r
Copy link
Author

At the moment I think that the best way is remove this check, because in other part of the code this is checked (isQueueFIFO()), but only the option, it's posible to add there the regex expression also to check the name?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants