1 | <?php |
||
5 | class RoutingTopology |
||
6 | { |
||
7 | /** |
||
8 | * @var bool |
||
9 | */ |
||
10 | private $useDurableMessaging; |
||
11 | |||
12 | /** |
||
13 | * @var bool[] |
||
14 | */ |
||
15 | private $messageTopologyConfigured = []; |
||
16 | |||
17 | /** |
||
18 | * @param bool $useDurableMesaging |
||
19 | */ |
||
20 | 10 | public function __construct($useDurableMesaging) |
|
24 | |||
25 | /** |
||
26 | * @param BrokerModel $broker |
||
27 | * @param string $queueName |
||
28 | */ |
||
29 | 2 | public function setupForEndpointUse(BrokerModel $broker, $queueName) |
|
36 | |||
37 | /** |
||
38 | * @param BrokerModel $broker |
||
39 | * @param string $messageFqcn |
||
40 | * @param string $subscriberName |
||
41 | */ |
||
42 | 1 | public function setupSubscription(BrokerModel $broker, $messageFqcn, $subscriberName) |
|
47 | |||
48 | /** |
||
49 | * @param BrokerModel $broker |
||
50 | * @param string $messageFqcn |
||
51 | * @param string $subscriberName |
||
52 | */ |
||
53 | 1 | public function tearDownSubscription(BrokerModel $broker, $messageFqcn, $subscriberName) |
|
57 | |||
58 | /** |
||
59 | * @param BrokerModel $broker |
||
60 | * @param string $messageFqcn |
||
61 | * @param string $messageBody |
||
62 | * @param array $attributes |
||
63 | */ |
||
64 | 1 | public function publish( |
|
81 | |||
82 | /** |
||
83 | * @param BrokerModel $broker |
||
84 | * @param string $address |
||
85 | * @param string $messageBody |
||
86 | * @param array $attributes |
||
87 | */ |
||
88 | 1 | public function send( |
|
102 | |||
103 | /** |
||
104 | * @param BrokerModel $broker |
||
105 | * @param string $queueName |
||
106 | * @param string $messageBody |
||
107 | * @param array $attributes |
||
108 | */ |
||
109 | 1 | public function sendToQueue( |
|
123 | |||
124 | /** |
||
125 | * @param BrokerModel $broker |
||
126 | * @param string $messageFqcn |
||
127 | */ |
||
128 | 2 | private function setupClassSubscriptions(BrokerModel $broker, $messageFqcn) |
|
142 | |||
143 | /** |
||
144 | * @param string $messageFqcn |
||
145 | */ |
||
146 | 2 | private function markMessageAsConfigured($messageFqcn) |
|
150 | |||
151 | /** |
||
152 | * @param string $messageFqcn |
||
153 | * |
||
154 | * @return bool |
||
155 | */ |
||
156 | 2 | private function isMessageConfigured($messageFqcn) |
|
160 | |||
161 | /** |
||
162 | * Converts a FQCN to a exchange name. |
||
163 | * Eg. \Some\Namespaced\Class -> Some.Namespaced:Class |
||
164 | * |
||
165 | * @param string $messageFqcn |
||
166 | * |
||
167 | * @return string |
||
168 | */ |
||
169 | 3 | private function getEventExchangeName($messageFqcn) |
|
178 | |||
179 | /** |
||
180 | * Only letters, digits, hyphen, underscore, period or colon are allowed for queue and exchange names in RMQ |
||
181 | * |
||
182 | * @param string $address |
||
183 | * |
||
184 | * @return string |
||
185 | */ |
||
186 | 6 | public static function getSafeName($address) |
|
190 | |||
191 | /** |
||
192 | * @param array $attributes |
||
193 | * |
||
194 | * @return array |
||
195 | */ |
||
196 | 3 | private function enhanceDeliveryMode(array $attributes) |
|
206 | |||
207 | /** |
||
208 | * @param BrokerModel $broker |
||
209 | * @param string $exchangeName |
||
210 | */ |
||
211 | 4 | private function declareExchange(BrokerModel $broker, $exchangeName) |
|
215 | } |
||
216 |