BizTalk Orchestration to receive multiple messages from XMLReceive pipeline from two-way send port?

可紊 提交于 2020-05-17 05:55:06

问题


I have an orchestration with a two-way send port to retreive one or many items from a database. I use WCF-SQL adapter, and successfully managed to debatch incoming result into separate StoredProcedureResultSet0 messages. However, orchestration only processes one message and ends.

Is there a way for the receiving orchestration to loop over returned messages before ending?

Error message I receive now for the unprocessed messages:

The instance completed without consuming all of its messages. The instance and its unconsumed messages have been suspended.

I am aware that some people have initiated debatching using pipeline from within the orchestration. I thought that it would be preferable to debatching as close to the source as possible.

Ideas?


回答1:


You would have to have a correlation set, where the first receive shape initializes the correlation set, and then you have a receive in a loop with a receive with Following Correlation Set. The tricky parts would be determining what you can correlate on and the exit condition of the loop. That's why it is usually easier to use a Pipeline or maps in the Orchestration to debatch.




回答2:


Final solution was to do debatching directly in receiving pipeline. Using XPath in Orchestration have performance risks, and using correlation sets, like @Dijkgraaf answered, also comes with risks.

However, trying to implement choosen solution, I bounced into the following problem:

XMLReceive pipeline failed to debatch message if there were no results returned from the stored procedure. This is because WCF-SQL adapter omits the resulting element if no rows are returned, and debatching (Body XPath) requires it to exist. Also, tried to have the Body XPath to work even if there was no results using XPath function count(), but BizTalk does not allow "complex" XPath expressions (given by error message, no reference found).

So, I had to develop a receive decode custom pipeline component to add the element if missing. Then XML Disassmebler works and consumes the message even if element is empty.



来源:https://stackoverflow.com/questions/61651801/biztalk-orchestration-to-receive-multiple-messages-from-xmlreceive-pipeline-from

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!