messenger-test | Assertions and helpers for testing your symfony/messenger | Web Framework library

 by   zenstruck PHP Version: v1.7.2 License: MIT

kandi X-RAY | messenger-test Summary

kandi X-RAY | messenger-test Summary

messenger-test is a PHP library typically used in Server, Web Framework, Symfony applications. messenger-test has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

Assertions and helpers for testing your symfony/messenger queues. This library provides a TestTransport that, by default, intercepts any messages sent to it. You can then inspect and assert against these messages. Sent messages are serialized and unserialized as an added check. The transport also allows for processing these queued messages.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              messenger-test has a low active ecosystem.
              It has 134 star(s) with 9 fork(s). There are 8 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 6 open issues and 18 have been closed. On average issues are closed in 43 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of messenger-test is v1.7.2

            kandi-Quality Quality

              messenger-test has no bugs reported.

            kandi-Security Security

              messenger-test has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              messenger-test is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              messenger-test releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi has reviewed messenger-test and discovered the below as its top functions. This is intended to give you an instant insight into messenger-test implemented functionality, and help decide if they suit your requirements.
            • Get the message transport .
            • Reset all messages .
            Get all kandi verified functions for this library.

            messenger-test Key Features

            No Key Features are available at this moment for messenger-test.

            messenger-test Examples and Code Snippets

            zenstruck/messenger-test,Usage,Other Transport Assertions and Helpers
            PHPdot img1Lines of Code : 78dot img1License : Permissive (MIT)
            copy iconCopy
            use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
            use Symfony\Component\Messenger\Envelope;
            use Symfony\Component\Messenger\Stamp\DelayStamp;
            use Zenstruck\Messenger\Test\InteractsWithMessenger;
            use Zenstruck\Messenger\Test\Transport\TestTransp  
            zenstruck/messenger-test,Usage,Unblock Mode
            PHPdot img2Lines of Code : 30dot img2License : Permissive (MIT)
            copy iconCopy
            use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
            use Zenstruck\Messenger\Test\InteractsWithMessenger;
            
            class MyTest extends KernelTestCase // or WebTestCase
            {
                use InteractsWithMessenger;
            
                public function test_something(): void
                {
                
            zenstruck/messenger-test,Usage,Processing Exceptions
            PHPdot img3Lines of Code : 27dot img3License : Permissive (MIT)
            copy iconCopy
            use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
            use Zenstruck\Messenger\Test\InteractsWithMessenger;
            
            class MyTest extends KernelTestCase // or WebTestCase
            {
                use InteractsWithMessenger;
            
                public function test_something(): void
                {
                

            Community Discussions

            QUESTION

            Symfony messenger queues with binding key - retry strategy
            Asked 2020-Apr-23 at 09:39

            I'm implementing messenger in company which I work for. I found problem with routing key.

            I want to to send one message to two queues. Two other apps will process this queues. Everything works well, but I found problem when handler throws an exception. It doubles message sending one it two retry queues, because retry queues are matching by binding key, which is the same for this queues.

            Finally with 3 retries I have 16 messages on my dlqs. Could you help me with this problem? Is it possible to create retry strategy based maybe on queue, not routing key?

            My config looks like:

            ...

            ANSWER

            Answered 2020-Apr-23 at 09:39

            Ok, I found answer myself.

            I created new retry strategy. I changed queue_name_pattern to %routing_key%_%delay% and created my own SendFailedMessageForRetryListener. To retry envelope I added stamp new AmqpStamp($envelope->last(AmqpReceivedStamp::class)->getQueueName()) which is used to create proper routing key for delay queue. So instead of creating queue based on exchange name I have it created based on queue name.

            Two more things:

            Binding keys in queue looks like:

            Source https://stackoverflow.com/questions/61295801

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install messenger-test

            Create a config/packages/test/messenger.yaml and override your transport(s) with test://:.
            Install the library: composer require --dev zenstruck/messenger-test
            Create a config/packages/test/messenger.yaml and override your transport(s) with test://: # config/packages/test/messenger.yaml framework: messenger: transports: async: test://

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/zenstruck/messenger-test.git

          • CLI

            gh repo clone zenstruck/messenger-test

          • sshUrl

            git@github.com:zenstruck/messenger-test.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link