phpinnacle/ridge

Missing exception on COnnectionCloseFrame with error code

brzuchal opened this issue · 1 comments

Detailed description

When connecting to RMQ fails ConnectionCloseFrame is handled but no exception in case of error is thrown.

DSN

amqp://test:test@localhost:5672/test

ConnectionCloseFrame

    object(PHPinnacle\Ridge\Protocol\ConnectionCloseFrame)#866 (10) {
      ["replyCode"]=>
      int(530)
      ["replyText"]=>
      string(81) "NOT_ALLOWED - access to vhost '/test' refused for user 'test'"
      ["closeClassId"]=>
      int(10)
      ["closeMethodId"]=>
      int(40)
      ["classId"]=>
      int(10)
      ["methodId"]=>
      int(50)
      ["type"]=>
      int(1)
      ["channel"]=>
      int(0)
      ["size"]=>
      int(92)
      ["payload"]=>
      NULL
    }

Context

The change is important for all users using non-default vhost.

Possible implementation

Possible fix should add \trim($url['path'], '/') in Config::parse

Environment

  • Version used 0.2.0
  • PHP Version used 7.2.4
  • Operating system: any

Hi, thank you for reported issue.

The main problem here that RabbitMQ allows create vhost with / in name. Something like /test//my/vhost/// is valid RabbitMQ vhost.