-
-
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
Changes from 2 commits
ae9a9f6
3ad516f
1e47192
f432413
0911f27
fbd9322
e1e0723
0fc35f2
95f1347
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
enqueue: | ||
transport: | ||
default: 'amqp' | ||
amqp: | ||
host: '%env(ENQUEUE_AMQP_HOST)%' | ||
port: '%env(ENQUEUE_AMQP_PORT)%' | ||
login: '%env(ENQUEUE_AMQP_LOGIN)%' | ||
password: '%env(ENQUEUE_AMQP_PASSWORD)%' | ||
vhost: '%env(ENQUEUE_AMQP_VHOST)%' | ||
|
||
# If you use RabbitMQ broker you can replace amqp transport with this one. It enables specific features like priorities, delays. | ||
# default: 'rabbitmq_amqp' | ||
# rabbitmq_amqp: | ||
# | ||
# host: '%env(ENQUEUE_AMQP_HOST)%' | ||
# 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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. The transport name (a key) is different: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Then the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed |
||
# | ||
# # The option tells whether RabbitMQ broker has delay plugin installed or not | ||
# delay_plugin_installed: false | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"copy-from-recipe": { | ||
"etc/": "%ETC_DIR%/" | ||
}, | ||
"env": { | ||
"ENQUEUE_AMQP_HOST": "localhost", | ||
"ENQUEUE_AMQP_PORT": "5672", | ||
"ENQUEUE_AMQP_LOGIN": "guest", | ||
"ENQUEUE_AMQP_PASSWORD": "guest", | ||
"ENQUEUE_AMQP_VHOST": "/" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
consume: | ||
@test -f bin/console && bin/console enqueue:consume --setup-broker || echo "cannot consume messages (needs symfony/console)" | ||
.PHONY: consume | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this can be removed as well. We don't want to wrap all Symfony CLI commands as make tasks. We are using Makefile tasks for when this is not practical or not possible to use the Symfony CLI. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
enqueue: | ||
transport: | ||
default: 'null' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This |
||
'null': ~ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand this line: There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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 commentThe 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 commentThe 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 commentThe 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? |
||
client: | ||
traceable_producer: true |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"bundles": { | ||
"Enqueue\\Bundle\\EnqueueBundle": ["all"] | ||
}, | ||
"copy-from-recipe": { | ||
"etc/": "%ETC_DIR%/" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 commentThe 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. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
enqueue: | ||
transport: | ||
default: 'fs' | ||
fs: | ||
store_dir: '%env(ENQUEUE_FS_STORAGE)%' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"copy-from-recipe": { | ||
"etc/": "%ETC_DIR%/", | ||
"var/": "%VAR_DIR%" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the |
||
}, | ||
"env": { | ||
"ENQUEUE_FS_STORAGE": "%VAR_DIR%/queue" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? |
||
}, | ||
"gitignore": [ | ||
"/var/queue" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the whole content of There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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 commentThe 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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. I overcomplicated things. fixed. |
||
] | ||
} |
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