Hi all, Can we check and verify this, this looks like a bug to me. Nadeesha
On Fri, Nov 23, 2018 at 7:13 PM Pubudu Fernando <[email protected]> wrote: > Hi All, > > I had a quick look. The following simple b7a program works. Which means > this is not an issue with the b7a config API. > import ballerina/config; > import ballerina/io; > > public function main() { > string s = config:getAsString("InventoryAPI.1.0.prod.endpoint.0"); > io:println(s); > } > > $ ballerina run -e InventoryAPI.1.0.prod.endpoint.0=" > http://localhost:8080/xxxxx" test.bal > > Running the above command prints the provided URL on the console. > > Could it be an issue with the gateway startup script? Shall we verify that > the arguments are correctly passed to the ballerina run command? > > Regards, > Pubudu > > On Tue, Nov 20, 2018 at 5:13 PM Chamila Adhikarinayake <[email protected]> > wrote: > >> Since microgateway uses ballerina config to resolve the variables[1] >> related to endpoints, defining environment variables as mentioned in the >> ballerina docs should work >> >> [1] >> https://github.com/wso2/product-microgateway/blob/master/components/micro-gateway-core/src/main/ballerina/gateway/utils/utils.bal#L401 >> >> On Mon, Nov 19, 2018 at 10:19 PM Pubudu Gunatilaka <[email protected]> >> wrote: >> >>> Hi Nadeesha, >>> >>> Looks like in Windows you have to export env values as follows [1]. >>> >>> // In Linux and Mac. >>> $ export b7a_http_tracelog_path=”./trace.log” >>> $ export b7a_http_accesslog_path=”./access.log” // >>> >>> In Windows. >>> $ set(x) b7a_http_tracelog_path=”./trace.log” >>> $ set(x) b7a_http_accesslog_path=”./access.log” >>> >>> Could you please try that? If it works we can add to the documentation. >>> @[email protected] <[email protected]> @Shani Ranasinghe >>> <[email protected]> @Mariangela Hills <[email protected]> >>> >>> In addition to this, CLI parameters should work in Windows as well. @Isuru >>> Haththotuwa <[email protected]> @Chamila Adhikarinayake >>> <[email protected]> : Thoughts? >>> >>> [1] - https://ballerina.io/learn/api-docs/ballerina/config.html >>> >>> Thank you! >>> >>> On Mon, Nov 19, 2018 at 7:16 PM Nadeesha Gamage <[email protected]> >>> wrote: >>> >>>> Hi Rajitha, >>>> Setting the environment explicitly doesnt work as well for a Windows >>>> environment. >>>> >>>> Nadeesha >>>> >>>> On Mon, Nov 19, 2018 at 6:29 AM Nadeesha Gamage <[email protected]> >>>> wrote: >>>> >>>>> Hi Roshan, >>>>> I will try that >>>>> >>>>> Thank you, >>>>> Nadeesha >>>>> >>>>> On Mon, Nov 19, 2018 at 6:12 AM Rajith Roshan <[email protected]> >>>>> wrote: >>>>> >>>>>> Hi Nadeesha, >>>>>> May be an issue reading -e CLI parameters from ballerina config API. >>>>>> Can you try setting the environment variable explicitly[1] as well. >>>>>> >>>>>> [1] - export InventoryAPI_1_0_prod_endpoint_0=" >>>>>> http://localhost:8080/xxxxx" >>>>>> >>>>>> Thanks! >>>>>> Rajith >>>>>> >>>>>> On Mon, Nov 19, 2018 at 8:22 AM Nadeesha Gamage <[email protected]> >>>>>> wrote: >>>>>> >>>>>>> >>>>>>> + API M team >>>>>>> >>>>>>> ---------- Forwarded message --------- >>>>>>> From: Nadeesha Gamage <[email protected]> >>>>>>> Date: Sun, Nov 18, 2018 at 11:16 AM >>>>>>> Subject: [API M] Overridding endpoint information doesnt work as >>>>>>> expected in API Micro Gateway 2.6 >>>>>>> To: dev <[email protected]> >>>>>>> >>>>>>> >>>>>>> Hi Devs, >>>>>>> I am trying to override an existing backend API endpoint exposed via >>>>>>> MG (after building the MG). I am executing the the following command to >>>>>>> run >>>>>>> the MG but it still goes to the old endpoint. I have attached the source >>>>>>> .bal file generated in setup. The command that I executed is also given >>>>>>> below >>>>>>> >>>>>>> gateway -e InventoryAPI.1.0.prod.endpoint.0=" >>>>>>> http://localhost:8080/xxxxx" >>>>>>> >>>>>>> I am running this on a Windows environment. >>>>>>> >>>>>>> Can anyone let me know if I am doing something wrong or is this an >>>>>>> issue? >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> Nadeesha Gamage >>>>>>> Senior Lead Solutions Engineer >>>>>>> T : +94 77 394 5706 >>>>>>> B : https://nadeesha678.wordpress.com/ >>>>>>> -- >>>>>>> Nadeesha Gamage >>>>>>> Senior Lead Solutions Engineer >>>>>>> T : +94 77 394 5706 >>>>>>> B : https://nadeesha678.wordpress.com/ >>>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Rajith Roshan >>>>>> Senior Software Engineer, WSO2 Inc. >>>>>> Mobile: +94-7 <%2B94-71-554-8430>17-064-214 >>>>>> >>>>> >>>>> >>>>> -- >>>>> Nadeesha Gamage >>>>> Senior Lead Solutions Engineer >>>>> T : +94 77 394 5706 >>>>> B : https://nadeesha678.wordpress.com/ >>>>> >>>> >>>> >>>> -- >>>> Nadeesha Gamage >>>> Senior Lead Solutions Engineer >>>> T : +94 77 394 5706 >>>> B : https://nadeesha678.wordpress.com/ >>>> >>> >>> >>> -- >>> *Pubudu Gunatilaka* >>> Committer and PMC Member - Apache Stratos >>> Associate Technical Lead >>> WSO2, Inc.: http://wso2.com >>> mobile : +94774078049 <%2B94772207163> >>> >>> >> >> -- >> Regards, >> Chamila Adhikarinayake >> Associate Technical Lead >> WSO2, Inc. >> Mobile - +94712346437 >> Email - [email protected] >> Blog - http://helpfromadhi.blogspot.com/ >> > > > -- > *Pubudu Fernando *| Senior Software Engineer | WSO2 Inc. > (m) +94 77 888 2543 | (e) [email protected] > > > -- Nadeesha Gamage Senior Lead Solutions Engineer T : +94 77 394 5706 B : https://nadeesha678.wordpress.com/
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
