Tools I'm using:
- Symfony 4.1.6
- Symfony Messenger component 4.1.6
- Enqueue adapter 0.1.2
- Enqueue Google Cloud Pub/Sub Transport 0.8.37
My config files:
#service.yaml
framework:
messenger:
transports:
default: 'amqp://guest:guest@localhost:5672/%2f/messages'
enqueue: 'enqueue://gps'
default_bus: messenger.bus.commands
buses:
messenger.bus.commands: ~
messenger.bus.events: ~
routing:
# Route your messages to the transports
'App\Message\Command\Store\CreateStore': enqueue
.
#enqueue.yaml
enqueue:
transport:
default: 'gps'
gps:
projectId: '%env(GOOGLE_PROJECT_ID)%'
keyFilePath: '%env(GOOGLE_APPLICATION_CREDENTIALS)%'
Sending message / command to a Cloud Pub/Sub queue OK
My message / command CreateStore
is properly send to Cloud Pub/Sub like this :
use App\Message\Command\Store\CreateStore;
use Enqueue\MessengerAdapter\EnvelopeItem\TransportConfiguration;
$command = new CreateStore();
$this->commandBus->dispatch((new Envelope($command))->with(new
TransportConfiguration(
['topic' => 'enqueue.commands']
)));
All message/command are in my Cloud Pub/Sub Queue, I can see them and acknowledge them manual via the gcloud Command-Line Tool like this:
gcloud pubsub subscriptions pull enqueue.commands
gcloud pubsub subscriptions pull enqueue.commands --auto-ack
Consuming messages from a Cloud Pub/Sub queue KO
Now I trying to consume my message by running:
bin/console messenger:consume-messages enqueue
The consumer run but nothing is happening.
What I'm missing to consume my messages available on Cloud Pub/Sub?