开发者

Writing async service using cxf with java first approach

I开发者_如何学Python need to create a async webservice using cxf with java first approach. But i am unable to

find any web resource/ website which tells me how to do this?

Can you please tell how can I write a async webservice using CXF with java first approach?

Thanks

Shekhar


A simple alternative that can work in many situations:

  1. Execute a normal web service from the client.
  2. On the server, start the job in a new thread and return with a status like "job started"
  3. When the job is finished, let the server send the result back to the client.

Advantages:

  • It's simple!
  • You get a quick result that tells if the job is accepted.

Disadvantages:

  • Both the client and server must listen for incomming web services.
  • Often requires an id handling to match the result with the original task.


Use a messaging infrastructure like ActiveMQ behind your webservice - get the webservice request normally, take the request message and post it to an inbound queue in ActiveMQ and respond with an acknowledgement synchronously. Process the inbound queue using some batch infrastructure (batch jobs, listeners on Queue etc) and then once processing is complete, either post a completion back to the caller - either using the messaging infrastructure or in conjunction with DB.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜