开发者

Acknowledge from JAX-RS client

I expose some JAX-RS (Resteasy) web services to a remote client.

One in particular is a service like "give me all news since the last time I asked you"; on the server I do my queries and all, and if everything went fine I update a property on the client which tells me future requests will start from that date.

The problem here is that if something goes wrong while returning the answer I could already have updated the "lastTime" property and so the client could find itself in the situation of never receiving part of the data.

What would be a good way of adding some kind of "acknowledge" from the client? Something that tells me that it received and correctly processd al开发者_StackOverflow中文版l the data...


I think your concept is wrong: Server should be stateless, while client should know what data he is interested in.
For example the client can use If-Modified-Since header to get the information starting the date in the header. If server has no new, it should return 304 (Not Modified) code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜