# How to config different amqp uris for different services

**URL:** <https://discourse.nameko.io/t/how-to-config-different-amqp-uris-for-different-services/298>\
**Category:** Github Issues\
**Created:** [August 13, 2018, 9:33am UTC](https://discourse.nameko.io/t/how-to-config-different-amqp-uris-for-different-services/298 "2018-08-13T09:33:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mattbennett](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.nameko.io/mattbennett/32/13_2.png) [@mattbennett](https://discourse.nameko.io/u/mattbennett)\
**Post date:** [August 13, 2018, 9:33am UTC](https://discourse.nameko.io/t/how-to-config-different-amqp-uris-for-different-services/298/1 "2018-08-13T09:33:15Z")

</div>

_From @alleriaken on Fri Mar 16 2018 02:35:57 GMT+0000 (UTC)_  
  
I want to set up my project so that each service will have a different amqp uri, is there anyway to do that?  
here is my idea:  
In config.yml:  
DEFAULT\_AMQP\_URI: amqp://{RABBIT\_USER:guest}:{RABBIT\_PASSWORD:guest}@{RABBIT\_HOST:localhost}:{RABBIT\_PORT:5672}/

{SERVICE\_1\_NAME}\_AMQP\_URI: amqp://{RABBIT\_USER\_1:guest}:{RABBIT\_PASSWORD\_1:guest}@{RABBIT\_HOST\_1:localhost}:{RABBIT\_PORT\_1:5672}/

{SERVICE\_2\_NAME}\_AMQP\_URI: amqp://{RABBIT\_USER\_2:guest}:{RABBIT\_PASSWORD\_2:guest}@{RABBIT\_HOST\_2:localhost}:{RABBIT\_PORT\_2:5672}/

ect…

So that if a service that has config in config.yml will use its own uri, if not, it will use DEFAULT\_AMQP\_URI

or is there any way that I can set the amqp uri inside service file?

Thanks  
  
_Copied from original issue: [https://github.com/nameko/nameko/issues/526](https://github.com/nameko/nameko/issues/526)_

---

<div class="post-metadata">

**Author:** ![mattbennett](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.nameko.io/mattbennett/32/13_2.png) [@mattbennett](https://discourse.nameko.io/u/mattbennett)\
**Post date:** [August 13, 2018, 9:33am UTC](https://discourse.nameko.io/t/how-to-config-different-amqp-uris-for-different-services/298/2 "2018-08-13T09:33:17Z")

</div>

_From @mattbennett on Fri Mar 16 2018 13:45:50 GMT+0000 (UTC)_  
  
The way to do this is to use different config files for each service.

Changing the config key or value inside the service would take quite a lot of hacking because it’s not read in a single place. You can do it, but you’d have to subclass every AMQP extension that you’re using.
