44
55namespace Enqueue \RdKafka ;
66
7- use Interop \Queue \InvalidDestinationException ;
8- use Interop \Queue \PsrConsumer ;
9- use Interop \Queue \PsrContext ;
10- use Interop \Queue \PsrDestination ;
11- use Interop \Queue \PsrMessage ;
12- use Interop \Queue \PsrProducer ;
13- use Interop \Queue \PsrQueue ;
14- use Interop \Queue \PsrSubscriptionConsumer ;
15- use Interop \Queue \PsrTopic ;
16- use Interop \Queue \PurgeQueueNotSupportedException ;
17- use Interop \Queue \SubscriptionConsumerNotSupportedException ;
18- use Interop \Queue \TemporaryQueueNotSupportedException ;
7+ use Interop \Queue \Consumer ;
8+ use Interop \Queue \Context ;
9+ use Interop \Queue \Destination ;
10+ use Interop \Queue \Exception \ InvalidDestinationException ;
11+ use Interop \Queue \Exception \ PurgeQueueNotSupportedException ;
12+ use Interop \Queue \Exception \ SubscriptionConsumerNotSupportedException ;
13+ use Interop \Queue \Exception \ TemporaryQueueNotSupportedException ;
14+ use Interop \Queue \Message ;
15+ use Interop \Queue \Producer ;
16+ use Interop \Queue \Queue ;
17+ use Interop \Queue \SubscriptionConsumer ;
18+ use Interop \Queue \Topic ;
1919use RdKafka \Conf ;
2020use RdKafka \KafkaConsumer ;
21- use RdKafka \Producer ;
21+ use RdKafka \Producer as VendorProducer ;
2222use RdKafka \TopicConf ;
2323
24- class RdKafkaContext implements PsrContext
24+ class RdKafkaContext implements Context
2525{
2626 use SerializerAwareTrait;
2727
@@ -59,36 +59,36 @@ public function __construct(array $config)
5959 /**
6060 * @return RdKafkaMessage
6161 */
62- public function createMessage (string $ body = '' , array $ properties = [], array $ headers = []): PsrMessage
62+ public function createMessage (string $ body = '' , array $ properties = [], array $ headers = []): Message
6363 {
6464 return new RdKafkaMessage ($ body , $ properties , $ headers );
6565 }
6666
6767 /**
6868 * @return RdKafkaTopic
6969 */
70- public function createTopic (string $ topicName ): PsrTopic
70+ public function createTopic (string $ topicName ): Topic
7171 {
7272 return new RdKafkaTopic ($ topicName );
7373 }
7474
7575 /**
7676 * @return RdKafkaTopic
7777 */
78- public function createQueue (string $ queueName ): PsrQueue
78+ public function createQueue (string $ queueName ): Queue
7979 {
8080 return new RdKafkaTopic ($ queueName );
8181 }
8282
83- public function createTemporaryQueue (): PsrQueue
83+ public function createTemporaryQueue (): Queue
8484 {
8585 throw TemporaryQueueNotSupportedException::providerDoestNotSupportIt ();
8686 }
8787
8888 /**
8989 * @return RdKafkaProducer
9090 */
91- public function createProducer (): PsrProducer
91+ public function createProducer (): Producer
9292 {
9393 return new RdKafkaProducer ($ this ->getProducer (), $ this ->getSerializer ());
9494 }
@@ -98,7 +98,7 @@ public function createProducer(): PsrProducer
9898 *
9999 * @return RdKafkaConsumer
100100 */
101- public function createConsumer (PsrDestination $ destination ): PsrConsumer
101+ public function createConsumer (Destination $ destination ): Consumer
102102 {
103103 InvalidDestinationException::assertDestinationInstanceOf ($ destination , RdKafkaTopic::class);
104104
@@ -128,20 +128,20 @@ public function close(): void
128128 }
129129 }
130130
131- public function createSubscriptionConsumer (): PsrSubscriptionConsumer
131+ public function createSubscriptionConsumer (): SubscriptionConsumer
132132 {
133133 throw SubscriptionConsumerNotSupportedException::providerDoestNotSupportIt ();
134134 }
135135
136- public function purgeQueue (PsrQueue $ queue ): void
136+ public function purgeQueue (Queue $ queue ): void
137137 {
138138 throw PurgeQueueNotSupportedException::providerDoestNotSupportIt ();
139139 }
140140
141- private function getProducer (): Producer
141+ private function getProducer (): VendorProducer
142142 {
143143 if (null === $ this ->producer ) {
144- $ this ->producer = new Producer ($ this ->getConf ());
144+ $ this ->producer = new VendorProducer ($ this ->getConf ());
145145
146146 if (isset ($ this ->config ['log_level ' ])) {
147147 $ this ->producer ->setLogLevel ($ this ->config ['log_level ' ]);
0 commit comments