src/Graviton/RabbitMqBundle/Service/DumpConsumer.php
public function execute(AMQPMessage $msg)
    {
        echo str_repeat('-', 60).PHP_EOL;

        echo '[RECV ' . date('c') . ']' . PHP_EOL .'<content>' .
            PHP_EOL . $msg->body . PHP_EOL . '</content>'.PHP_EOL.PHP_EOL;

        echo "*" . ' INFO ' . PHP_EOL;
        foreach ($msg->{'delivery_info'} as $key => $value) {
            if (is_scalar($value)) {
                echo "** " . $key . ' = ' . $value . PHP_EOL;
            }
        }
        echo "*" . ' PROPERTIES ' . PHP_EOL;
        foreach ($msg->get_properties() as $property => $value) {
            if (is_scalar($value)) {
                echo "** " . $property . ' = ' . $value . PHP_EOL;
            }
        }
    }
public function execute(AMQPMessage $msg)
    {
        echo str_repeat('-', 60).PHP_EOL;

        echo '[RECV ' . date('c') . ']' . PHP_EOL .'<content>' .
            PHP_EOL . $msg->body . PHP_EOL . '</content>'.PHP_EOL.PHP_EOL;

        echo "*" . ' INFO ' . PHP_EOL;
        foreach ($msg->{'delivery_info'} as $key => $value) {
            if (is_scalar($value)) {
                echo "** " . $key . ' = ' . $value . PHP_EOL;
            }
        }
        echo "*" . ' PROPERTIES ' . PHP_EOL;
        foreach ($msg->get_properties() as $property => $value) {
            if (is_scalar($value)) {
                echo "** " . $property . ' = ' . $value . PHP_EOL;
            }
        }
    }
public function execute ( AMQPMessage $ msg ) { echo str_repeat ( '-' , 60 ) . PHP_EOL ; echo '[RECV ' . date ( 'c' ) . ']' . PHP_EOL . '<content>' . PHP_EOL . $ msg -> body . PHP_EOL . '</content>' . PHP_EOL . PHP_EOL ; echo "*" . ' INFO ' . PHP_EOL ; foreach ( $ msg -> { 'delivery_info' } as $ key => $ value ) { if ( is_scalar ( $ value ) ) { echo "** " . $ key . ' = ' . $ value . PHP_EOL ; } } echo "*" . ' PROPERTIES ' . PHP_EOL ; foreach ( $ msg -> get_properties ( ) as $ property => $ value ) { if ( is_scalar ( $ value ) ) { echo "** " . $ property . ' = ' . $ value . PHP_EOL ; } } }
Callback executed when a message is received. Dumps the message body, delivery_info and properties.

@param AMQPMessage $msg The received message.

@return void
Callback executed when a message is received . Dumps the message body delivery_info and properties .