Using consumers with Laravel Telescope | Laravel Kafka              

 [ K Laravel Kafka ](/) [Docs](/docs) [Blog](https://laravelkafka.com/blog) [GitHub](https://github.com/mateusjunges/laravel-kafka) 

     Search ⌘K       [    Login with GitHub Login ](https://laravelkafka.com/oauth/github/redirect) 

    Docs for version         

   selected

 v3.0     

 v2.13     

 v2.12     

 v2.11     

 v2.10     

 v2.9     

 v2.8     

 v1.13   

- - [ Introduction ](/docs/v2.13/introduction)
    - [ Requirements ](/docs/v2.13/requirements)
    - [ Installation and Setup ](/docs/v2.13/installation-and-setup)
    - [ Questions and issues ](/docs/v2.13/questions-and-issues)
    - [ Changelog ](/docs/v2.13/changelog)
    - [ Upgrade guide ](/docs/v2.13/upgrade-guide)
    - [ Example docker-compose file ](/docs/v2.13/example-docker-compose)
- Producing messages
    ------------------

    - [ Producing messages ](/docs/v2.13/producing-messages/producing-messages)
    - [ Configuring your kafka producer ](/docs/v2.13/producing-messages/configuring-producers)
    - [ Configuring message payload ](/docs/v2.13/producing-messages/configuring-message-payload)
    - [ Custom serializers ](/docs/v2.13/producing-messages/custom-serializers)
    - [ Publishing to kafka ](/docs/v2.13/producing-messages/publishing-to-kafka)
- Consuming messages
    ------------------

    - [ Creating a kafka consumer ](/docs/v2.13/consuming-messages/creating-consumer)
    - [ Subscribing to kafka topics ](/docs/v2.13/consuming-messages/subscribing-to-kafka-topics)
    - [ Using regex to subscribe to kafka topics ](/docs/v2.13/consuming-messages/using-regex-to-subscribe-to-kafka-topics)
    - [ Assigning consumers to a topic partition ](/docs/v2.13/consuming-messages/assigning-partitions)
    - [ Consuming messages from specific offsets ](/docs/v2.13/consuming-messages/consuming-from-specific-offsets)
    - [ Consumer groups ](/docs/v2.13/consuming-messages/consumer-groups)
    - [ Partition Discovery and Dynamic Assignment ](/docs/v2.13/consuming-messages/partition-discovery)
    - [ Message handlers ](/docs/v2.13/consuming-messages/message-handlers)
    - [ Configuring consumer options ](/docs/v2.13/consuming-messages/configuring-consumer-options)
    - [ Handling failed messages ](/docs/v2.13/consuming-messages/handling-failed-messages)
    - [ Custom deserializers ](/docs/v2.13/consuming-messages/custom-deserializers)
    - [ Consuming messages ](/docs/v2.13/consuming-messages/consuming-messages)
    - [ Class structure ](/docs/v2.13/consuming-messages/class-structure)
    - [ Queueable handlers ](/docs/v2.13/consuming-messages/queueable-handlers)
    - [ Using consumers with Laravel Telescope ](/docs/v2.13/consuming-messages/laravel-telescope)
- Advanced usage
    --------------

    - [ Replacing the default serializer/deserializer ](/docs/v2.13/advanced-usage/replacing-default-serializer)
    - [ Graceful shutdown ](/docs/v2.13/advanced-usage/graceful-shutdown)
    - [ SASL Authentication ](/docs/v2.13/advanced-usage/sasl-authentication)
    - [ Custom Committers ](/docs/v2.13/advanced-usage/custom-committers)
    - [ Manual Commit ](/docs/v2.13/advanced-usage/manual-commit)
    - [ Middlewares ](/docs/v2.13/advanced-usage/middlewares)
    - [ Stop consumer after last messages ](/docs/v2.13/advanced-usage/stop-consumer-after-last-message)
    - [ Stop consumer on demand ](/docs/v2.13/advanced-usage/stopping-a-consumer)
    - [ Writing custom loggers ](/docs/v2.13/advanced-usage/custom-loggers)
    - [ Before and after callbacks ](/docs/v2.13/advanced-usage/before-callbacks)
    - [ Setting global configurations ](/docs/v2.13/advanced-usage/setting-global-configuration)
    - [ Sending multiple messages with the same producer ](/docs/v2.13/advanced-usage/sending-multiple-messages-with-the-same-producer)
- Testing
    -------

    - [ Kafka fake ](/docs/v2.13/testing/fake)
    - [ Assert Published ](/docs/v2.13/testing/assert-published)
    - [ Assert published On ](/docs/v2.13/testing/assert-published-on)
    - [ Assert nothing published ](/docs/v2.13/testing/assert-nothing-published)
    - [ Assert published times ](/docs/v2.13/testing/assert-published-times)
    - [ Assert published on times ](/docs/v2.13/testing/assert-published-on-times)
    - [ Mocking your kafka consumer ](/docs/v2.13/testing/mocking-your-kafka-consumer)

  Using consumers with Laravel Telescope 
========================================

If your application uses [ Laravel Telescope ](https://laravel.com/docs/telescope), you should disable Telescope for your Kafka consumers.

  Sponsorship 

Support Laravel Kafka by sponsoring me!

Laravel Kafka is free and Open Source software, built to empower developers like you. Your support helps maintain and enhance the project. If you find it valuable, please consider sponsoring me on GitHub. Every contribution makes a difference and keeps the development going strong! Thank you!

 [   Become a Sponsor ](https://github.com/sponsors/mateusjunges) Want to hide this message? Sponsor at any tier of $10/month or more! 

Telescope keeps the entries it records during an Artisan command in memory, and only stores them once the command terminates. Kafka consumers are long running processes that never terminate on their own, so every event, query and log entry recorded while consuming messages stays in memory. On a busy topic, this makes the consumer memory usage grow until the process crashes with an `Allowed memory size exhausted` error. Telescope ignores the `queue:work` and `horizon` commands by default for the same reason.

To disable Telescope for your consumers, add their command names to the `ignore_commands` option of your `config/telescope.php` file. This includes the `kafka:consume` command shipped with this package and any consumer command you have written yourself:

         ```
'ignore_commands' => [
    'kafka:consume',
    'consume:my-topic',
],
```

Telescope compares the command names exactly, so each consumer command must be listed.

The same applies to anything else that keeps records in memory for the lifetime of the process, such as the database query log enabled with `DB::enableQueryLog()`. Make sure these are disabled in your consumer processes.

Previous

 [    Queueable handlers ](https://laravelkafka.com/docs/v2.13/consuming-messages/queueable-handlers) 

Next

 [ Replacing the default serializer/deserializer    ](https://laravelkafka.com/docs/v2.13/advanced-usage/replacing-default-serializer) 

 Sponsors

 [ version="1.0" encoding="UTF-8"?       EasyCal ](https://easycal.app/) 

 [       Search  ⌘ K   ](https://typesense.org/)
