BizTalk EDI - sending body of rejected transaction sets to port - biztalk

We have an upstream application that will generate at times functionally invalid transaction sets.
I'm trying to push the message bodies of the failed transactions from the interchange and associated 999s to a send port or some other logging mechanism, while forwarding the valid transaction sets to downstream mapping process.
Any ideas on accomplishing this would be helpful.

First check "Enable Routing for failed messages" on the Receive Port
Then add a filter to your send port to subscribe to those messages.
e.g.
ErrorReport.ReceivePortName = <your port name> AND
ErrorReport.FailureCode Exists
If you have an existing filter you need to have an OR on the last line of that filter.
<existing filer line1> AND
<existing filer line2> OR
ErrorReport.ReceivePortName = <your port name> AND
ErrorReport.FailureCode Exists

Related

Weird issue with orchestration and send port filters

I've got a weird issue which totally confused me. I have an orchestration that receives a file through Receive port and puts it to Send port with delivery notification. After that orchestration performs some other actions but my issue is with the part mentioned above. It works: I put a file to Receive location and it goes to appropriate destination folder.
But, if I assign to the Send port a filter that uses fields promoted in message and filter's expression is False it still works - I receive file in destination folder (however filter is False and Send port should not process this file). And once filter becomes True I receive...THREE equal files in destination folder!
Are there any logs that I can go through to try to figure out where these two extra files come from?
Even when you add a filter to a send port, if the Orchestration is bound to the send port, it will still send through that send port, regardless what other filters you put on it.
In the Admin Console you do a query for Subscriptions and find the send port, you will notice that it will have an OR condition with http://schemas.microsoft.com/BizTalk/2003/system-properties.SPTransportID == {GUID} and that is the filter that is used when a an Orchestration sends to a bound send port.
So check what the filter looks like for your send port. Also check to see if you have a send port group set up that includes that send port, as that would also cause a message to be sent to that send port if the filter on that matches.
What is probably happening is that the Orchestration is sending one, and the filter is matching the message received from the Receive Location. You will have to do some more digging to see why the third message.

BizTalk: BTAHL72XReceivePipeline Pipeline Component

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.

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.

Using Flash Media Gateway Application

I got a IP Communications new account having following paramters:
Originating IP Destination IP Protocol Codec Ports
(for example)65.154.35.210 , 202.124.43.256 , SIP , g729 / , 2
Now i want to use it in default application of FMG i.e:
http://download.macromedia.com/pub/labs/flashmedia_gateway/flashmedia_gateway_sample_flashphone.swf
Its showing me connecting ...
Status is not getting update like: "Connection Failed" or "Connection Success".
Please tell me how to use the above information in this app, or please sugets me an app any other app to experience FMG.
Regards
Ankush
If you are opening a socket connection, refer to the documentation and different events which are dispatched by the Socket class. Add event handlers to the following events and update the message box when the corresponding events fire.
close: Dispatched when the server closes the socket connection.
connect: Dispatched when a network connection has been established.
ioError: Dispatched when an input/output error occurs that causes
a send or load operation to fail.
securityError: Dispatched if a call to Socket.connect() attempts to
connect either to a server outside the
caller's security sandbox or to a port
lower than 1024.
socketData: Dispatched when a socket has received data.

Resources