Skip to content
This repository has been archived by the owner on Aug 25, 2022. It is now read-only.

How to trace the twitter4j.TwitterStreamImpl in GEP 10.3.1 #7

Open
AussiePete2015 opened this issue Nov 6, 2015 · 3 comments
Open

Comments

@AussiePete2015
Copy link

I work in a heavily secured environment, which means that making anything that is external work such as Twitter can be complicated by firewalls and proxies,.
What I need to be able to do is to increase logging.
I'm currently seeing the following in the GEP logs

twitter4j.TwitterStreamImpl connect timed out Nov 6, 2015, 1:05:47 PM DEBUG
twitter4j.TwitterStreamImpl Twitter Stream consumer-4[Waiting for 16000 milliseconds] Nov 6, 2015, 1:05:31 PM DEBUG
twitter4j.TwitterStreamImpl Waiting for 16000 milliseconds Nov 6, 2015, 1:05:31 PM INFO

Cheers and thanks

@AussiePete2015
Copy link
Author

HI all

Thanks to Josh for the following details to make this work behind a proxy
here’s the info I received this morning through the development team back-channel on item (3) – Twitter Connector/Proxy..

--- begin ---

The twitter connector does not support proxy specifically. And it does not use the HTTP modules in the GeoEvent so the current global proxy settings do not affect it. However, according to twitter4j (the library we used for the twitter connector) document, you could set the proxy host and port as the system property. See this link for more details. http://twitter4j.org/en/faq.html.

As a result, you can go to c:\Program Files\ArcGIS\Server\GeoEvent\etc folder and edit the ArcGISGeoEvent.cfg file. You will add these two lines to the file:

wrapper.java.additional.n=-Dtwitter4j.http.proxyHost=your host
wrapper.java.additional.n=-Dtwitter4j.http.proxyPort=your port

Please note the “n”s need to be the next two numbers of all your wrapper.java.additional entries. For example, if you already have wrapper.java.additional.16, the new ones are going to be wrapper.java.additional.17 and wrapper.java.additional.18. You will need to restart GeoEvent after this.

--- end ---

@AussiePete2015
Copy link
Author

Still having issues with the proxy. Although we've added the information, into the cfg file we are still not able to communicate with twitter.
I can run a curl script to connect to twitter

D:\Apps\curl>curl -x proxy.auiag.corp:8080 --cacert D:/Downloads/IAGInternalCA.p
em --get "https://twitter.com/iagbiops" --header "Authorization: OAuth oauth_con
sumer_key="xxxx", oauth_nonce="xxxx", oauth_signature="xxxx", oauth_signature_method=
"HMAC-SHA1", oauth_timestamp="1455248699", oauth_token="xxx", oauth_version="1.0"" --verbose

About to connect() to proxy proxy.auiag.corp port 8080 (#0)

  • Connected to proxy.auiag.corp (IP(IAG PROXY)) port 8080 (#0)
  • Establish HTTP proxy tunnel to twitter.com:443

    CONNECT twitter.com:443 HTTP/1.1
    Host: twitter.com:443
    User-Agent: curl/7.33.0
    Proxy-Connection: Keep-Alive
    < HTTP/1.1 200 Connection established
    < Date: Mon, 15 Feb 2016 00:26:41 GMT
    < Proxy-Connection: Keep-Alive
    < Via: 1.1 proxy.auiag.corp

However in GEX we see the following
twitter4j.TwitterStreamImpl Twitter Stream consumer-2[Establishing connection] Feb 15, 2016, 11:29:35 AM DEBUG
twitter4j.TwitterStreamImpl Establishing connection. Feb 15, 2016, 11:29:35 AM INFO
twitter4j.TwitterStreamImpl connect timed out Feb 15, 2016, 11:29:35 AM DEBUG

Any help to trace this would be greatly appreciated.

@jdelgadillo
Copy link
Contributor

Since you had to supply the cacert option to curl, I'm assuming your proxy's certificate was issued by a private Certificate Authority (CA). If that's the case, you'll need to add either your proxy's certificate or the CA that signed it to the ArcGIS certificate store.

To do that, import the pem file you passed to curl using the web page http://<serverhostname>:6080/arcgis/admin/machines/<machineName>/sslcertificates/importRootOrIntermediate

After importing the CA certificate, restart GeoEvent. After the restart, GeoEvent will trust connections to sites whose certificate were issued by the CA in the pem file.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants