File tree 1 file changed +50
-0
lines changed
1 file changed +50
-0
lines changed Original file line number Diff line number Diff line change 1
1
# Debugging
2
2
3
+ ## Profiler
4
+
5
+ It may be useful to see what messages were sent during a http request.
6
+ The bundle provides a collector for Symfony [ profiler] ( http://symfony.com/doc/current/profiler.html ) .
7
+ The extension collects all sent messages
8
+
9
+ To enable profiler
10
+
11
+ ``` yaml
12
+ # app/config/config_dev.yml
13
+
14
+ enqueue :
15
+ client :
16
+ traceable_producer : true
17
+ ` ` `
18
+
19
+ Now suppose you have this code in an action:
20
+
21
+ ` ` ` php
22
+ <?php
23
+
24
+ use Symfony\Bundle\FrameworkBundle\Controller\Controller;
25
+ use Symfony\Component\HttpFoundation\Request;
26
+ use Enqueue\Client\Message;
27
+ use Enqueue\Client\MessageProducerInterface;
28
+
29
+ class DefaultController extends Controller
30
+ /**
31
+ * @Route("/", name="homepage")
32
+ */
33
+ public function indexAction(Request $request)
34
+ {
35
+ /** @var MessageProducerInterface $producer */
36
+ $producer = $this->get('enqueue.message_producer');
37
+
38
+ $producer->send('foo_topic', 'Hello world');
39
+
40
+ $producer->send('bar_topic', ['bar' => 'val']);
41
+
42
+ $message = new Message();
43
+ $message->setBody('baz');
44
+ $producer->send('baz_topic', $message);
45
+
46
+ // ...
47
+ }
48
+
49
+ ```
50
+
51
+ For this action you may see something like this in the profiler:
52
+
3
53
[ back to index] ( ../index.md )
You can’t perform that action at this time.
0 commit comments