55 */
66namespace Magento \Framework \Amqp ;
77
8+ use Magento \Framework \Amqp \Connection \Factory as ConnectionFactory ;
89use Magento \Framework \Amqp \Connection \FactoryOptions ;
910use Magento \Framework \App \DeploymentConfig ;
1011use Magento \Framework \App \ObjectManager ;
11- use PhpAmqpLib \Connection \AbstractConnection ;
1212use PhpAmqpLib \Channel \AMQPChannel ;
13- use Magento \ Framework \ Amqp \ Connection \Factory as ConnectionFactory ;
13+ use PhpAmqpLib \ Connection \AbstractConnection ;
1414
1515/**
1616 * Reads the Amqp config in the deployed environment configuration
@@ -23,20 +23,26 @@ class Config
2323 /**
2424 * Queue config key
2525 */
26- const QUEUE_CONFIG = 'queue ' ;
26+ public const QUEUE_CONFIG = 'queue ' ;
2727
2828 /**
2929 * Amqp config key
3030 */
31- const AMQP_CONFIG = 'amqp ' ;
31+ public const AMQP_CONFIG = 'amqp ' ;
32+
33+ public const HOST = 'host ' ;
34+
35+ public const PORT = 'port ' ;
36+
37+ public const USERNAME = 'user ' ;
38+
39+ public const PASSWORD = 'password ' ;
40+
41+ public const VIRTUALHOST = 'virtualhost ' ;
42+
43+ public const SSL = 'ssl ' ;
3244
33- const HOST = 'host ' ;
34- const PORT = 'port ' ;
35- const USERNAME = 'user ' ;
36- const PASSWORD = 'password ' ;
37- const VIRTUALHOST = 'virtualhost ' ;
38- const SSL = 'ssl ' ;
39- const SSL_OPTIONS = 'ssl_options ' ;
45+ public const SSL_OPTIONS = 'ssl_options ' ;
4046
4147 /**
4248 * Deployment configuration
@@ -140,7 +146,7 @@ public function getValue($key)
140146 */
141147 private function createConnection (): AbstractConnection
142148 {
143- $ sslEnabled = trim ($ this ->getValue (self ::SSL )) === 'true ' ;
149+ $ sslEnabled = trim ($ this ->getValue (self ::SSL ) ?? '' ) === 'true ' ;
144150 $ options = new FactoryOptions ();
145151 $ options ->setHost ($ this ->getValue (self ::HOST ));
146152 $ options ->setPort ($ this ->getValue (self ::PORT ));
0 commit comments