Hello, what's the best way to start and keep a consumer as a process running in background? I'm starting it with
"php ./bin/console rabbitmq:consumer queue_name --env=prod > log_file &"
but sometimes the process is stopped with this error:
"fwrite(); send of 13 bytes failed with errno=32 Broken pipe"
Any idea? Thanks!
$this->channel->queue_declare( 'someQueueName', #queue name, the same as the sender false, #passive true, #durable false, #exclusive false #autodelete );
$this->channel->basic_consume( 'someQueueName', # queue '', # consumer tag - Identifier for the consumer, valid within the current channel. just string false, # no local - TRUE: the server will not send messages to the connection that published them false, # no ack - send a proper acknowledgment from the worker, once we're done with a task false, # exclusive - queues may only be accessed by the current connection false, # no wait - TRUE: server will not respond to the method. Client should not wait for a reply method [$this, 'processMessage'] # callback - method that will receive the message );