-
-
Notifications
You must be signed in to change notification settings - Fork 631
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
Add Enqueue recipes. #16
Conversation
@@ -0,0 +1,23 @@ | |||
enqueue: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I posted a comment that I removed, don't mind it, I didn't see that there were more recipes than just one in this PR)
It seems that this recipe is made for enqueue/amqp-ext
, but actually this config file is intended to be used together with the enqueue/enqueue-bundle
package, so it seems a bit wrong to put this config file in here.
Maybe this shows something we could propose as a new feature for flex: if specific package is installed, install more configuration, else, just "suggest" it.
Actually, enqueue/enqueue-bundle
package should suggest enqueue/amqp-ext
if it's something that could be used with it.
Maybe this is something that could be improved both on Flex side ( => add config files depending on whether another package is installed or not) on your bundle side (suggest more extensions directly in the bundle so the user can know that other extensions exist for the EnqueueBundle
bundle and that they are automatically (I didn't check so, I may be wrong by saying that) activated when using the bundle if the package is installed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imagine Bundle could benefit from such selective config, as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this shows something we could propose as a new feature for flex: if specific package is installed, install more configuration, else, just "suggest" it.
This might be a solution, though I support the point not to adding conditions to recipes.
The packs could be a solution to my problem. You do not install the bundle and amqp-ext separately but a enqueue/amqp-pack
package. It installs the bundle and the transport and puts required configuration where needed
enqueue/fs/0.3/manifest.json
Outdated
"ENQUEUE_FS_STORAGE": "%VAR%/queue" | ||
}, | ||
"gitignore": [ | ||
"/var/queue" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the whole content of var
is already ignored in git, so this seems useless
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I know. It is done this way just for that case when framework bundle is not installed. The var folder ignore rule is added only when you install the framework bundle.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could remove it if the case is not something we should worry about.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Framework bundle is a requirement, it cannot be uninstalled or not installed, so this is safe to remove.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw, your own enqueue-bundle depends on FrameworkBundle 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I overcomplicated things. fixed.
enqueue/fs/0.3/manifest.json
Outdated
"var/": "%VAR_DIR%" | ||
}, | ||
"env": { | ||
"ENQUEUE_FS_STORAGE": "%VAR%/queue" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you sure about %VAR%
here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
port: '%env(ENQUEUE_AMQP_PORT)%' | ||
login: '%env(ENQUEUE_AMQP_LOGIN)%' | ||
password: '%env(ENQUEUE_AMQP_PASSWORD)%' | ||
vhost: '%env(ENQUEUE_AMQP_VHOST)%' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've have had a look, but do you support a URL/DSN as well? That's what we are using for Doctrine and Swiftmailer, so that would be great if possible to do the same here as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed here. PaaS expose credentials as a URL, so this config is not usable drop-in on such PaaS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@@ -0,0 +1 @@ | |||
[Enqueue] Run <comment>make consume</> command to consume messages |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would remove this as the post install script if for things you need to do to make things work. It should not replace proper documentation of the package.
enqueue/fs/0.3/manifest.json
Outdated
{ | ||
"copy-from-recipe": { | ||
"etc/": "%ETC_DIR%/", | ||
"var/": "%VAR_DIR%" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the var/queue/.gitkeep
really needed? The package should be able to create it when it does not exist, right?
# port: '%env(ENQUEUE_AMQP_PORT)%' | ||
# login: '%env(ENQUEUE_AMQP_LOGIN)%' | ||
# password: '%env(ENQUEUE_AMQP_PASSWORD)%' | ||
# vhost: '%env(ENQUEUE_AMQP_VHOST)%' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The whole config seems to be the same as the default one, except for the option. What about adding the comment on the default config with the explanation you have above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The transport name (a key) is different: amqp
and rabbitmq_amqp
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then the If you use RabbitMQ broker ...
part could just say "rename amqp
with rabbitmq_amqp
and the bundle will enable specific features ..."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
Did you close on purpose? |
it was closed when I merged php-enqueue/enqueue-dev#78. I wrote there "fixes XXX". |
@@ -0,0 +1,6 @@ | |||
enqueue: | |||
transport: | |||
default: 'null' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This 'null'
value must be a string or could be a normal null
value instead?
enqueue: | ||
transport: | ||
default: 'null' | ||
'null': ~ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this line: 'null': ~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it defines the configuration for the NullTransport. But the key must be quoted in YAML, as unquoting it would parse it as null
, not as the string 'null'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is extremely confusing to me: a "default transport" which is a null string ... which then is a "null transport" with a null value. Can we think a better approach for this? A new config option for tests maybe? Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@javiereguiluz In this context 'null' is the name of the transport. The transport does not send nor receive anything. It is there just to mock a messaging API and useful in tests for example.
I've not come up with a better name for the transport.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noop ? Blackhole ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe, but not now. That's a huge change and would take time. I'll do it later on.
Is it a blocker?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having a "null" object is very common and is, of course, a well know design pattern; why are we trying to rename something that already describes exactly what the transport is?
enqueue/fs/0.3/manifest.json
Outdated
"var/": "%VAR_DIR%" | ||
}, | ||
"env": { | ||
"ENQUEUE_FS_STORAGE": "%VAR_DIR%/queue" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just asking. If the bundles is called "enqueue", should the var/ dir be called "enqueue/" too? The "queue" name is too generic ... what if someday Symfony releases a Queue component or bundle?
I address all the review comments but the PR still red. It says (@stof stof requested changes). What should I do to this? |
@stof needs to dismiss his review and someone else (including stof) need to approve the PR. |
@@ -0,0 +1,5 @@ | |||
{ | |||
"env": { | |||
"ENQUEUE_DSN": "file:/%VAR_DIR%/enqueue" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will the library take care to create the directory if it does not exist yet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -0,0 +1,5 @@ | |||
{ | |||
"env": { | |||
"ENQUEUE_DSN": "file:/%VAR_DIR%/enqueue" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we use here file://
instead of file:/
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it a problem?
On Unix system, using file://
will result in paths like file:///var/www/dev/enqueue
which might not work, whereas on windows it will result in file://e:/www/dev/enqueue
which should work.
Dunno how to fix this 😱
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know about Linux, but on macOS file:///var/www/dev/enqueue
not only works, but it's the only way this can work: 3 /
after file:
is normal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok nevermind, I tested on my ubuntu distro and file:///
works, once again I should check before talking
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I opened the issue. It'will be fixed.
This pull request adds a Symfony Flex recipe for Enqueue bundle and two transports
filesystem
andamqp
.Enqueue provides solutions to deal with message queues.