0

I am trying to consume Salesforce Change data capture events. I am following this article :https://trailhead.salesforce.com/content/learn/modules/change-data-capture/subscribe-to-events

I have followed following steps:

To get a local copy of the EMP-Connector GitHub repository:

$ git clone  https://github.com/forcedotcom/EMP-Connector.git
To build the EMP-Connector tool:
$ cd EMP-Connector

$ mvn clean package
The mvn command generates JAR files in the target folder in the EMP-Connector project directory. 

The generated JAR file, target/emp-connector-0.0.1-SNAPSHOT-phat.jar, includes the connector and the LoginExample functionality. The JAR contains all the dependencies for the connector, so you don’t have to download them separately. To run EMP Connector against your Developer Edition or Trailhead Playground org, type this command and supply your Trailhead Playground org or Salesforce org login credentials and the channel to subscribe to. In this example, the channel is /data/Employee__ChangeEvent.

$ java -jar target/emp-connector-0.0.1-SNAPSHOT-phat.jar <username> <password> /data/Employee__ChangeEvent

After last step, I am getting following error:

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
java.util.concurrent.ExecutionException: java.net.SocketTimeoutException: Connect Timeout
        at org.eclipse.jetty.client.util.FutureResponseListener.getResult(FutureResponseListener.java:118)
        at org.eclipse.jetty.client.util.FutureResponseListener.get(FutureResponseListener.java:101)
        at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:683)
        at com.salesforce.emp.connector.LoginHelper.login(LoginHelper.java:124)
        at com.salesforce.emp.connector.LoginHelper.login(LoginHelper.java:100)
        at com.salesforce.emp.connector.LoginHelper.login(LoginHelper.java:92)
        at com.salesforce.emp.connector.example.LoginExample.lambda$main$0(LoginExample.java:48)
        at com.salesforce.emp.connector.example.BearerTokenProvider.login(BearerTokenProvider.java:24)
        at com.salesforce.emp.connector.example.LoginExample.main(LoginExample.java:56)
Caused by: java.net.SocketTimeoutException: Connect Timeout
        at org.eclipse.jetty.io.ManagedSelector$Connect.run(ManagedSelector.java:801)
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

I see a similar issue is opened on github page https://github.com/forcedotcom/EMP-Connector/issues/99

Please provide suggestion to fix this issue

SharpCoder
  • 18,279
  • 43
  • 153
  • 249
  • Using work machine? Does your company use proxies? Can you ping or use curl to try reaching to login.salesforce.com from command line? – eyescream Jan 28 '23 at 18:58
  • @eyescream: Where do I set the proxy in the sample code? any other workaround to this issue? – SharpCoder Jan 30 '23 at 17:08
  • There's https://github.com/forcedotcom/EMP-Connector/pull/59 but they didn't merge it yet. You could try yourself? Try from home machine? Workbench used to have the option but I heard it got broken a while ago (https://workbench.developerforce.com/streaming.php). Abuse any other sample cometd client, the main difference will be that you'll need to inject piece of code to log in to sf before subscribing to the stream? Maybe some maven-specific answers such as https://stackoverflow.com/q/1251192/313628 ? – eyescream Jan 30 '23 at 18:01
  • @eyescream: Thank you for the reply. I am facing same issue after cloning new branch. Any other way to consume this information. – SharpCoder Jan 30 '23 at 19:22

0 Answers0