30秒的定期任务,以轮询外部Web服务并缓存数据 [英] 30 sec periodic task to poll external web service and cache data

查看:130
本文介绍了30秒的定期任务,以轮询外部Web服务并缓存数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到一些有关Domino服务器端操作每30秒轮询一次外部Web服务的建议.

I'm after some advice on polling an external web service every 30 secs from a Domino server side action.

快速了解背景...

我们通过TomTom api跟踪汽车的位置.现在,我们需要将其显示在我们的网络应用中,并叠加到地图(谷歌,必应等)上,并与我们应用中的其他长期数据混在一起.可以将其视为向出租车发送呼叫,我们希望将这些呼叫分配给出租车(...这不是出租车\呼叫,但这是相似的过程).我们非常积极地刷新调度控制器的屏幕,以便他们可以查看所有对象的状态并分配给最近的汽车.如果我们从刷新用户屏幕触发数据提取,则会进入一些棘手的控制服务器端,否则我们将达到TomTom api每分钟允许的最大请求数.

We track the location of cars thru the TomTom api. We now have a requirement to show this in our web app, overlayed onto a map (google, bing, etc.) and mashed up with other lat long data from our application. Think of it as dispatching calls to taxis and we want to assign those calls to the taxis (...it's not taxis\ calls, but it is similar process). We refresh the dispatch controllers screens quite aggressively, so they can see the status of all the objects and assign to the nearest car. If we trigger the pull of data from the refresh of the users screen, we get into some tricky controlling server side, else we will hit the max allowable requests per minute to the TomTom api.

最初,我打算安排一个代理来轮询Web服务,写入我们应用程序中的缓存对象,然后刷新的调度控制器屏幕会从缓存中提取数据....很棒,除了用户需求是我们的缓存必须每30秒更新一次.我可以创建一个程序文档,该文档每1分钟运行一次,但仍然不够积极.

Originally I was going to schedule an agent to poll the web service, write to a cached object in our app, and the refreshing dispatch controllers screen pulls the data from our cache....great, except, user requirement is our cache must be updated every 30secs. I can create a program doc that runs every 1 min, but still not aggressive enough.

因此,我们目前只剩下:.net员工将创建一个每30秒对TomTom进行一次轮询的服务,然后从他的服务中进行检索,或者我想出一种在Domino中进行操作的方法.最好在Domino数据库中进行操作,而不是在某些独立的Java应用程序或.net中进行操作,以在一个系统(Domino)中保持尽可能多的逻辑.

So we are currently left with: our .net guy will create a service that polls TomTom every 30secs, and we retrieve from his service, or I figure out a way to do in Domino. It would be nice to do in Domino database, and not some stand alone java app or .net, to keep as much of the logic as possible in one system (Domino).

我们在系统中大量使用支持bean.我希望今天晚些时候将对此进行测试,但这似乎是一条明智的选择..?: 在JSF托管Bean中生成线程,以便使用计时器 ...或者是我不知道的局限性,有人在Domino中解决过这个问题或有任何评论吗?

We use backing beans heavily in our system. I will be testing this later today I hope, but would this seem like a sensible route to go down..?: Spawning threads in a JSF managed bean for scheduled tasks using a timer ...or are their limitations I am not aware of, has anyone tackled this before in Domino or have any comments?

预先感谢

尼克

推荐答案

签出DOTS(Domino OSGi Tasklet服务):

Check out DOTS (Domino OSGi Tasklet Service): http://www.openntf.org/internal/home.nsf/project.xsp?action=openDocument&name=OSGI%20Tasklet%20Service%20for%20IBM%20Lotus%20Domino

它使您可以在Domino服务器上定义后台Java任务,这些任务具有代理的所有优点(可以计划或触发),而没有任何性能或维护问题.

It allows you to define background Java tasks on a Domino server that have all the advantages of agents (can be scheduled or triggered) with none of the performance or maintenance issues.

这篇关于30秒的定期任务,以轮询外部Web服务并缓存数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆