You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@nifi.apache.org by Yildiray Kabak <yi...@srdc.com.tr> on 2021/04/09 07:51:31 UTC

ConsumeMQTT Processor Broker URI from environment variable...

Dear all,

I use the Nifi from the docker container and need to pass the “Broker URI” value from environment variable. For this purpose, I initialize the docker container with “MQTT_URL=tcp://localhost:1883” environment variable and reference it from the process configuration as follows:

[cid:image001.png@01D72D2E.4D2DED40]

However, in this case, I receive the shown error notification “Broker URI is invalid because it is not valid URI syntax”. When I investigated more, I realized that “Expression language scope: Not Supported” for this property ☹ (This mechanism works for other processors like HandleHttpRequest or ConsumeKafka).

How can I pass a value to this property from environment variables? Thanks in advance.

Kind regards,



[cid:image002.png@01D72D2E.4D2DED40]
Yildiray Kabak, PhD.
Director of Engineering

Phone: +90 (312) 210 1763    Fax: +90 (312) 210 1837    Email: yildiray@srdc.com.tr

SRDC Corp. ODTU Teknokent Silikon Blok Kat:1 No:16 06800 Ankara, TURKEY
www.srdc.com.tr



RE: ConsumeMQTT Processor Broker URI from environment variable...

Posted by Yildiray Kabak <yi...@srdc.com.tr>.
Dear Pierre,

Thanks for your swift reply. I created the parameter context and assigned it to the process group. I create a parameter as follows:

[cid:image001.png@01D72D43.39E8DD20]

And when I reference it from ConsumeMQTT processor with ‘#{MQTT_BROKER}’ expression, I got the same “Broker URI is invalid because it is not valid URI syntax” error. As I read from the “Add Parameter” window, values do not support Expression Language ☹

As you suggested I will open a JIRA issue.

Kind regards,


[cid:image002.png@01D72D43.39E8DD20]
Yildiray Kabak, PhD.
Director of Engineering

Phone: +90 (312) 210 1763    Fax: +90 (312) 210 1837    Email: yildiray@srdc.com.tr

SRDC Corp. ODTU Teknokent Silikon Blok Kat:1 No:16 06800 Ankara, TURKEY
www.srdc.com.tr


From: Pierre Villard <pi...@gmail.com>
Sent: Friday, April 9, 2021 11:33 AM
To: users@nifi.apache.org
Subject: Re: ConsumeMQTT Processor Broker URI from environment variable...

Hi,

That's something we could easily add, feel free to open a JIRA issue for this improvement. You can also look at using parameters if that's an option for you. To reference a parameter that would be #{} instead of ${}.

Thanks,
Pierre

Le ven. 9 avr. 2021 à 09:51, Yildiray Kabak <yi...@srdc.com.tr>> a écrit :
Dear all,

I use the Nifi from the docker container and need to pass the “Broker URI” value from environment variable. For this purpose, I initialize the docker container with “MQTT_URL=tcp://localhost:1883” environment variable and reference it from the process configuration as follows:

[cid:image003.png@01D72D43.39E8DD20]

However, in this case, I receive the shown error notification “Broker URI is invalid because it is not valid URI syntax”. When I investigated more, I realized that “Expression language scope: Not Supported” for this property ☹ (This mechanism works for other processors like HandleHttpRequest or ConsumeKafka).

How can I pass a value to this property from environment variables? Thanks in advance.

Kind regards,



[cid:image002.png@01D72D43.39E8DD20]
Yildiray Kabak, PhD.
Director of Engineering

Phone: +90 (312) 210 1763    Fax: +90 (312) 210 1837    Email: yildiray@srdc.com.tr<ma...@srdc.com.tr>

SRDC Corp. ODTU Teknokent Silikon Blok Kat:1 No:16 06800 Ankara, TURKEY
www.srdc.com.tr<http://www.srdc.com.tr>



Re: ConsumeMQTT Processor Broker URI from environment variable...

Posted by Pierre Villard <pi...@gmail.com>.
Hi,

That's something we could easily add, feel free to open a JIRA issue for
this improvement. You can also look at using parameters if that's an option
for you. To reference a parameter that would be #{} instead of ${}.

Thanks,
Pierre

Le ven. 9 avr. 2021 à 09:51, Yildiray Kabak <yi...@srdc.com.tr> a écrit :

> Dear all,
>
>
>
> I use the Nifi from the docker container and need to pass the “Broker URI”
> value from environment variable. For this purpose, I initialize the docker
> container with “MQTT_URL=tcp://localhost:1883” environment variable and
> reference it from the process configuration as follows:
>
>
>
>
>
> However, in this case, I receive the shown error notification “Broker URI
> is invalid because it is not valid URI syntax”. When I investigated more, I
> realized that “Expression language scope: Not Supported” for this property
> ☹ (This mechanism works for other processors like HandleHttpRequest or
> ConsumeKafka).
>
>
>
> How can I pass a value to this property from environment variables? Thanks
> in advance.
>
>
>
> Kind regards,
>
>
>
>
>
>
>
> *Yildiray Kabak, PhD.*
>
> Director of Engineering
>
>
>
> *Phone*: +90 (312) 210 1763    *Fax: *+90 (312) 210 1837    *Email*:
> yildiray@srdc.com.tr
>
>
>
> SRDC Corp. ODTU Teknokent Silikon Blok Kat:1 No:16 06800 Ankara, TURKEY
>
> *www.srdc.com.tr <http://www.srdc.com.tr>*
>
>
>
>
>