Thanks Martin, for the quick reply.
I configured http://[tykhost]/eureka as the endpoint that enriches the request with the Accept:-header. The real eureka url is http://[eurekahost]/eureka/apps/ROUTE.
When I query http://[tykhost]/eureka, I get the JSON back as intended.
I configure the ROUTE-Endpoint in tyk so that it uses service discovery via http://[tykhost]/eureka. And when I set a request to http://[tykhost]/MyROUTE, the answer is 502 Bad Gateway. (BTW: If I hardcode the ROUTE-services as the target URL in tyk, it works).
Concerning “nested”: My understanding about “nested” was to parse the content of a JSON value as another JSON object, something like this:
"value": "{\"hostname\": \"httpbin.org\", \"port\": \"80\"}",
I’m running 1.9.1.1. I ran tyk in --debug and the log file reads (sorry for the bad formatting - but that’s directly from the logfile. I inserted a blank line after each line, hope that makes it more readable…):
Parsing raw data: {“application”:{“name”:“ROUTE”,“instance”:[{“hostName”:“ip-172-31-57-136”,“app”:“ROUTE”,“ipAddr”:“172.31.57.136”,“status”:“UP”,“overriddenstatus”:“UNKNOWN”,“port”:{“@enabled”:“true”,“$”:“60565”},“securePort”:{“@enabled”:“false”,“$”:“443”},“countryId”:1,“dataCenterInfo”:{“@class”:“com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo”,“name”:“MyOwn”},“leaseInfo”:{“renewalIntervalInSecs”:10,“durationInSecs”:10,“registrationTimestamp”:1460471383902,“lastRenewalTimestamp”:1460471403565,“evictionTimestamp”:0,“serviceUpTimestamp”:1460471383340},“metadata”:{“instanceId”:“route:f673c15eebfc456a3c679a55d234a8ca”,“payment”:“perCall”,“providerName”:“MisterA”},“homePageUrl”:“http://ip-172-31-57-136:60565/”,“statusPageUrl”:“http://ip-172-31-57-136:60565/info”,“healthCheckUrl”:“http://ip-172-31-57-136:60565/health”,“vipAddress”:“route”,“isCoordinatingDiscoveryServer”:false,“lastUpdatedTimestamp”:1460471383902,“lastDirtyTimestamp”:1460471429751,“actionType”:“ADDED”},{“hostName”:“ip-172-31-13-37”,“app”:“ROUTE”,“ipAddr”:“172.31.13.37”,“status”:“UP”,“overriddenstatus”:“UNKNOWN”,“port”:{“@enabled”:“true”,“$”:“50045”},“securePort”:{“@enabled”:“false”,“$”:“443”},“countryId”:1,“dataCenterInfo”:{“@class”:“com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo”,“name”:“MyOwn”},“leaseInfo”:{“renewalIntervalInSecs”:10,“durationInSecs”:10,“registrationTimestamp”:1460471387114,“lastRenewalTimestamp”:1460471407062,“evictionTimestamp”:0,“serviceUpTimestamp”:1460471386750},“metadata”:{“instanceId”:“route:838ba7845f1fd63d94c10ca9efdf77a5”,“payment”:“flat”,“providerName”:“MissB”},“homePageUrl”:“http://ip-172-31-13-37:50045/”,“statusPageUrl”:“http://ip-172-31-13-37:50045/info”,“healthCheckUrl”:“http://ip-172-31-13-37:50045/health”,“vipAddress”:“route”,“isCoordinatingDiscoveryServer”:false,“lastUpdatedTimestamp”:1460471387114,“lastDirtyTimestamp”:1460471360189,“actionType”:“ADDED”}]}}
^[[37mDEBU^[[0m[0351] Got:{“application”:{“instance”:[{“actionType”:“ADDED”,“app”:“ROUTE”,“countryId”:1,“dataCenterInfo”:{“@class”:“com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo”,“name”:“MyOwn”},“healthCheckUrl”:“http://ip-172-31-57-136:60565/health",“homePageUrl”:“http://ip-172-31-57-136:60565/”,“hostName”:“ip-172-31-57-136”,“ipAddr”:“172.31.57.136”,“isCoordinatingDiscoveryServer”:false,“lastDirtyTimestamp”:1.460471429751e+12,“lastUpdatedTimestamp”:1.460471383902e+12,“leaseInfo”:{“durationInSecs”:10,“evictionTimestamp”:0,“lastRenewalTimestamp”:1.460471403565e+12,“registrationTimestamp”:1.460471383902e+12,“renewalIntervalInSecs”:10,“serviceUpTimestamp”:1.46047138334e+12},“metadata”:{“instanceId”:“route:f673c15eebfc456a3c679a55d234a8ca”,“payment”:“perCall”,“providerName”:“MisterA”},“overriddenstatus”:“UNKNOWN”,“port”:{“$”:“60565”,“@enabled”:“true”},“securePort”:{“$”:“443”,“@enabled”:“false”},“status”:“UP”,“statusPageUrl”:“http://ip-172-31-57-136:60565/info”,“vipAddress”:“route”},{“actionType”:“ADDED”,“app”:“ROUTE”,“countryId”:1,“dataCenterInfo”:{“@class”:“com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo”,“name”:“MyOwn”},“healthCheckUrl”:“http://ip-172-31-13-37:50045/health”,“homePageUrl”:“http://ip-172-31-13-37:50045/”,“hostName”:“ip-172-31-13-37”,“ipAddr”:“172.31.13.37”,“isCoordinatingDiscoveryServer”:false,“lastDirtyTimestamp”:1.460471360189e+12,“lastUpdatedTimestamp”:1.460471387114e+12,“leaseInfo”:{“durationInSecs”:10,“evictionTimestamp”:0,“lastRenewalTimestamp”:1.460471407062e+12,“registrationTimestamp”:1.460471387114e+12,“renewalIntervalInSecs”:10,“serviceUpTimestamp”:1.46047138675e+12},“metadata”:{“instanceId”:“route:838ba7845f1fd63d94c10ca9efdf77a5”,“payment”:“flat”,“providerName”:“MissB”},“overriddenstatus”:“UNKNOWN”,“port”:{“$”:“50045”,“@enabled”:“true”},“securePort”:{“$”:“443”,“@enabled”:“false”},“status”:“UP”,“statusPageUrl”:“http://ip-172-31-13-37:50045/info”,“vipAddress”:“route”}],“name”:"ROUTE”}}
^[[37mDEBU^[[0m[0351] It’s a target list - getting sub object from list
^[[37mDEBU^[[0m[0351] Passing in: {map[application:map[name:ROUTE instance:[map[countryId:1 metadata:map[instanceId:route:f673c15eebfc456a3c679a55d234a8ca payment:perCall providerName:MisterA] isCoordinatingDiscoveryServer:false securePort:map[@enabled:false $:443] homePageUrl:http://ip-172-31-57-136:60565/ healthCheckUrl:http://ip-172-31-57-136:60565/health vipAddress:route actionType:ADDED hostName:ip-172-31-57-136 app:ROUTE ipAddr:172.31.57.136 dataCenterInfo:map[name:MyOwn @class:com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo] statusPageUrl:http://ip-172-31-57-136:60565/info lastDirtyTimestamp:1.460471429751e+12 status:UP overriddenstatus:UNKNOWN port:map[@enabled:true $:60565] leaseInfo:map[lastRenewalTimestamp:1.460471403565e+12 evictionTimestamp:0 serviceUpTimestamp:1.46047138334e+12 renewalIntervalInSecs:10 durationInSecs:10 registrationTimestamp:1.460471383902e+12] lastUpdatedTimestamp:1.460471383902e+12] map[securePort:map[@enabled:false $:443] dataCenterInfo:map[@class:com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo name:MyOwn] metadata:map[instanceId:route:838ba7845f1fd63d94c10ca9efdf77a5 payment:flat providerName:MissB] statusPageUrl:http://ip-172-31-13-37:50045/info healthCheckUrl:http://ip-172-31-13-37:50045/health actionType:ADDED app:ROUTE overriddenstatus:UNKNOWN port:map[$:50045 @enabled:true] homePageUrl:http://ip-172-31-13-37:50045/ hostName:ip-172-31-13-37 ipAddr:172.31.13.37 status:UP countryId:1 isCoordinatingDiscoveryServer:false lastDirtyTimestamp:1.460471360189e+12 leaseInfo:map[registrationTimestamp:1.460471387114e+12 lastRenewalTimestamp:1.460471407062e+12 evictionTimestamp:0 serviceUpTimestamp:1.46047138675e+12 renewalIntervalInSecs:10 durationInSecs:10] vipAddress:route lastUpdatedTimestamp:1.460471387114e+12]]]]}
2016/04/12 14:30:36 http: panic serving 127.0.0.1:52626: runtime error: invalid memory address or nil pointer dereference
Thanks for your help,
Jörg