Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
78b2436
Added the modman file
cristiano-pacheco Mar 5, 2023
9bde21a
Added the base module code
cristiano-pacheco Mar 5, 2023
27c4402
Added some unit tests
cristiano-pacheco Mar 5, 2023
96a9594
Unit tests
cristiano-pacheco Mar 8, 2023
29ed097
unit tests
cristiano-pacheco Mar 17, 2023
fe4dfa1
Unit tests
cristiano-pacheco Mar 20, 2023
98654d6
translation
cristiano-pacheco Mar 20, 2023
ec4019a
Adds module dependencies
cristiano-pacheco Mar 21, 2023
12ad6b2
Static tests
cristiano-pacheco Mar 21, 2023
33ac64e
Renamed the message resource model and message collection to improve …
cristiano-pacheco Mar 22, 2023
28177f7
Adds validation for the message_id param in the Requeue action
cristiano-pacheco Mar 22, 2023
c3ed338
Improves the message model by adding the custom collection name in th…
cristiano-pacheco Mar 22, 2023
30d1ef5
Updates the dev dependencies
cristiano-pacheco Mar 23, 2023
ca060e2
Changes the files folder to src
cristiano-pacheco Mar 23, 2023
e1b5164
Adds PHPUnit
cristiano-pacheco Mar 23, 2023
b9238d9
Adds PHPStan
cristiano-pacheco Mar 23, 2023
d9daf09
Adds code sniffer
cristiano-pacheco Mar 23, 2023
2a220c4
Moves the static test depenencies to dev
cristiano-pacheco Mar 23, 2023
3a1e26c
Adds style fixer
cristiano-pacheco Mar 23, 2023
3f527c5
Adds mess detector
cristiano-pacheco Mar 23, 2023
b5432a3
Merge pull request #1 from run-as-root/feature/message-queue-retry-mo…
mwr Mar 23, 2023
fef5ca0
Merge pull request #4 from run-as-root/feature/static-tests
mwr Mar 23, 2023
c7a6a09
Adds bootstrap file for the unit tests
cristiano-pacheco Mar 31, 2023
37e8987
PHPStan
cristiano-pacheco Mar 31, 2023
7acdbd1
Merge pull request #6 from run-as-root/feature/#5-phpunit-bootstrap
mwr Mar 31, 2023
98bc0fe
Merge branch 'develop' into feature/#7-static-tests
mwr Mar 31, 2023
e45fea1
updated PHPStan and included bitexpert/phpstan-magento
mwr Mar 31, 2023
3b046c9
Composer lock file changes
cristiano-pacheco Mar 31, 2023
9fafa19
Static tests changes
cristiano-pacheco Mar 31, 2023
0645d07
Code sniffer
cristiano-pacheco Mar 31, 2023
9727be9
Mess detector
cristiano-pacheco Mar 31, 2023
48e9985
Removes unused column from the message queue grid
cristiano-pacheco Mar 31, 2023
9177ed1
Adds the module documentation
cristiano-pacheco Mar 31, 2023
7dada5d
Adds small changes in the queue configuration
cristiano-pacheco Mar 31, 2023
2fc66f5
Small ajustments to the documentation
cristiano-pacheco Apr 2, 2023
8613b60
Merge pull request #10 from run-as-root/feature/#3-module-documentation
mwr Apr 5, 2023
06afa8b
Merge branch 'develop' of github.com:run-as-root/magento2-message-que…
cristiano-pacheco Apr 5, 2023
71703a8
Adds github actions and updated the README.md file with the badges.
cristiano-pacheco Apr 6, 2023
18a43a1
Merge pull request #11 from run-as-root/feature/#9-github-actions
cristiano-pacheco Apr 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Code sniffer
  • Loading branch information
cristiano-pacheco committed Mar 31, 2023
commit 0645d07055542618725669eb238342132f5afc70
1 change: 1 addition & 0 deletions phpcs-ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

<exclude-pattern>*/Test/*</exclude-pattern>
<exclude-pattern>*/Tests/*</exclude-pattern>
<exclude-pattern>src/Queue/Consumer.php</exclude-pattern>

<!-- Magento 2 Coding Standard -->
<rule ref="Magento2">
Expand Down
4 changes: 2 additions & 2 deletions src/Controller/Adminhtml/Message/Download.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Download extends Action
public function __construct(
Context $context,
private MessageRepository $messageRepository,
private RawFactory $rawFactory,
private RawFactory $rawFactory,
private MessageToRawResponseMapper $messageToRawResponseMapper
) {
parent::__construct($context);
Expand All @@ -34,7 +34,7 @@ public function execute(): RawResponse
{
$messageId = (int)$this->getRequest()->getParam('message_id');
$message = $this->messageRepository->findById($messageId);
$rawResponse = $this->rawFactory->create();
$rawResponse = $this->rawFactory->create();
$this->messageToRawResponseMapper->map($message, $rawResponse);

return $rawResponse;
Expand Down
1 change: 1 addition & 0 deletions src/Controller/Adminhtml/Message/MassDelete.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public function execute(): Redirect
if (!$message instanceof Message) {
continue;
}

$this->messageRepository->delete($message);
}

Expand Down
3 changes: 2 additions & 1 deletion src/Controller/Adminhtml/Message/MassRequeue.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@ public function execute(): Redirect
$redirect = $this->redirectFactory->create();

try {
$collection = $this->filter->getCollection($this->collectionFactory->create());
$collection = $this->filter->getCollection($this->collectionFactory->create());

foreach ($collection->getItems() as $message) {
if (!$message instanceof Message) {
continue;
}

$this->publishMessageToQueueService->executeByMessage($message);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Model/Config/Backend/QueuesConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

class QueuesConfig extends ArraySerialized
{
public function __construct(
public function __construct(
Context $context,
Registry $registry,
ScopeConfigInterface $config,
Expand Down
12 changes: 6 additions & 6 deletions src/Model/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@

class Message extends AbstractModel implements MessageInterface
{
protected function _construct(): void
{
$this->_init(MessageResource::class);
$this->_collectionName = MessageCollection::class;
}

public function getTopicName(): string
{
return $this->getData(self::TOPIC_NAME);
Expand Down Expand Up @@ -76,4 +70,10 @@ public function setCreatedAt(string $value): void
{
$this->setData(self::CREATED_AT, $value);
}

protected function _construct(): void
{
$this->_init(MessageResource::class);
$this->_collectionName = MessageCollection::class;
}
}
4 changes: 2 additions & 2 deletions src/Repository/Query/FindMessageByIdQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class FindMessageByIdQuery
{
public function __construct(
private ResourceModel $resourceModel,
private ModelFactory $modelFactory
private ModelFactory $modelFactory
) {
}

Expand All @@ -22,7 +22,7 @@ public function __construct(
*/
public function execute(int $entityId): Message
{
$model = $this->modelFactory->create();
$model = $this->modelFactory->create();
$this->resourceModel->load($model, $entityId);

if (!$model->getId()) {
Expand Down
4 changes: 2 additions & 2 deletions src/Service/HandleQueueFailureService.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class HandleQueueFailureService
{
public function __construct(
private MessageQueueRetryConfig $messageQueueRetryConfig,
private MessageFactory $messageFactory,
private MessageFactory $messageFactory,
private MessageRepository $messageRepository
) {
}
Expand Down Expand Up @@ -65,7 +65,7 @@ public function execute(QueueInterface $queue, EnvelopeInterface $message, Excep

if ($totalRetries >= $retryLimit) {
// If message reaches the retry limit, then it is moved to the run_as_root_message table
$messageModel = $this->messageFactory->create();
$messageModel = $this->messageFactory->create();
$messageModel->setTopicName($topicName);
$messageModel->setMessageBody($message->getBody());
$messageModel->setFailureDescription($exception->getMessage());
Expand Down