# Messenger Component (Symfony) > Message bus, handlers, transports, mensajes asíncronos, middleware, reintentos, mensajes fallidos - 22 preguntas de entrevista - Mid-Level - [Preguntas de entrevista: Symfony](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista.md) ## 1. ¿Cuál es el propósito principal del componente Messenger en Symfony? **Respuesta** El componente Messenger permite despachar mensajes a los handlers, ya sea de forma síncrona o asíncrona a través de transports como RabbitMQ, Redis o Doctrine. Facilita la construcción de arquitecturas desacopladas al separar la emisión de un mensaje de su procesamiento, lo que mejora la escalabilidad y la mantenibilidad de las aplicaciones. ## 2. ¿Cómo definir un message en Symfony Messenger? **Respuesta** Un message en Symfony Messenger es simplemente una clase PHP plana (POPO) que contiene los datos necesarios para el procesamiento. No se requiere ninguna interfaz ni clase padre. La convención es nombrar los messages con sufijos descriptivos como Notification o Command, y hacerlos inmutables con propiedades readonly para garantizar la integridad de los datos. ## 3. ¿Cómo crear un handler para procesar un message en Symfony Messenger? **Respuesta** Un handler es una clase con un método __invoke() que recibe el message como parámetro. El atributo #[AsMessageHandler] registra automáticamente el handler. Symfony detecta el tipo de message a procesar gracias al type-hint del parámetro. Este enfoque usa autowiring y evita cualquier configuración manual en services.yaml. ## 19 preguntas más disponibles - ¿Qué interfaz se debe inyectar para despachar un mensaje en Symfony Messenger? - ¿Qué es un Envelope en el contexto de Symfony Messenger? Regístrate gratis: https://sharpskill.dev/es/login ## Otros temas de entrevista Symfony - [PHP Moderno (8.1+)](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/php-modern-features.md): 20 preguntas, Junior - [Fundamentos de Symfony](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/symfony-basics.md): 25 preguntas, Junior - [Routing & Controllers](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/routing-controllers.md): 20 preguntas, Junior - [Twig & Templates](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/twig-templates.md): 20 preguntas, Junior - [Fundamentos de Doctrine ORM](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/doctrine-orm-basics.md): 25 preguntas, Junior - [Formularios Symfony](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/forms.md): 22 preguntas, Junior - [Validación de datos](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/validation.md): 18 preguntas, Junior - [Dependency Injection & Services](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/dependency-injection.md): 24 preguntas, Mid-Level - [Security & Authentication](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/security-authentication.md): 26 preguntas, Mid-Level - [Doctrine avanzado](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/doctrine-advanced.md): 24 preguntas, Mid-Level - [API Platform](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/api-platform.md): 22 preguntas, Mid-Level - [Serializer Component](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/serializer.md): 20 preguntas, Mid-Level - [Events & Event Subscribers](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/events-subscribers.md): 20 preguntas, Mid-Level - [Console & Commands](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/console-commands.md): 18 preguntas, Mid-Level - [HTTP Client](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/http-client.md): 18 preguntas, Mid-Level - [Cache y Rendimiento](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/cache.md): 20 preguntas, Mid-Level - [Workflow Component](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/workflow.md): 18 preguntas, Mid-Level - [Testing Symfony](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/testing.md): 22 preguntas, Mid-Level - [Mailer Component](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/mailer.md): 16 preguntas, Mid-Level - [Traducciones e i18n](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/translations.md): 16 preguntas, Mid-Level - [EasyAdmin Bundle](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/easyadmin.md): 18 preguntas, Mid-Level - [Arquitectura Symfony](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/architecture-patterns.md): 24 preguntas, Senior - [Rendimiento y optimización](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/performance-optimization.md): 22 preguntas, Senior - [Seguridad avanzada](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/security-advanced.md): 22 preguntas, Senior - [Bundles Personalizados](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/custom-bundles.md): 20 preguntas, Senior - [Microservices con Symfony](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/microservices.md): 22 preguntas, Senior - [Real-time & WebSockets](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/real-time.md): 18 preguntas, Senior - [Deployment & DevOps](https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/deployment-devops.md): 20 preguntas, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/es/technologies/symfony/preguntas-entrevista/messenger