Title: Example using streaming · Issue #1054 · scribejava/scribejava · GitHub
Open Graph Title: Example using streaming · Issue #1054 · scribejava/scribejava
X Title: Example using streaming · Issue #1054 · scribejava/scribejava
Description: I am trying to get my head around why my code does not work when I try to use an async client (Apache) while the JDK works fine. My use case is connecting to the Twitter stream endpoint. There's already such a client and it doesn't work ...
Open Graph Description: I am trying to get my head around why my code does not work when I try to use an async client (Apache) while the JDK works fine. My use case is connecting to the Twitter stream endpoint. There's al...
X Description: I am trying to get my head around why my code does not work when I try to use an async client (Apache) while the JDK works fine. My use case is connecting to the Twitter stream endpoint. There'...
Opengraph URL: https://github.com/scribejava/scribejava/issues/1054
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Example using streaming","articleBody":"I am trying to get my head around why my code does not work when I try to use an async client (Apache) while the JDK works fine.\r\n\r\nMy use case is connecting to the [Twitter stream endpoint](https://developer.twitter.com/en/docs/twitter-api/tweets/filtered-stream/api-reference/get-tweets-search-stream). There's already such a client and it doesn't work with an async client (https://github.com/redouane59/twittered) either.\r\n\r\nThe code is here https://github.com/redouane59/twittered/blob/19134de9dc9ae82be1b61ac551c6a482a04017ab/src/main/java/io/github/redouane59/twitter/helpers/RequestHelperV2.java#L99\r\n\r\nWith the default JDK client, all is fine. With the Apache one, the callback is never invoked (neither the `onCompleted` or the `onError`). However, if I enable the logging of the client, I can see the connection is established and the stream is being consumed. \r\n\r\nExample usage with Twittered:\r\n\r\n```java\r\nApacheHttpClient httpClient = new ApacheHttpClient(HttpAsyncClientBuilder.create()\r\n .setDefaultRequestConfig(RequestConfig.custom()\r\n .setCookieSpec(CookieSpecs.STANDARD)\r\n .setSocketTimeout((int) Duration.ofSeconds(30).toMillis()).build()));\r\nTwitterClient twitterClient = new TwitterClient(credentials, httpClient);\r\nSystem.out.println(\"Initiate stream\");\r\ntwitterClient.startFilteredStream((tweet) -> System.out.println(tweet.getText()));\r\n```\r\n\r\nIf I use the default (JDK) client, the callback is invoked.\r\n","author":{"url":"https://github.com/snicoll","@type":"Person","name":"snicoll"},"datePublished":"2023-03-02T11:27:32Z","url":"https://github.com/scribejava/scribejava/issues/1054"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:8417397b-2d8e-8953-774b-57f7d1cdfa8e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AE12:3E0EF5:64E6B:8EC4B:6AFCB86A |
| html-safe-nonce | 9ef59644947106d1d2032545289dcb2996580a1cfdee9b166a069e0a15fbb839 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRTEyOjNFMEVGNTo2NEU2Qjo4RUM0Qjo2QUZDQjg2QSIsInZpc2l0b3JfaWQiOiI0MDYwOTI0NjA0MTY2NDg2MTIyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 7a1ac6a53a8afc3a2aef7295130111551a1965e96b4199a146e89a27064cb449 |
| hovercard-subject-tag | issue:1606627488 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/scribejava/scribejava/1054/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1fe799a477ab7ef8038a618ca1fc3321999ac507984632570e5b1c736f17bd02/scribejava/scribejava/issues/1054 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1fe799a477ab7ef8038a618ca1fc3321999ac507984632570e5b1c736f17bd02/scribejava/scribejava/issues/1054 |
| og:image:alt | I am trying to get my head around why my code does not work when I try to use an async client (Apache) while the JDK works fine. My use case is connecting to the Twitter stream endpoint. There's al... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | snicoll |
| hostname | github.com |
| expected-hostname | github.com |
| None | e3084aead77cbcb4f4904fba53851fa1a0546b0dec3619bd250815e72588dc6d |
| turbo-cache-control | no-preview |
| go-import | github.com/scribejava/scribejava git https://github.com/scribejava/scribejava.git |
| octolytics-dimension-user_id | 15140551 |
| octolytics-dimension-user_login | scribejava |
| octolytics-dimension-repository_id | 889932 |
| octolytics-dimension-repository_nwo | scribejava/scribejava |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 889932 |
| octolytics-dimension-repository_network_root_nwo | scribejava/scribejava |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 5410e4bebd3e45b138c853ecef3992279d86d5af |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width