Don't create all this infrastructure by hand. Instead use DevKit to create a simple wrapper connector around the OAuth2-secured API you want to use. You will receive OAuth2 support OOTB: http://www.mulesoft.org/documentation/display/current/Implementing+OAuth+2.0+Authentication Plus you will get a custom element you can use in Studio....
xml,xslt,mule,mule-studio,cloudhub
Need separate license to use these functions.I think you are using HE of Saxon.Get Enterprise Edition of Saxon
Cloudhub properties are set using System Properties, thats why you can access them via System.getProperty(). mule-app.properties is special as this properties file automatically gets loaded into the Mule registry so you could access it via the Mule Context. But it would be better to inject them into you Java class...
VM queues are very basic, whether you use them in CloudHub or not. VM queues have no capacity for delaying redelivery (like exponential back-offs). Use JMS queues if you need such features. You need to create a flow for processing the DLQ, for example one that regularly consumes the queue...
You have the port set to 8080. CloudHub only supports incoming traffic on port 80 of your application domain URL as described here: http://www.mulesoft.org/documentation/display/current/Developing+a+CloudHub+Application#DevelopingaCloudHubApplication-ProvidinganExternalHTTPorHTTPSPort. You can use the http.port environment variable: port="${http.port}" Also set the host to 0.0.0.0 <http:listener-config port="${http.port}" host="0.0.0.0" name="http" /> ...