-
Notifications
You must be signed in to change notification settings - Fork 471
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add events for before and after producer publishes a message * Add documentation for producer events * Fix documented return type
- Loading branch information
1 parent
8c18f6d
commit 242f2ed
Showing
5 changed files
with
166 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
namespace OldSound\RabbitMqBundle\Event; | ||
|
||
use OldSound\RabbitMqBundle\RabbitMq\Producer; | ||
use PhpAmqpLib\Message\AMQPMessage; | ||
|
||
/** | ||
* Class AfterProducerPublishMessageEvent | ||
* | ||
* @package OldSound\RabbitMqBundle\Command | ||
*/ | ||
class AfterProducerPublishMessageEvent extends AMQPEvent | ||
{ | ||
public const NAME = AMQPEvent::AFTER_PROCESSING_MESSAGE; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $routingKey; | ||
|
||
/** | ||
* AfterProducerPublishMessageEvent constructor. | ||
* | ||
* @param AMQPMessage $AMQPMessage | ||
*/ | ||
public function __construct(Producer $producer, AMQPMessage $AMQPMessage, string $routingKey) | ||
{ | ||
$this->setProducer($producer); | ||
$this->setAMQPMessage($AMQPMessage); | ||
$this->routingKey = $routingKey; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getRoutingKey() | ||
{ | ||
return $this->routingKey; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
namespace OldSound\RabbitMqBundle\Event; | ||
|
||
use OldSound\RabbitMqBundle\RabbitMq\Producer; | ||
use PhpAmqpLib\Message\AMQPMessage; | ||
|
||
/** | ||
* Class BeforeProducerPublishMessageEvent | ||
* | ||
* @package OldSound\RabbitMqBundle\Command | ||
*/ | ||
class BeforeProducerPublishMessageEvent extends AMQPEvent | ||
{ | ||
public const NAME = AMQPEvent::BEFORE_PROCESSING_MESSAGE; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $routingKey; | ||
|
||
/** | ||
* BeforeProducerPublishMessageEvent constructor. | ||
* | ||
* @param AMQPMessage $AMQPMessage | ||
*/ | ||
public function __construct(Producer $producer, AMQPMessage $AMQPMessage, string $routingKey) | ||
{ | ||
$this->setProducer($producer); | ||
$this->setAMQPMessage($AMQPMessage); | ||
$this->routingKey = $routingKey; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getRoutingKey() | ||
{ | ||
return $this->routingKey; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters