Comments (9)
Hi.
Could you please paste your whole configuration?
When you want to add extras
config, it should be put under the right processor. In your case, I think you're adding extra configuration for your consumer (which doesn't know how to deal with those options).
You can take a at the configuration reference to have an example.
from swarrotbundle.
Hi !
My config :
swarrot:
provider: pecl
default_connection: rabbitmq
default_command: swarrot.command.base
connections:
rabbitmq:
host: "%rabbitmq_host%"
port: "%rabbitmq_port%"
login: "%rabbitmq_user%"
password: "%rabbitmq_password%"
vhost: "%rabbitmq_vhost%"
consumers:
voip_valorize_call:
processor: voip.processor.valorize_call
middleware_stack: # order matter
- configurator: swarrot.processor.signal_handler
- configurator: swarrot.processor.max_messages
- configurator: swarrot.processor.max_execution_time
- configurator: swarrot.processor.exception_catcher
- configurator: app.processor_configurator.sentry_exception_catcher
- configurator: swarrot.processor.ack
extras:
max_messages: 100
max_execution_time: 300
The "extras" config works: when I execute the swarrot command without options 100 messages are handled.
But when I want to override this config with the --max-messages 1
option of the swarrot command, that doesn't works : 100 messages are handled, not 1
from swarrotbundle.
Your config should looks like this:
swarrot:
provider: pecl
default_connection: rabbitmq
default_command: swarrot.command.base
connections:
rabbitmq:
host: "%rabbitmq_host%"
port: "%rabbitmq_port%"
login: "%rabbitmq_user%"
password: "%rabbitmq_password%"
vhost: "%rabbitmq_vhost%"
consumers:
voip_valorize_call:
processor: voip.processor.valorize_call
middleware_stack: # order matter
- configurator: swarrot.processor.signal_handler
- configurator: swarrot.processor.max_messages
extras:
max_messages: 100
- configurator: swarrot.processor.max_execution_time
extras:
max_execution_time: 300
- configurator: swarrot.processor.exception_catcher
- configurator: app.processor_configurator.sentry_exception_catcher
- configurator: swarrot.processor.ack
Each extra config should be attached to the relevant configurator.
Can you confirm it works with this config?
I'll try to figure out why those options partly work when they are put under the customer instead of the right configurator.
BTW, I see that you're using a sentry_exception_catcher
. Is it possible to share your code? Maybe in a gist if you think it's not something which can be merged in swarrot?
from swarrotbundle.
@odolbeau That works, thanks for your help !
For sentry, the code is here : https://gist.github.com/notFloran/c0e5f6290c498c5bc18ae188ecd389f8
Do you think the code is ok for a PR ?
from swarrotbundle.
Sorry, just found some time to take a look at your gist.
The code looks good to me.
I never used Sentry mysel. Is the $data
a custom format you choose or is it documented somewhere?
Is there a limit a size for the data you sent?
Don't hesitate to open a PR for this Processor. :)
from swarrotbundle.
Sorry, just found some time to take a look at your gist.
no problem
The code looks good to me. I never used Sentry mysel. Is the $data a custom format you choose or is it documented somewhere?
$data
is documented here -> https://docs.sentry.io/clients/php/usage/#optional-attributes
tags are used to find events in sentry and extra are additional data for the context.
Is there a limit a size for the data you sent?
In the doc I find this : Extra contextual data is limited to 4096 characters.
I will do some tests at work next week.
from swarrotbundle.
Thanks. :)
from swarrotbundle.
sentry-php cut $data
when the lenght > 1024 -> https://github.com/getsentry/sentry-php/blob/master/lib/Raven/Serializer.php#L97
I will do a MR for the sentry processor.
from swarrotbundle.
Perfect. :)
Don't hesitate to add all those useful links into your MR. :)
from swarrotbundle.
Related Issues (20)
- Flex recipes ? HOT 2
- Problem when type hinting method process in PHP7 HOT 5
- dot in messages-types are lost in the command help HOT 1
- Why the message type is not used as the queue name by default HOT 3
- Symfony 4.3 deprecations HOT 3
- Symfony Messenger and Swarrot compatibility HOT 1
- Reset application after each consummed message HOT 1
- Install Fail HOT 2
- Allow users to attach aliases to Swarrot commands HOT 2
- Upgrade to 1.8 on Symfony 3.4 HOT 7
- make queue declare before consume queue HOT 1
- Make Swarrot commands lazy HOT 2
- Consumer on multiple queues HOT 3
- Port cannot be configured by env var HOT 2
- Upgrade Doctrine dependencies HOT 4
- AMQPS configuration
- Multiple hosts support HOT 2
- Symfony 6 compatibility HOT 1
- CI needs to migrate away from Travis
- Non-existed services HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swarrotbundle.