Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: t3n/JobQueue.RabbitMQ
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2.1.0
Choose a base ref
...
head repository: t3n/JobQueue.RabbitMQ
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 13 commits
  • 7 files changed
  • 3 contributors

Commits on Jan 29, 2020

  1. Update packages, add pipeline and dependabot

    Alexander Kleine-Börger committed Jan 29, 2020
    Copy the full SHA
    bff1551 View commit details
  2. Increase php_codesniffer

    Alexander Kleine-Börger committed Jan 29, 2020
    Copy the full SHA
    202ff7d View commit details

Commits on Jan 30, 2020

  1. Codestyle

    Alexander Kleine-Börger committed Jan 30, 2020
    Copy the full SHA
    b242993 View commit details
  2. Remove unused import

    Alexander Kleine-Börger committed Jan 30, 2020
    Copy the full SHA
    b500b4a View commit details
  3. Merge pull request #8 from t3n/updates

    Update packages, add pipeline and dependabot
    johannessteu authored Jan 30, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    6ed1e1b View commit details

Commits on Apr 20, 2020

  1. Unverified

    This user has not yet uploaded their public signing key.
    Copy the full SHA
    47e199a View commit details
  2. Merge pull request #12 from t3n/composer-fix

    Pin ocramius/package-version to release that supports php 7.3
    johannessteu authored Apr 20, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    1c02b8a View commit details
  3. Copy the full SHA
    cd0dcb5 View commit details
  4. BUGFIX: Close RabbitMq connection in destructor

    Many Flow Packages will try to submit a message in
    a shutdownObject() method. If the queue connection
    is also closed in a shutdownObject(), the success
    depends on the package load order.
    paxuclus committed Apr 20, 2020
    Copy the full SHA
    aa66b96 View commit details
  5. Merge pull request #11 from nlx-lars/feature/configure-heartbeat

    FEATURE: Allow configuration of RabbitMq heartbeat
    johannessteu authored Apr 20, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    d609600 View commit details
  6. Merge pull request #10 from nlx-lars/nlx-lars/destruct-queue

    BUGFIX: Close RabbitMq connection in destructor
    johannessteu authored Apr 20, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    aa51589 View commit details

Commits on Mar 14, 2022

  1. BUGFIX: Return null on timeout

    Resolves #18
    paxuclus committed Mar 14, 2022
    Copy the full SHA
    9f30211 View commit details

Commits on Jun 10, 2022

  1. Merge pull request #19 from nlx-lars/bugfix/timeout-should-return-null

    BUGFIX: Return null on timeout
    johannessteu authored Jun 10, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3630415 View commit details
Showing with 58 additions and 24 deletions.
  1. +18 −2 .circleci/config.yml
  2. +5 −0 .dependabot/config.yml
  3. +25 −4 Classes/Queue/RabbitQueue.php
  4. +1 −11 Classes/ReleaseService.php
  5. +1 −0 README.md
  6. +2 −2 composer.json
  7. +6 −5 composer.json.ci
20 changes: 18 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2.1

aliases:
- &ci-build-image quay.io/yeebase/ci-build:7.2
- &ci-build-image quay.io/yeebase/ci-build:7.3
- &workspace_root ~/workspace

- &save_composer_cache
@@ -57,7 +57,23 @@ workflows:
version: 2
build_and_test:
jobs:
- checkout
- checkout:
filters:
branches:
ignore: /dependabot.*/
- lint:
requires:
- checkout
build_and_test_dependabot:
jobs:
- hold:
type: approval
filters:
branches:
only: /dependabot.*/
- checkout:
requires:
- hold
- lint:
requires:
- checkout
5 changes: 5 additions & 0 deletions .dependabot/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
version: 1
update_configs:
- package_manager: "php:composer"
update_schedule: "weekly"
target_branch: "master"
29 changes: 25 additions & 4 deletions Classes/Queue/RabbitQueue.php
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@
use Neos\Utility\ObjectAccess;
use PhpAmqpLib\Channel\AMQPChannel;
use PhpAmqpLib\Connection\AMQPStreamConnection;
use PhpAmqpLib\Exception\AMQPTimeoutException;
use PhpAmqpLib\Message\AMQPMessage;
use PhpAmqpLib\Wire\AMQPTable;

@@ -70,8 +71,24 @@ public function __construct(string $name, array $options = [])
$vhost = $clientOptions['vhost'] ?? '/';
$insist = isset($clientOptions['insist']) ? (bool) $clientOptions['insist'] : false;
$loginMethod = isset($clientOptions['loginMethod']) ? (string) $clientOptions['loginMethod'] : 'AMQPLAIN';

$this->connection = new AMQPStreamConnection($host, $port, $username, $password, $vhost, $insist, $loginMethod, null, 'en_US', 3.0, 3.0, null, true, 0);
$heartbeat = (int) ($clientOptions['heartbeat'] ?? 0);

$this->connection = new AMQPStreamConnection(
$host,
$port,
$username,
$password,
$vhost,
$insist,
$loginMethod,
null,
'en_US',
3.0,
3.0,
null,
true,
$heartbeat
);
$this->channel = $this->connection->channel();

// a worker should only get one message at a time
@@ -255,7 +272,7 @@ public function flush(): void
$this->channel->queue_purge($this->queueName);
}

public function shutdownObject(): void
public function __destruct()
{
$this->channel->close();
$this->connection->close();
@@ -309,7 +326,11 @@ protected function dequeue(bool $ack = true, ?int $timeout = null): ?Message
});

while ($cache === null) {
$this->channel->wait(null, false, $timeout ?: 0);
try {
$this->channel->wait(null, false, $timeout ?: 0);
} catch (AMQPTimeoutException $e) {
return null;
}
}

$this->channel->basic_cancel($consumerTag);
12 changes: 1 addition & 11 deletions Classes/ReleaseService.php
Original file line number Diff line number Diff line change
@@ -5,8 +5,6 @@
namespace t3n\JobQueue\RabbitMQ;

use Flowpack\JobQueue\Common\Queue\Message;
use Flowpack\JobQueue\Common\Queue\QueueInterface;
use Flowpack\JobQueue\Common\Queue\QueueManager;
use Neos\Flow\Annotations as Flow;
use t3n\JobQueue\RabbitMQ\Queue\RabbitQueue;

@@ -15,19 +13,11 @@
*/
class ReleaseService
{
/**
* @Flow\Inject()
*
* @var QueueManager
*/
protected $queueManager;

/**
* @param mixed[] $releaseOptions
*/
public function reQueueMessage(QueueInterface $queue, Message $message, array $releaseOptions): void
public function reQueueMessage(RabbitQueue $queue, Message $message, array $releaseOptions): void
{
/** @var RabbitQueue $queue */
$queue->reQueueMessage($message, $releaseOptions);
}
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -115,6 +115,7 @@ Flowpack:
port: 5672
username: guest
password: guest
heartbeat: 60 # Sets RabbitMQ connection heartbeat to 60 seconds

queues:
producer-import:
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -8,11 +8,11 @@
},
"require": {
"flowpack/jobqueue-common": "^3.0.0",
"php-amqplib/php-amqplib": "^2.8.0",
"php-amqplib/php-amqplib": "^2.11",
"ext-json": "*"
},
"require-dev": {
"t3n/coding-standard": "~1.0.0"
"t3n/coding-standard": "~1.1"
},
"autoload": {
"psr-4": {
11 changes: 6 additions & 5 deletions composer.json.ci
Original file line number Diff line number Diff line change
@@ -6,14 +6,15 @@
"bin-dir": "bin"
},
"require": {
"neos/flow": "~5.2.0",
"neos/buildessentials": "~5.2.0",
"neos/flow": "~6.0",
"neos/buildessentials": "~6.0",
"t3n/jobqueue-rabbitmq": "@dev",
"t3n/coding-standard": "~1.0.0"
"t3n/coding-standard": "~1.1",
"ocramius/package-versions": "~1.5.1"
},
"require-dev": {
"squizlabs/php_codesniffer": "3.3.2",
"phpunit/phpunit": "~8.1",
"squizlabs/php_codesniffer": "~3.5",
"phpunit/phpunit": "~8.5",
"mikey179/vfsstream": "~1.6"
},
"repositories": {