BPEL:异步/同步模式
我想知道是否正确。
接收 - 回复模式用于同步 Web 服务。在这种情况下,可以在 wsdl 文件中定义单个端口。
事实上,调用模式也用于制作异步 Web 服务。在本例中,在 wsdl 中定义了两个端口。
所以,我的问题是:是否可以仅使用回复活动来创建异步调用?
先感谢您。
I would like to know if it is correct.
The pattern receive - reply is used for sync web services. In this case it is possible to define a single port in wsdl file.
The invoke pattern, indeed, is used to make also async web service. In this case, in the wsdl are defined two ports.
So, my question is: Is it possible to use only reply activity to create async calls?
Thank you in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不太明白你的问题,但是我尝试解释 BPEL 中的同步与异步关系,希望它也能回答你的问题:
a)甚至是双向请求响应操作(看起来像同步操作)可以绑定到异步传输协议(如 SMTP、JMS、XMPP、AMQP...)
b) 您所描述的模式对于传入服务调用(即当客户端调用 BPEL 流程实例时)是正确的。如果 BPEL 流程的 WSDL 将操作定义为请求-响应,那么您需要在 BPEL 中将其建模为接收-应答对。这可以被认为是同步调用(但请参见 a))。如果由于某种原因该操作无法绑定到异步传输协议,并且由于某种原因(例如其间长时间运行的处理)调用必须是异步的,则需要将该操作拆分为两个单向操作。这意味着该进程现在正在为原始请求提供一项操作,而调用者现在必须为原始响应提供一项单向操作。这在 BPEL 中被建模为接收-调用对。两者通过合作伙伴链接互连。这是异步的。
单个回复没有意义,因为回复活动始终连接到接收活动,即它只负责操作的响应部分,不能用于单向操作。如果要调用外部服务,请使用invoke。对于请求-响应操作,调用将直接返回结果。如果调用应该是异步的,请使用调用-接收对,每个提供/调用一个单向操作。
哈特哈,
塔莫
I don't really understand your question, however I try to explain the sync vs. async relation in BPEL, hoping that it also answers your question:
a) Even a two-way request-response operation (which looks like a synchronous operation) can be bound to an asynchronous transport protocol (like SMTP, JMS, XMPP, AMQP...)
b) The patterns you are describing are correct for incoming service call, i.e. when a client calls the BPEL process instance. If the WSDL of your BPEL process defines an operation as request-response, you need to model this as a receive-reply pair in your BPEL. This can be considered a synchronous call (but see a)). If for some reason this operation cannot be bound to an asynchronous transport protocol, and for some reason (e.g. long-running processing in between) the invocation must be asynchronous, you need to split the operation into two one-way operations. This means that the process is now providing one operation for the original request, and the caller now has to provide one one-way operation for the original response. This is modeled as receive-invoke pair in BPEL. Both are interconnected via partner links. This is at asynchronous as it gets.
A single reply does not make sense, since a reply activity is always connected to a receive activity, i.e. it is only responsible for the response part of an operation and cannot be used for one-way operations. If you want to call an external service, use invoke. With request-response operations, the invoke will directly return the result. If the call should be async, use an invoke-receive pair, each providing/calling a one-way operation.
HTH,
Tammo