且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在biztalk中请求响应问题

更新时间:2022-10-15 21:00:55

使用MLLP适配器接收MLLP可能超时.您可以看的东西很少:

  • 持久连接"属性应设置为"True"且接收超时"设置为0
  • 由于您正在为通过MLLP发出的已发布的HL7消息调用WCF服务,所以我想知道您是否正在处理WCF服务响应.否则,将导致这些错误消息.您需要订阅服务响应或使用单向发送端口.
  • 当通过MLLP接收到将消息发送到FILE位置的消息时,请考虑您的设计和调用本地WCF服务的需求.您可以直接跳过两者之间的所有WCF路由.

In one of our solutions (pure messaging, no orchestrations), we receive a message on a request response receive location, using the MLLP adaptor and HL7v2x pipelines. The receive pipeline generates the response message and publishes it, which due to promoted properties gets routed through the send pipeline of the request/response receive port, back to the client.

We then have a two way send port that subscribes to the received message, uses a map to translate the message and send to a request response WCF receive port that is also on the same BizTalk machine. It sounds odd but we have clients that send their data via web services, and some that send via HL7v2 MLLP so that's why we're doing it this way.

The WCF request response receive port also generates a response by publishing a message and promoting the EpmRRCorrelationToken, CorrelationToken, ReqRespTransmitPipelineID, RouteDirectToTP, IsRequestResponse and ReceivePipelineResponseConfig properties, which causes the response to get routed through the send pipeline as a SOAP response.

We subscribe to the messages received on the WCF request response port, and drop them to a file.

Technically it works. The client using MLLP gets an acknowledgement response. The client using WCF SOAP web services get a SOAP response. The file system contains all messages that were sent.

So if I think about the messages published I imagine there is the HL7v2 message received over MLLP (A), and the HL7v2 response (B). Then the translated messages received by the WCF receive port (C), and it's response (D). Plus the WCF response that was received by the WCF send port (E), as shown in the attached .

The problem is that we're getting suspended messages in BizTalk such as "A response message for two-way receive port "xxx" is being suspended as the messaging engine could not correlate the response to an existing request message. This usually happens when the host process has been recycled." In this case, the service is the MLLP receive port, and there are 3 suspended messages - the HL7v2 ACK (B), and 2 copies of the response message for the WCF service (D) and (E) I suspect.

We're also seeing errors "The instance completed without consuming all of its messages. The instance and its unconsumed messages have been suspended."

With MLLP adapter Its possible that the Receive MLLP is timing out. There are few things you can look at:

  • The Persistent Connection Property should be set to True with Receive Timeout Set to 0
  • Since you are calling a WCF service for published HL7 message which come via MLLP, I am wondering if you are dealing with WCF service response. If not then it will cause these error messages. You need to subscribe to the service response or use a one way send port.
  • Relook at your design and need of calling a local WCF service when a message is received via MLLP to send the message to a FILE location. You can do this directly skipping all the WCF route in between.