I'm working on Streaming API using EMP connector, I'm able to subscribe to the channel and getting the successful response but the problem occurs when I try to configure proxy in the code.
P.S.:- The proxy server I'm trying to configure is tried and tested.
default Collection<? extends org.eclipse.jetty.client.ProxyConfiguration.Proxy> proxies() {
int port = 1234;
Collection<org.eclipse.jetty.client.ProxyConfiguration.Proxy> collection = new HashSet<ProxyConfiguration.Proxy>();
org.eclipse.jetty.client.ProxyConfiguration.Proxy proxy = new HttpProxy(new Address("hostname", port),false);
collection.add(proxy);
return collection;
}
I end up getting below exception:-
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.
Exception in thread "main" java.util.concurrent.ExecutionException: org.eclipse.jetty.io.EofException
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:653)
at com.salesforce.emp.connector.LoginHelper.login(LoginHelper.java:129)
at com.salesforce.emp.connector.LoginHelper.login(LoginHelper.java:102)
at com.salesforce.emp.connector.example.DevLoginExample.main(DevLoginExample.java:33)
Caused by: org.eclipse.jetty.io.EofException
at org.eclipse.jetty.io.ChannelEndPoint.flush(ChannelEndPoint.java:192)
at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.flush(SslConnection.java:808)
at org.eclipse.jetty.io.WriteFlusher.flush(WriteFlusher.java:408)
at org.eclipse.jetty.io.WriteFlusher.write(WriteFlusher.java:302)
at org.eclipse.jetty.io.AbstractEndPoint.write(AbstractEndPoint.java:129)
at org.eclipse.jetty.client.http.HttpSenderOverHTTP.sendHeaders(HttpSenderOverHTTP.java:108)
at org.eclipse.jetty.client.HttpSender.send(HttpSender.java:204)
at org.eclipse.jetty.client.http.HttpChannelOverHTTP.send(HttpChannelOverHTTP.java:78)
at org.eclipse.jetty.client.http.HttpConnectionOverHTTP$Delegate.send(HttpConnectionOverHTTP.java:218)
at org.eclipse.jetty.client.http.HttpConnectionOverHTTP.send(HttpConnectionOverHTTP.java:91)
at org.eclipse.jetty.client.http.HttpDestinationOverHTTP.send(HttpDestinationOverHTTP.java:36)
at org.eclipse.jetty.client.http.HttpDestinationOverHTTP.send(HttpDestinationOverHTTP.java:26)
at org.eclipse.jetty.client.PoolingHttpDestination$2.run(PoolingHttpDestination.java:144)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.nio.channels.ClosedChannelException
at sun.nio.ch.SocketChannelImpl.ensureWriteOpen(SocketChannelImpl.java:270)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:461)
at org.eclipse.jetty.io.ChannelEndPoint.flush(ChannelEndPoint.java:170)
... 15 more
Any suggestions?