There's a sample called EMP-Connector which is used to show the streaming API working. I pulled it from github (forcedotcom/EMP-Connector) and compile it. But it fails to get past the login for me. It hangs on a POST request (LoginHelper.java:123) and never returns. The default login endpoint was https://login.salesforce.com and I have tried changing that to https://test.salesforce.com and other variations but it always hangs.

I also built a SOAP client to check my user/password etc. That works for me, but with the same user/password/securitytoken the EMP-Connector hangs, and I really want to use the streaming API.

The SOAP Client uses a different URL to log in: services/Soap/c/38.0/0DFN0000000CbeW and the one in the EMP-Connector uses services/Soap/u/22.0/ but changing the EMP Connector URL to look more like the SOAP Client URL didn't help, it still hangs.

Does anyone know why this thing hangs?


The problem was that I had not set my ip address in Salesforce. Under Security Controls>>Network Access there is a list of trusted ip's and mine was not on it. Note that it works just fine with the SOAP API if the ip address is not there, seems to be just Streaming API.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.