1

I'm using the Java EMP connector to subscribe to a push topic in our Salesforce instance.

The only issue I'm having is that the Connector keeps disconnecting itself after roughly 6 hours (always on the 213rd connector heartbeat message).

I'm stumped as to the root cause as it re-authenticates perfectly fine for the previous 6 hours (it generates a new bearer token every 30 mins).

Is there some limit on the amount of requests we can make to Salesforce via the EMP connector? It seems to happen at the same point each time on the 213rd connector heartbeat message.

See the error messages below:

[2020-12-10 17:08:30.971] Failure:[/meta/connect]
{failure={exception=java.util.concurrent.TimeoutException: Total timeout 125000 ms elapsed, message={clientId=myclientid, channel=/meta/connect, id=212, connectionType=long-polling}, connectionType=long-polling}, channel=/meta/connect, id=212, successful=false}
<<<<
>>>>
[2020-12-10 17:08:32.051] Failure:[/meta/connect]
{advice={reconnect=handshake, interval=0}, channel=/meta/connect, id=213, error=403::Unknown client, successful=false}
<<<<
2020-12-10 17:08:32 [HttpClient@19e21f89-50] INFO  c.s.emp.connector.EmpConnector - Disconnecting Bayeux Client in EmpConnector
>>>>
[2020-12-10 17:08:32.055] Failure:[/meta/disconnect]
{failure={exception=java.nio.channels.AsynchronousCloseException, message={clientId=myclientid, channel=/meta/disconnect, id=214}, connectionType=long-polling}, channel=/meta/disconnect, id=214, successful=false}
<<<<<<<<
2020-12-10 17:09:02 [HttpClient@19e21f89-50] ERROR c.s.emp.connector.EmpConnector - Unable to stop 
HTTP transport[https://myinstance.salesforce.com/cometd/50.0]
java.lang.RuntimeException: java.lang.InterruptedException
...

Any suggestions is appreciated!

Browse other questions tagged or ask your own question.