Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Sep 19 09:33
    stale[bot] labeled #938
  • Sep 19 09:33
    stale[bot] commented #938
  • Sep 19 07:33
    stale[bot] labeled #937
  • Sep 19 07:33
    stale[bot] commented #937
  • Sep 19 02:48
    jes490 opened #952
  • Sep 18 20:33
    stale[bot] closed #913
  • Sep 18 19:05
    stale[bot] closed #935
  • Sep 18 16:53
    Steveb-p commented #951
  • Sep 18 16:41
    gnumoksha edited #951
  • Sep 18 16:41
    gnumoksha edited #951
  • Sep 18 15:33
    gnumoksha opened #951
  • Sep 18 14:05
    stale[bot] closed #934
  • Sep 18 08:39
    macghriogair opened #950
  • Sep 17 07:42
    Steveb-p commented #920
  • Sep 17 05:38
    balabis commented #920
  • Sep 16 08:08
    Steveb-p review_requested #947
  • Sep 15 13:37
    stale[bot] labeled #936
  • Sep 15 13:37
    stale[bot] commented #936
  • Sep 14 08:57
    stale[bot] closed #930
  • Sep 14 07:58
    stale[bot] closed #931
Paweł Niedzielski
@steveb_gitlab
It might be that it is simply ignored, missing implementation for it, maybe
I'd like to help but I'm kinda busy atm ;)
aslojno
@aslojno
    $beanstalkMessage = new Message($message);
    $beanstalkMessage->setHeader('ttr', 60 * 60 * 24);
now it works :)
Paweł Niedzielski
@steveb_gitlab
looks like a bug to me
You might want to open an issue @aslojno, so it can be properly fixed or investigated
aslojno
@aslojno
I don't know where to do it better, so I opened it here.
php-enqueue/pheanstalk#1
Paweł Niedzielski
@steveb_gitlab
This repository is a read-only split from the main monorepo, which you can find here: https://github.com/php-enqueue/enqueue-dev
I've opened an issue based on yours: php-enqueue/enqueue-dev#917
with slightly improved formatting to make it a bit more readable ;)
@aslojno
aslojno
@aslojno
thank you!
Paweł Niedzielski
@steveb_gitlab
@aslojno you'd probably want to subscribe to that new issue, so that you can respond when Max has any questions :)
FreedomSex
@tebaly
Hello. "There is no route for command "commandName" The command is sent from one server, the command processor on the second server, RabbitMQ on the third server. $promise = $this->producer->sendCommand('commandName', data, true);
+---------+-------------------+--------------------+-------------------------------------+----------+
| Type    | Source            | Queue              | Processor                           | Options  |
+---------+-------------------+--------------------+-------------------------------------+----------+
| command | commandName | default (prefixed) | App\Services\CommandNameProcessor | (hidden) |
+---------+-------------------+--------------------+-------------------------------------+----------+
Default config
enqueue:
    default:
        transport:
            dsn: '%env(resolve:ENQUEUE_DSN)%'
        client:
            traceable_producer: true
            prefix: enqueue
            separator: .
            app_name: app
            router_topic: default
            router_queue: default
            router_processor: null
            redelivered_delay_time: 0
            default_queue: default
            driver_options: {  }
What am I doing wrong?
Tobias Sette
@gnumoksha_gitlab
Hi. Is Signal Extension supposed to work when the application is running inside a docker container? I can't do it work, but I can do a simple example work
Paweł Niedzielski
@steveb_gitlab
@gnumoksha_gitlab there should be no issue with passing signals down in docker container. Unless your php process is not assigned PID 1, in which case you might want to run it through "tini". See https://docs.docker.com/engine/reference/run/#specify-an-init-process or https://docs.docker.com/compose/compose-file/#init
Tobias Sette
@gnumoksha_gitlab
@steveb_gitlab thanks for answering. I've already checked and PHP PID is 1. Within docker-compose.yml I've set entrypoint to php and command to run a php file. I must say I'm not using enqueue cli commands because I use Phalcon framework and so I built a custom routine.
The problem only occours when I call consume method.
Maxim Mazurok
@Maxim-Mazurok

Hello! I'm using php-enqueue SimpleClient with the amqp.
And I have "worker" proccess that is binding to two commands.
And then I have a "producer" proccess that recieves requests via WebSocket from the client and sends command to the worker.
It required a bit of hacking to make it work. One of the main hacks is that SimpleClient uses Symphony event loop for async, and Ratchet WebSocket uses React for that. I haven't found a way to make them work together asynchronously.
So, my "producer" is not sending heartbeat to the amqp server and gets disconnected sometimes. That's why I'm trying to send a command and if it fails - I'm reinitializing SimpleClient and sending command again.
During my first try, I'm able to capture the "Library error: a socket error occurred" exception.
Then, ratchet catches an error: "The enqueue.processor property must not be set."
Not sure why it's happening, but I'll investigate further. Now that I've written it, I have a couple of ideas about how to aproach this problem :)

I'm mostly curious: is there any way to use both React and Symphony async event loops? I can't find any WebSocket implementation with Symphony async loop.

Thanks in advance for any thoughts on this!
Let me know if sharing my code will make sense.

Maxim Mazurok
@Maxim-Mazurok

Forgot to mention, I'm using custom processors because default ones failed to work for me for some reason I don't remember.

And to make "producer" aware of the commands, I'm using this dummy code: $this->client->bindCommand('parse', function () {}, 'ParseCallbackProcessor');. This code also gets executed during the re-initialization. Probably it has something to do with this...

Maxim Mazurok
@Maxim-Mazurok

Oh well, I solved my problem already :)

It tirned out that my messages gets passed by refernce to sendCommand() and during the first (unsuccesful) try it gets modified. So when I try to send my message again, after reinitializing, I'm sending already "prepared" message, which is bad, aparently.
In case if anybody is curious - here's my new code:

/**
     * @param string $command
     * @param string|array|JsonSerializable|Message $message
     * @param bool $needReply
     * @return Promise|null
     */
    public function sendCommand(string $command, $message, bool $needReply = false): ?Promise
    {
        try {
            $m1 = clone($message);
            $result = $this->client->sendCommand($command, $m1, $needReply);
        } catch (Exception $exception) {
            $this->initClient();
            $m2 = clone($message);
            $result = $this->client->sendCommand($command, $m2, $needReply);
        }
        return $result;
    }
なかもと
@nakamoto_twitter
test
Piotr Synowiec
@mysiar
Is it possible to retrieve a queue parameters from the server ?
seviucha
@seviucha
Hi there
I was wondering if enqueue/async-command could set timeout for each new command?
Антон Колинько
@AntKolinko_twitter

Hi guys,

My case is that we already have Kafka running with some producers (in Java). Message payload is just json object. I was trying to create a consumer using symfony messenger + enqueue kafka transport. And then I realised that implementation is tight to the message interface that should contain body, properties, headers.

Is there a way to overwrite this logic, so I can just have plain message data like json object which I then decode to array?

Arkadiusz
@uro
Hey @seviucha
I had similiar problem and as the result I created PR, which was merged yesterday.
You can now change the default timeout (60 secs) in the config.
This timeout is applied to each new command now.
Andras Ratz
@ghostika
Hi, I'm using the symfony integration (enqueue-bundle) with rabbitmq and I would like to implement the delay message feature. I already set up the plugin in rabbitmq, but I can't find in enqueue, where I should add the delay strategy. Can someone shed a light on this one? Thanks.
Paweł Niedzielski
@steveb_gitlab
@AntKolinko_twitter unfortunately enqueue relies on passing certain properties to detect what internal routing, so you will probably need to access transport directly instead. I'm not 100% sure but afaik sroze/messenger-enqueue-adapter does that.
It's possible that this particular configuration docs might be missing, since I assume you're trying to set it up inside configuration files, right?
Andras Ratz
@ghostika
yes, that's what I would like to achieve, I've set already the delay on the message but I got an exception, that the strategy is not enabled and my SF config is only this:
enqueue:
default:
transport: "amqp://guest:guest@rabbitmq:5672"
Do I need to decorate over overwrite that factory?
Paweł Niedzielski
@steveb_gitlab
@ghostika DelayStrategy simply seems to not be configurable (even though it should). It's hardcoded into Factory class. You should open an issue on github so we can gather more input on the matter (I'm not using AMQP transports, mind you). Or maybe I'm simply missing something. @makasim ?
As a workaround you could extend the factory class and configure it yourself. Then all you'd need is to mark your factory as the one that should be used instead.
But it definitely feels like something that falls into the scope of enqueue :)
and please @ghostika mention me when you need my attention, I've got notifications otherwise disabled ;)
seviucha
@seviucha

Hi @uro , thanks for PR. Found a little bug inside AsyncCommandExtension::load() method. Instead of

$container->register($id, RunCommandProcessor::class)
                ->addArgument('%kernel.project_dir%', $client['timeout'])
                ->addTag('enqueue.processor', [
                    'client' => $client['name'],
                    'command' => $client['command_name'] ?? Commands::RUN_COMMAND,
                    'queue' => $client['queue_name'] ?? Commands::RUN_COMMAND,
                    'prefix_queue' => false,
                    'exclusive' => true,
                ])
                ->addTag('enqueue.transport.processor')
            ;

it should be

$container->register($id, RunCommandProcessor::class)
                ->addArgument('%kernel.project_dir%')
                ->addArgument($client['timeout'])
                ->addTag('enqueue.processor', [
                    'client' => $client['name'],
                    'command' => $client['command_name'] ?? Commands::RUN_COMMAND,
                    'queue' => $client['queue_name'] ?? Commands::RUN_COMMAND,
                    'prefix_queue' => false,
                    'exclusive' => true,
                ])
                ->addTag('enqueue.transport.processor')
            ;
Max Kotliar
@makasim
@ghostika "amqp+rabbitmq://guest:guest@rabbitmq:5672"
ghostjuza-gitmin
@ghostjuza-gitmin
Hi there :) one question ... can I get (via select) all messages as objects from the que table ? Thx for support ...
Alexander Makhorin
@despected_twitter

@makasim
Hi!
As for newest version of symfony bundle, which is a common way to send a Command to a different queue/topic (not same as from config)? Trying to customize Message object by setting

$message->setProperty(Config::TOPIC, 'any_topic');
//and than
$producer->sendCommand('a_processor_name', $message);

but seems like its not working for some reason

kor3k
@kor3k
@ghostjuza-gitmin i don't think so... but you can "peek" at messages by consuming a whole queue and then re-queue them (or don't send ACK)
Jed Jones
@jedjones-uk
I am trying to make sense of the different consumer options and was hoping for some help/guidance. We will be using RabbitMQ, and we need an extremely reliable, fast as possible consumer daemon. We don't use Symfony, this will become part of an existing in house framework that doesn't have anything like symfony or laravel commands or workers. I see that bunny supports async, and there is phpinnacle/ridge which is async as well, but I cannot clearly see how to use these with enqueue
Julius F
@daemonfire300

Hi there, quick and simple question:
I am using enqueue-redis and have a very simple Processor. How to I get enqueue to redeliver a Message for a later date, i.e., Message comes to processor, something temporarily did not work, let's process this message later.
What I tried:

  • Processeor::REQUEUE, but this puts a copy of the message into the queue and instantly tries to re-process it again.
  • Processor:REJECT, simply discards the message, never retries it
  • Throwing an exception in the processor, this also does not achieve the intended effect.

thaks in advance

Aleksey Sesyolkin
@jes490

Hi guys!

Is there any way to send message to a different queue with SimpleClient? It can send messages with different topics but what about different queues?