BizTalk: BTAHL72XReceivePipeline Pipeline Component - biztalk

I've set-up two applications, one with FILE Receive Port and the other with a Send Port subscribing to that Receive Port with filter set as BTS.ReceivePortName == {ReceivePortNameHere}. I'm using BizTalk 2013 R2.
In the Receive Port, I'm using the pipeline 'BTAHL72XReceivePipeline'. And, in the Send Port, I'm using the pipeline 'BTAHL72XSendPipeline'.
When I drop a HL7 message into the Receive Port file location, it produces the error:
The Messaging engine failed to process a message submitted by
adapter:FILE Source URL:E:\InboundToBizTalk\*.hl7. Details:The
published message could not be routed because no subscribers were
found. This error occurs if the subscribing orchestration or send port
has not been enlisted, or if some of the message properties necessary
for subscription evaluation have not been promoted. Please use the
Biztalk Administration console to troubleshoot this failure.
However, I do have a subscription set. Why is this error occurring? Is there an issue with the pipeline component or the way I am using it?

On the Group Overview page search for "Subscriptions" and filter based on your Send port name.
Verify that you see an activation Subscription and confirm that the filter conditions on the subscription are correct.

The by far most likely causes:
A typo between the Receive Port Name and the value in the Filter.
The Send Port is not Enlisted or Started.
Do not use quotes in the filter property.

Turned out to be ACK which could not be routed therefore causing the whole flow to error. For an MLLP transport type, it is two way thus the ACK can be routed. For a FILE transport type, it is one way therefore ACK needs to be accounted for separately.
To get around this, another port was created which would subscribe to the ACK.

Related

Is there a requirement in BizTalk that requires a message coming in be sent out?

I have an orchestration that processes incoming messages that make a data call. If data is returned, a new message is created and sent back to the receive port via a "mover" BizTalk application. The original message is no longer needed, so I've been sending it to a discard folder. Is there a requirement in BizTalk that requires a message coming in to be sent out?
Each message that comes into BizTalk needs to be routed somewhere yes, otherwise it will suspend with a routing failure.
However as you are using an Orchestration, once it has consumed the message, and you don't need to send the original message anywhere from the Orchestration if you don't need it, when the Orchestration ends, that message will be gone
In message only scenarios, where you don't have an orchestration your options are
A file send port to a folder, where you have a script to clean them up
A null adapter on a send port, a null adapter is a custom adapter that takes the message from the message box and just discards it.

XML message not transformed using orchestration once application is deployed

The xml messages coming out of my send port do not reflect my orchestration used to transform the message.
Although I tested the message map and observed the expected transformation of XML, I am confused on how to test the orchestration that uses the map.
The orchestration has the following:
ReceiveMessage
ConstructMessage => Transform
SendMessage
After I deployed the Biztalk application and provided source messages to the instance, I observed that the messages coming off the send port still do not reflect the expected transformation. Instead, these messages have the same format as the source XML schema.
NOTE:
I am learning Biztalk.
I have stopped and restarted the server instance within the Administration Console.
If this is the first time you have tried this, it's probably because the Message isn't making trough the Orchestration because the Ports aren't Bound properly. Make sure the Deployed Orchestration is Bound to the right Receive Port and Send Port (and Host) and Enabled.
If you're using PassThruReceive then I suspect that you have some other filter set for your Send Port and that your Orchestration is not even instantiating. Try using the XmlReceive pipeline. This will run the XmlDissasembler mentioned above which will read the namespace and root node and publish the message to the message box.
I suspect that you are subscribing in your Orch by message type, in which case, will pick up the message. When this happens, if you get 2 messages output, then you do indeed have another filter on your send port.

BizTalk + BTAHL7 MLLP - Return original nack to sender

In my scenario, a client sends HL7 via MLLP to my BizTalk two way receive port. BizTalk makes a web service call to an external service, receives the response, translates it to an HL7 ACK and returns it to the client, all in a synchronous transaction.
To make this happen, I have an orchestration that is directly bound to the message box, and the BTAHL7 party configuration is set to not route the ACK to the send pipeline on request-response receive ports. Basically I'm turning off the default ACK generation and generating a custom ACK from my orchestration. I have also added an additional filter to my orchestrations receive shape BTAHL7Schemas.ParseError == false so that the orchestration does not receive bad messages, in the event received messages don't match the schema.
Everything works great. In my testing, I am purposely sending bad HL7 messages. In this case, I get a suspending routing error report because no subscribers were found.
The reason for this behavior is pretty clear - I am not subscribing to messages that have parse errors. In the event of a parse error, I want the error ACK to go back to the client. I could allow my orchestration to subscribe to messages with parse errors, and just formulate an error ACK, but I don't have any way to return the actual parse errors in the ACK.
Normally, in an asynchronous architecture, I would turn on the "Route ACK to send pipeline on request-response receive port" and let the BTAHL72X receive/send pipelines handle it. Then the client would get the error ACK containing the error details.
So my question is, is there any way to get the receive pipelines original ACK and return it from my orchestration?
Yes, what you what you want is certainly doable. I don't have an HL7 project in front of my right now so my memory may not be exact but something like:
Uncheck "Reoute ACK to send pipeline..."
You will need a custom pipeline component to Promote BTS.InterchangeID on the disassembler output.
In your Orchestration, implement a Convoy correlated on BTS.InterchageID.
The Orchestration will then pick up the HL7 Message and the auto generated ACK.
Do you normal processing.
Decide which ACK to return, yours or the generated.
Return ACK to the TwoWay port.
*Non custom pipeline solution: *
In BTAHL7 Configuration Explorer Acknowledgement tab:
Set Acknowledgement type to Enhanced
Set MSH15 (Accept Acknowledgement Type) to NE.
Set MSH16 (Application Acknowledgement Type to ER
Turn on Route ACK to send pipeline on request-response,
It appears to get the behavior I want. Success ACKs won't be generated by the pipeline, letting my orchestration handle it, but application ACK errors will be generated (AR - Application Rejection), and routed to the send pipeline.

BizTalk sends infinite copies to destination folder

I have an orchestration which sends a message A to message box. Now I have 2 subscriber orchestrations which subscribe to the message based on a filter expressions.
Now when I send a message which is to be routed to Subscriber 1, everything works fine, but when a message for subscriber 2 is sent it is routed to destination folder but infinite copies are created in the destination folder. I have to stop the orchestration to stop the generation of duplicate copies of message.
What am I doing wrong?
Are you receiving the same message that you are sending? If so this will cause an infinite loop because your receive location will pick the message up when it is sent. You need to change the filter on the receive, set a flag in your message in the orchestration and then filter on that perhaps.
This is often a symptom of a feedback loop, i.e. where you have a situation like:
Implementing a receive port which listens to the location that a send port publishes messages.
Implementing a direct-bound orchestration with a send port configured to publish messages to the message box of the same schema that it receives (without any filtering)
This is especially common in direct bound (MessageBox) scenarios, as this doesn't have the additional filters which are applied with Specify Now / Later settings. The solution is usually to add an additional filter - either out of the box, such as BTS.ReceivePortName, or a custom context property) on subscribers, so that you can distinguish between messages which have already been processed.

How to subscribe to messages created in a BizTalk orchestration?

I have an orchestration that takes a message. The target namespace is "http://microsoft.com/HealthCare/HL7/2X" and the root element is "ORU_R01_23_GLO_DEF"
In the orchestration, I map the message to an intermediate message type in a construct shape. The target namespace is "http://mycompany.com/myapplication" and the root element is "MyMessage". The "MyMessage" message is then further mapped and then sent to a web service using a logical send port in the orchestration. A WCF send port is then bound to the orchestration and everything works fine. Everything works as expected.
Without altering the orchestration, I want to create a send port that subscribes to the intermediate "MyMessage" message and writes it to a file. To do this, I have created a send port with a filter of BTS.MessageType = http://mycompany.com/myapplication#MyMessage.
Even though messages are flowing through the orchestration, my send port isn't picking up the message. Is this the incorrect filter to use?
Are you trying to subscribe to the 'MyMessage' message, or the same message that is sent to the logical Send Port bound to the physical WCF Send Port?
You have stated that:
The "MyMessage" message is then further mapped and then sent to a web service using a logical send port in the orchestration. A WCF send port is then bound to the orchestration and everything works fine.
Message not Published to MsgBox
From what you have described, I would suggest that you do not have a Send Shape/Logical Send Port combination in your orchestration for the 'MyMessage' message, which is why you can't manually subscribe to this message type in a Send Port filter. The fact that you have not mentioned a 'Failed Routing Report' message further suggests that this is the case - this message type is generated when no subscriotion can be found for a message that is to be published to the MsgBox.
Capture a Message's 'MessageType'
If however you need to capture a copy of the message your are sending over the WCF Send Port, you will need to determine its MessageType and use that in your second Send Port subscription that writes the message out to file.
If you are unsure as to what MessageType to use, there is a simple trick to determine this information:
Stop (not Unenlist) the WCF Send Port
Send a message through your orchestration as normal - the message will be marked as 'Suspended Resumable' in the BizTalk Admin Console on the WCF Send Port.
Open the message in the BizTalk Admin Console and view its 'Message Context'; in the Message Context you will see its 'MessageType' property which you can then use to understand which subscription filter to use.
Start the WCF Send Port to flush the message.
Alternatively, if you don't want to change your orchestration, you could try archiving your message as it passes through the Send Pipeline in the (original) WCF Send Port - either write your own archiving component or use an existing commercial component. By using an archiving component in this manner, you will save yourself the expense of an extra subscription and the associated Send Port maintenance.
Update:
It sounds very much like the OP is not sending the intermediate message to the Message Box from their Orchestration (see comments). Message subscription will only work when a message is published to the Message Box - in this case, the message in question ('Message B') is an intermediate message that only lives within the context & lifetime of the orchestration. The OP needs to Send the message to a Direct Bound port within the Orchestration to allow the message to be subscribed to via a Send Port.
Verify the pipelines of the Send Port. Should by XML, not Passthrougth.

Resources