Skip to content

GPS consumer not working correctly #236

@bwegrzyn

Description

@bwegrzyn

I've started using the Google Pub/Sub queue integration now, and it doesn't seem to work quite right.

It would seem that the message gets sent to a destination topic that is not subscribed to in the consumer. I added some extra logging below.

The weird thing is that there are times where it picks up the message, but a long time later (like 10-15mins). This seems to occur randomly. Most of the time I can start the consumer, and send a message with the producer and it will never arrive.

This is my config.yml file.

enqueue:
  transport:
    default:
      alias: gps
    redis: 
      host: redis
      vendor: predis
    gps:
      projectId: ...
      keyFilePath: ...
  client: 
    traceable_producer: true

And the produce/consume commands with extra logging I added.

$ ./bin/console enqueue:produce testtopic testmessage -vvv
02:36:35 DEBUG     [event] Notified event "console.command" to listener "Symfony\Component\HttpKernel\EventListener\DebugHandlersListener::configure". ["event" => "console.command","listener" => "Symfony\Component\HttpKernel\EventListener\DebugHandlersListener::configure"]
02:36:35 DEBUG     [event] Notified event "console.command" to listener "Symfony\Component\HttpKernel\EventListener\DumpListener::configure". ["event" => "console.command","listener" => "Symfony\Component\HttpKernel\EventListener\DumpListener::configure"]
02:36:35 DEBUG     [event] Notified event "console.command" to listener "Symfony\Bridge\Monolog\Handler\ConsoleHandler::onCommand". ["event" => "console.command","listener" => "Symfony\Bridge\Monolog\Handler\ConsoleHandler::onCommand"]
02:36:35 DEBUG     [event] Notified event "console.command" to listener "Symfony\Bridge\Monolog\Handler\ConsoleHandler::onCommand". ["event" => "console.command","listener" => "Symfony\Bridge\Monolog\Handler\ConsoleHandler::onCommand"]
/app/vendor/enqueue/gps/GpsProducer.php:37:
string(35) "Sending message to: enqueue.default" <-- value of `$destination->getTopicName()`
Message is sent
$ ./bin/console enqueue:consume --setup-broker -vvv
02:40:31 DEBUG     [event] Notified event "console.command" to listener "Symfony\Component\HttpKernel\EventListener\DebugHandlersListener::configure". ["event" => "console.command","listener" => "Symfony\Component\HttpKernel\EventListener\DebugHandlersListener::configure"]
02:40:31 DEBUG     [event] Notified event "console.command" to listener "Symfony\Component\HttpKernel\EventListener\DumpListener::configure". ["event" => "console.command","listener" => "Symfony\Component\HttpKernel\EventListener\DumpListener::configure"]
02:40:31 DEBUG     [event] Notified event "console.command" to listener "Symfony\Bridge\Monolog\Handler\ConsoleHandler::onCommand". ["event" => "console.command","listener" => "Symfony\Bridge\Monolog\Handler\ConsoleHandler::onCommand"]
02:40:31 DEBUG     [event] Notified event "console.command" to listener "Symfony\Bridge\Monolog\Handler\ConsoleHandler::onCommand". ["event" => "console.command","listener" => "Symfony\Bridge\Monolog\Handler\ConsoleHandler::onCommand"]
[debug] Set context's logger Symfony\Component\Console\Logger\ConsoleLogger
[debug] [GpsDriver] Subscribe router topic to queue: enqueue.default -> enqueue.app.default
[debug] [GpsDriver] Subscribe processor topic to queue: enqueue.app.default -> enqueue.app.default
[info] Start consuming
/app/vendor/google/cloud-pubsub/Subscription.php:407:
string(92) "Pulling from GPS subscription: projects/.../subscriptions/enqueue.app.default"
/app/vendor/google/cloud-pubsub/Subscription.php:407:
string(92) "Pulling from GPS subscription: projects/.../subscriptions/enqueue.app.default"
/app/vendor/google/cloud-pubsub/Subscription.php:407:
string(92) "Pulling from GPS subscription: projects/.../subscriptions/enqueue.app.default"

So it seems like it sends to enqueue.default and pulls from enqueue.app.default.

After I switched to using Redis instead of GPS, everything worked as expected. I started a consumer, send a message, and the consumer picked it up a split second later.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions