-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathmessenger_component.yaml
202 lines (202 loc) · 10.5 KB
/
messenger_component.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
questions:
-
uuid: 1ef49385-74c4-6e6e-b737-4b08f544bc6d
question: 'What method is executed when a message handler must perform an action?'
answers:
- { value: __invoke(), correct: true }
- { value: __construct(), correct: false }
- { value: execute(), correct: false }
- { value: index(), correct: false }
- { value: executeMessage(), correct: false }
help: 'https://symfony.com/doc/current/messenger.html'
-
uuid: 1ef49b32-ed82-6f72-823e-b36d0cd66b14
question: 'Which class needs to be implemented to define a message handler in Symfony Messenger?'
answers:
- { value: MessageHandlerInterface, correct: true }
- { value: HandlerInterface, correct: false }
- { value: MessageBusInterface, correct: false }
- { value: CommandHandlerInterface, correct: false }
help: 'https://symfony.com/doc/current/components/messenger.html'
-
uuid: 1ef49b3d-c27f-6edc-af9a-b775eebcd083
question: 'Which method must be implemented in a message handler class to process the message in Symfony Messenger?'
answers:
- { value: handle, correct: false }
- { value: process, correct: false }
- { value: execute, correct: false }
- { value: __invoke, correct: true }
help: 'https://symfony.com/doc/current/messenger.html#creating-a-message-handler'
-
uuid: 1ef49b43-add0-69a4-b8d9-4b7e2b04a9ae
question: 'Which component of Symfony Messenger is used to send messages to different queues or transports?'
answers:
- { value: MessageBus, correct: false }
- { value: TransportInterface, correct: true }
- { value: MessengerInterface, correct: false }
- { value: RoutingKeyMiddleware, correct: false }
help: 'https://symfony.com/doc/current/messenger/custom-transport.html#register-your-factory'
-
uuid: 1ef49b5a-8ebf-6472-82c5-f5810e093800
question: 'How do you configure the DSN for a transport in Symfony Messenger to send messages to a RabbitMQ queue?'
answers:
- { value: 'rabbitmq://localhost/%2f/messages', correct: true }
- { value: 'rabbitmq://localhost/messages', correct: false }
- { value: 'amqp://localhost/messages', correct: false }
- { value: 'rabbitmq://localhost/%2f', correct: false }
help: 'https://symfony.com/doc/current/messenger.html#amqp-transport'
-
uuid: 1ef49b6a-03e9-60ae-9839-151e1bbfbae8
question: 'Which Symfony component must be installed to use the redis transport with Messenger?'
answers:
- { value: symfony/redis-messenger, correct: true }
- { value: symfony/redis, correct: false }
- { value: predis/predis, correct: false }
- { value: symfony/redis-transport, correct: false }
help: 'https://symfony.com/doc/current/messenger.html#redis-transport'
-
uuid: 1ef49b71-c667-6ade-97e5-510b604738c4
question: 'Which component should a class use to configure a custom retry strategy in messenger ?'
answers:
- { value: RetryStrategyInterface, correct: true }
- { value: RetryStrategyTrait, correct: false }
- { value: RetryStrategyController, correct: false }
- { value: RetryMiddleware, correct: false }
help: 'https://github.com/symfony/messenger/blob/7.1/Retry/RetryStrategyInterface.php'
-
uuid: 1ef49b77-ad91-6d24-a5f3-c9434be6fb85
question: 'Which attribute must be defined to mark a class which would be the handle of a message in Symfony Messenger?'
answers:
- { value: MessageHandler, correct: false }
- { value: AsMessageHandler, correct: true }
- { value: UseMessageHandler, correct: false }
- { value: Message/Handler, correct: false }
help: 'https://symfony.com/doc/current/messenger.html#creating-a-message-handler'
-
uuid: 1ef49b7c-d78b-6fa8-8472-b5061fc52ec4
question: 'Which kind of attribute can be set in a message class, in messenger component ?'
answers:
- { value: string, correct: true }
- { value: int, correct: true }
- { value: bool, correct: true }
- { value: DateTime, correct: false }
- { value: 'User::class', correct: false }
help: 'https://symfony.com/doc/current/messenger.html#creating-a-message-handler'
-
uuid: 1ef49b83-7500-65c6-b269-fdf9f108d0d1
question: 'By default, messages from symfony messenger are handled ?'
answers:
- { value: 'as soon as they are dispatched', correct: true }
- { value: asynchronously, correct: false }
help: 'https://symfony.com/doc/current/messenger.html#transports-async-queued-messages'
-
uuid: 1ef49b8a-09e4-6fec-a9ab-8793efe503c1
question: 'What happened to a message which would not be matched under framework.messenger.routing configuration ?'
answers:
- { value: 'it will be handled immediatly, synchronously', correct: true }
- { value: 'it will be handled with your default transport', correct: false }
- { value: 'it will be handled with your first transport configured', correct: false }
help: 'https://symfony.com/doc/current/messenger.html#routing-messages-to-a-transport'
-
uuid: 1ef49b92-3779-6a68-996c-71981116b221
question: "In Messenger component, is it true, that you can set the class' interface in the framework.messenger.routing instead of setting the real class ?"
answers:
- { value: 'Yes', correct: true }
- { value: 'No', correct: false }
help: 'https://symfony.com/doc/current/messenger.html#routing-messages-to-a-transport'
-
uuid: 1ef49b97-8daf-68ec-bcf4-6b7bdfa36311
question: 'In Messenger, if i set multiple transport to a message, which one will be executed ?'
answers:
- { value: 'all of them', correct: true }
- { value: 'the first one', correct: false }
- { value: 'the last one', correct: false }
- { value: 'OnlyOneTransportException will be thrown', correct: false }
help: 'https://symfony.com/doc/current/messenger.html#routing-messages-to-a-transport'
-
uuid: 1ef49b9e-18f5-6acc-b5b5-4b14a152d2a2
question: 'In Symfony Messenger, what is the best way to get a fresh data ?'
answers:
- { value: 'use $manager->refresh($entity);', correct: false }
- { value: "pass the entity's primary key in the message parameter to query for a fresh object:", correct: true }
- { value: "you can't get a fresh object", correct: false }
help: 'https://symfony.com/doc/current/messenger.html#doctrine-entities-in-messages'
-
uuid: 1ef49ba7-bdcb-6e3a-bb69-7f93a36679e9
question: 'Which parameters permits to not let workers run forever in messenger ?'
answers:
- { value: '--memory-limit=128M', correct: true }
- { value: '--memory-allowed=128M', correct: false }
- { value: '--time-allowed=3600', correct: false }
- { value: '--time-limit=3600', correct: true }
- { value: '--limit=10', correct: true }
- { value: '--number-limit=10', correct: false }
help: 'https://symfony.com/doc/current/messenger.html#deploying-to-production'
-
uuid: 1ef49bad-0557-6128-829c-4d97f2bce514
question: 'How can you set priorities in messenger component ?'
answers:
- { value: 'by sorting them in the prompt', correct: true }
- { value: 'by adding a priority options in the dispatch method', correct: false }
- { value: 'with a configuration in your database', correct: false }
help: 'https://symfony.com/doc/current/messenger.html#prioritized-transports'
-
uuid: 1ef49bb7-182e-6dd2-ade6-a5859cdffd9c
question: 'Which Exception should you throw to be sure that your message will be retried ?'
answers:
- { value: RecoverableMessageHandlingException, correct: true }
- { value: RetryMessageHandlingException, correct: false }
- { value: FailedMessageHandlingException, correct: false }
- { value: RetryableMessageHandlingException, correct: false }
help: 'https://symfony.com/doc/current/messenger.html#forcing-retrying'
-
uuid: 1ef49beb-2890-6462-8776-1ff5a7a3bd3f
question: 'Which Message permits to execute a symfony command in messenger ?'
answers:
- { value: RunCommandMessage, correct: true }
- { value: ExecuteMessage, correct: false }
- { value: CommandMessage, correct: false }
- { value: PromptMessage, correct: false }
help: 'https://symfony.com/doc/current/messenger.html#trigger-a-command'
-
uuid: 1ef49bf0-807e-608e-be42-d1b1435371a4
question: 'Which Message permits to execute an external process, a command like ls -la in symfony messenger ?'
answers:
- { value: RunProcessMessage, correct: true }
- { value: PromptMessage, correct: false }
- { value: RunCommandMessage, correct: false }
- { value: ProcessMessage, correct: false }
help: 'https://symfony.com/doc/current/messenger.html#trigger-an-external-process'
-
uuid: 1ef49bf5-b58f-658e-a7a8-a521640d697c
question: 'Which Message permits to request an url, in symfony messenger ?'
answers:
- { value: PingWebhookMessage, correct: true }
- { value: HttpRequestMessage, correct: false }
- { value: HttpPingMessage, correct: false }
- { value: HttpMessage, correct: false }
- { value: GuzzleMessage, correct: false }
help: 'https://symfony.com/doc/current/messenger.html#pinging-a-webservice'
-
uuid: 1ef49c01-1b3a-6c20-951d-cd6c0db5ee76
question: 'A single handler class can handle multiple messages. For that, add the @AsMessageHandler attribute to all handling methods.'
answers:
- { value: 'True', correct: true }
- { value: 'False', correct: false }
help: 'https://symfony.com/doc/current/messenger.html#handling-multiple-messages'
-
uuid: 1ef49c12-2100-641e-bd3c-2fdbb8719653
question: 'Is it possible to consume messages by batch in symfony messenger ?'
answers:
- { value: 'no, messenger can only consume one by one', correct: false }
- { value: 'yes by doing adding a parameter --batch-size=100', correct: false }
- { value: 'Yes by implementing BatchHandlerInterface and using BatchHandlerTrait', correct: true }
help: 'https://symfony.com/doc/current/messenger.html#process-messages-by-batches'
-
uuid: 1ef49c19-7356-64d2-9162-1f6905a0dca8
question: 'Is it possible to set a delay before executing a message in symfony messenger ?'
answers:
- { value: 'No, they are executed one after the other', correct: false }
- { value: 'Yes by configuring delay_stamp in the transport configuration', correct: false }
- { value: 'Yes, by adding a DelayStamp in the dispatch', correct: true }
help: 'https://symfony.com/doc/current/messenger.html#envelopes-stamps'