Virtual path, parallelism problem

Imported Google Group message.
Sender:Martin Buhr.
Date:Tuesday, 17 November 2015 21:45:19 UTC.

Hi Mark.

Just changing the session reference to {} didn’t work, but I just made something that seems to work, but I’ve got to know why.

  1. I used a simpler function that only creates a response object and returns it (it doesn’t make any request to other endpoints), I also removed any “log” writing.
  2. I defined all the variables used in the function, outside the function, and just fill and use them inside the function.
  3. Instead of using TykJsResponse to return the result, I saw that it just makes a stringify, so I did it directly.

Without 2 or 3, it doesn’t work.

As I said I used JMeter to send several requests at a time, let’s say 10 just to test, and got errors like
ERRO[0012] --> Returned: undefined
ERRO[0012] Failed to decode virtual endpoint response data on return from VM: invalid character ‘u’ looking for beginning of value
ERRO[0012] http: proxy error: dial tcp [::1]:80: getsockopt: connection refused

The API definition in TYK is a simple API with no authentication, no cache, no nothing, just the Virtual Path and the function defined in the code editor.

Cheers.

  • show quoted text -