java - Spring Social中如何进行facebook批量请求处理

标签 java spring facebook-graph-api spring-social spring-social-facebook

我之前使用 RestFB 将 facebook 功能添加到我的 spring 应用程序中。现在我开始使用Spring Social,因为它似乎很容易开发。

目前我正在为 spring social 中的 facebook 游戏开发后端应用程序,我需要获取一群用户的公开帖子。我可以在 restfb 中按如下方式执行此操作

        FacebookClient facebookClient = new DefaultFacebookClient(accessToken);
        List<BatchRequest> batchRequests = new ArrayList<BatchRequest>();
        for (User user : users) {
            BatchRequestBuilder requstBuilder = new BatchRequestBuilder(
                    user.getFbUid() + "/posts");
            requstBuilder.parameters(Parameter.with("limit", limit));
            batchRequests.add(requstBuilder.build());
        }
        List<BatchResponse> batchResponses = facebookClient.executeBatch(
                batchRequests, Collections.<BinaryAttachment> emptyList());

但是我在 Spring Social 中找不到任何这样的方法来处理 Facebook Graph API 接受的批处理请求。

我怎样才能做到这一点?请帮我。

最佳答案

我在 JIRA issue 上的回复:

As mentioned in earlier comments, I have a fairly workable prototype for this. It is, however, just a prototype and would need more vetting to know if it's ready to work into the Spring Social Facebook project.

Specifically, it works great for a given Facebook API binding instance...which means it works great when batching requests for a single user. It does not, however, account for batch requests that span multiple users. This will certainly require a bit of rethinking of my prototype.

I was hoping to get this into Spring Social Facebook 1.1.0, but due to a tight schedule to push 1.1.0, I will need to push this off for post-1.1.0. I don't wish to try to rush this, as it's important that it is done right.

FWIW, I believe this is an important feature. But so far we've seen limited interest in it from only a few community members. The JIRA issue has only a single vote. Therefore, even if I believe it's important, it's difficult to justify holding up a release.

关于java - Spring Social中如何进行facebook批量请求处理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21981842/

相关文章:

java - Android Hashmap 无法显示在 listView 中

java - java中如何将字节转换为kb

php - 使用图形 API 并在事件页面上创建链接

facebook - 如何将 Facebook 集成到 WordPress 注册/登录中?

java - 对于 Android,我应该在我的游戏中更频繁地使用 float 数据类型,还是在绘图时转换为 float ?

java - 获取用户拥有的 YouTube channel 列表

java - SlidingTabLayout.java 和 SlidingTabStrip.java 文件放在项目中的哪里?

spring - 异步 Bean 初始化

java - Apache Wicket 的优势是什么?

php - Facebook 好友过滤数据库记录的最佳方式是什么?