• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

128
Views
Is it possible 1 application consume multiples exchanges?

What i have to do is consume 2 diferents queues in rabbitMQ, each one in a diferent vhost and diferent exchange.

Do i have to create 2 connections? is it possíble?

My .env is something like this:

CONSUMER_DIRECT_HOST=localhost
CONSUMER_DIRECT_VHOST=pd_logs
CONSUMER_DIRECT_LOGIN=guest
CONSUMER_DIRECT_PASSWORD=guest
CONSUMER_DIRECT_PORT=5672
CONSUMER_DIRECT_TYPE=direct
CONSUMER_DIRECT_QUEUE=queue-notification
CONSUMER_DIRECT_EXCHANGE=direct-notification
CONSUMER_DIRECT_ROUTING_KEY=callback
CONSUMER_PAYMENTS_HOST=localhost
CONSUMER_PAYMENTS_VHOST=/
CONSUMER_PAYMENTS_LOGIN=guest
CONSUMER_PAYMENTS_PASSWORD=guest
CONSUMER_PAYMENTS_PORT=5672
CONSUMER_PAYMENTS_TYPE=direct
CONSUMER_PAYMENTS_QUEUE=queue-payment-notification
CONSUMER_PAYMENTS_EXCHANGE=x-payment-events
CONSUMER_PAYMENTS_ROUTING_KEY=callback

I think i must have 2 applications, one for each vhost. I was thinking to have the same applications, just with diferent environment configuration.

Is not what i want, but i dont know how to do, is it possible?

I tried to create 2 connections at the same time, but it didnt work, or i implemented it wrong.

almost 3 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error