Vodafone has requirement to capture and log the IP address and Port of Message Processor executing the request. My understanding is such information is not available at run-time. Instead, "system.uuid" identifying the message-processor is available. As ZooKeeper has detail of the uuid; IP address can be obtained. At run-time; invoking this call is not recommended, or, storing this mapping at Edge (KVM, etc.) may not be recommended due to maintenance point of view. KVM need to be updated with every re-start of a MP. Is IP address available as part of any attribute, header, etc? Is there any other alternative?
Solved! Go to Solution.
Our variables page (http://apigee.com/docs/api-services/reference/variables-reference) lists what is available. You would be interested in the system.interface variable. However, our Message Processors have multiple NICs (eth0, eth1, etc). So, if you chose the wrong interface you would not get the IP of where the message was sent.
From the node module in a proxy you can get the hostname of an MP like below
var os = require("os"); res.send(os.hostname());
Then you can use apigee-access node module to set a variable :
apigee.setVariable(request, "custom.foo", "Bar");