shlomiassaf / pebula-node

A collection of libraries for node
MIT License
6 stars 7 forks source link

Queue name from env #8

Closed imuhammadnawaz closed 5 months ago

imuhammadnawaz commented 2 years ago

Hello,

I am unable to insert a string fetched from env into Queue name either through config service, process.env.QUEUE_NAME or through a util function returning queue string. Also this is not accessible either.

@Queue<MethodDecorator>({
    name: 'queue.name',
    // want to to do one of following. 
    //name: new ConfigService().get('AZURE_SERVICE_BUS_QUEUE'),
    // name: process.env.AZURE_SERVICE_BUS_QUEUE,
    // name: serviceBusQueueString(),

    receiveMode: ReceiveMode.peekLock,
    handlerOptions: {
      autoComplete: false,
    },
  })
  async myQueueEntity(@Ctx() context: SbContext): Promise<void> { //... 
}
z3bra5hax commented 2 years ago

process.env.AZURE_SERVICE_BUS_QUEUE will probably work if you properly use dotenv

imuhammadnawaz commented 2 years ago

unfortunately it's not picking value from dotenv