BizTalk - Exception Handling and Send Alert to System Administrator - biztalk

In Microsoft BizTalk Application when exception occurred then Services or port will goes to in suspended mode and need to manually start application or port.
What i want is when any exceptions occurred during message processing should send one email alert to system administrator and details of exception should be stored in separate database for further process.
Anyone have any better suggestion how we can do it.
Regards,
Rakesh

To handle the message failure secnario see using Failed Message Routing. As far as monitoring ports when they shut down you can either use MOM (expensive) or write a script to do what you want. There are many posts here in stackoverflow that address this... here is one such post.

To get an email alert sent for any messaging failures (i.e., a failure in a send or receive port)
For each send or receive port for which you want to track failures, edit the port properties and check the box for "Enable routing for failed messages"
For send ports, you'll find this option under "Transport Advanced Options".
The option for receive ports is under the General section of the port properties.
Create a new Send Port (perhaps in a separate "Exception Handling" BizTalk application) that uses the SMTP adapter to send the emails.
To send out all failed messages using this new port, create a filter on the send port with the Property ErrorReport.ErrorType == FailedMessage. That will evaluate as true for all messages that error on a send or receive port for which you enabled Failed Message Routing.
If you need to route messages differently, at a more granular level, then have a look at the properties on the Failed Message Routing page referenced by ChrisLoris.
To track exceptions for failed messages in a separate database, I would start with the Microsoft BizTalk ESB Toolkit Exception Management Framework, as it includes a database for this purpose and the mechanism to push exception/failed message data into that database (build atop Failed Message Routing). It even includes a web site to enable users to interact with the failed messages, which you can customize as you see fit or throw away altogether.
The instructions to install the just the Exception Management part of the ESB Toolkit are available at http://msdn.microsoft.com/en-us/library/ee250099.aspx. Microsoft's guide to using the ESB Exception Management is worth a review too and is here.

Related

How to send small message to microsoft message queue from BizTalk 2016?

I get the following error message when I try to send message to Microsoft Message Queue to server on the local network from BizTalk 2016 using the MSMQ adapter:
Could not load file or assembly
Microsoft.BizTalk.Adapter.MSMQ.MsmqLargeMessageWrapper.dll or one of
its dependencies. The specified module could not be found.
BizTalk, BizTalk Adapter Packs and BizTalk Enterprise Adapters are installed, and I am able to configure send and receive handlers and the send port itself.
Are there any pre-requisities I need to install?
Not very often you google and find four irrelevant answers...so what am I not getting?
Ok, got it. I was unlucky while I was thinking... ;|
MSMQ Adapter is built to call Windows Message Queuing queue on a Windows Server. If you call a remote queue, you need to activate Microsoft Messaging feature on the local server too - otherwise you end up with a simlar error message like above. It will forward the queue processing to the remote server.

BizTalk MSMQ Receive Locations Not receiving. Error details: The Messaging Engine is shutting down

So I have been running into this issue since we set up our BizTalk Server on a new network. We have the same MSMQ settings between the two servers.
The data stays in our AX MSMQ folders and has the correct permissions.
The system does not ever throw an error until I stop/restart the Receive Host Instances.
(we get one of these errors per message in any of our MSMQ ports)
Full error:
A message received by adapter "MSMQ" on receive location
"recv_loc_file_ax_2012_customer_message" with URI
"FORMATNAME:DIRECT=OS:AXSERVER\AXOUTPPDCUSTOMER" is suspended. Error
details: The Messaging Engine is shutting down. MessageId:
{65E24FE1-317E-4636-AFC7-B43FACBDBEDF} InstanceID:
{6618EEB3-9B72-4123-BD8C-422661A59BDD}
Then the messages finally appear under suspended instances after this error occurs. I am able to resume them and they all process as expected.
I have looked almost every, Anyone have suggestions for what is causing these messages to not be read into my MSMQ receive ports properly?
EDIT: This BizTalk server is connecting to a remote AX server's MSMQ, but I am doubting this changes anything I have not already looked into.
Thank you very much.
The error was on the guys who installed MSMQ on the remote server; the active directory was not set up thus not properly autenticating my BizTalk Server account.
Answer for BizTalk: The way to find these hidden errors was by changing the MSMQ BizTalk receive port to a WFC-NetMSMQ.
Other: we are a little baffled that BizTalk was able to take the messages out of MSMQ despite the AD not being set up and "force messages through" but this is a minor detail to note.
BizTalk reference

Receive Port is not showing up in the list of Activation Subscriptions

I'm troubleshooting a very generic BizTalk error that is resulting in transmission/routing failures (see below). Even though my receive location is started, it does not appear to be listening for anything. When I run a query for all Activation Subscriptions, the receive port is not showing up in the list. I cannot figure out why it is not subscribing to my send ports.
Error:
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.
One Way Receive locations don't have Active subscriptions, only Orchestrations, Send Port Groups and Send Ports do. For a One Way your Send Port should be listening to your Receive Port rather than your Receive Port to your Send Port.
If it is a Request / Response port then see section below
One Way Receive Location
A Receive Location picks up from an external location and it goes via the associated receive port and publishes into the message box.
As your error clearly indicates that the message has been published to the message box the receive port is obviously working (although maybe not correctly) or it has been published back from a send port or orchestration.
What you have to check is
The context properties on the suspended message using BizTalk Administrator
The Subscription belonging to the Send Port / Orchestration that you expect to handle the message
Compare the two and see what does not match
The possibilities are
Your Receive Port is not promoting the properties you expect. Check the receive pipeline and promoted properties on the schema. If your pipeline is set to pass thru, only some of the standard promoted properties will be there and no message type or promoted properties from the schema, if you need those promoted properties set your pipeline to XMLReceive or a custom pipeline with either a XML Disassembler or a Flat File one.
Your Send Port / Orchestration are not in an Enlisted state, if they aren't enlisted then no subscriptions are published for them. Enlist or Start them.
Your Send port/Orchestration subscription is wrong (does not match the message context properties), correct them so that they match.
Request/Response Receive Port
For a Request Response Receive location/port it creates an Instance Subscription for a message which looks for BTS.EpmRRCorrelationToken (which contains details of the hostinstance, port and a GUID) and BTS.RouteDirectToTP == True
It works out of the box if you either have a Request/Response Send port subscribing to a Request/Response receive port, or if you use a Request/Response Port in an Orchestration. If you use separate Receive Send Ports in the Orchestration you need to set the above properties in your message construct shape manually.
See Messaging-only request-response correlation
Thanks for the clarification on receive locations. I'm new to BizTalk, as I have recently inherited the role of supporting it. The problem ended up being an incorrect reference in an endpoint behavior extension in the receive location.

Error while calling VSO Rest API from BizTalk WCF-WebHttp Adapter

I have created a BizTalk application to connect to VSO Rest API to fetch or create work items.
I have configured a wcf-webhttp adapter for calling the rest API.
Before configuring the adapter, I have tested the API with console application and getting the results with same URL.
While running the application I am getting following error:
The adapter failed to transmit message going to send port "SendPort" with URL "the URL". It will be retransmitted after the retry interval specified for this Send Port. Details:"System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at https://xxx.visualstudio.com/defaultcollection/_apis/wit/workitems/2
connected host has failed to respond 23.98.150.230:443
But when I paste the URL in the browser I am able to see the result returned by API in the browser.
What could the issue be?

How to correlate service instances in biztlk queries?

I have a solution where I receive a message over a two way receive port, which an orchestration subscribes to. The orchestration then calls a web service and returns a translated form of the web service response to the receive port.
If I run a completed service instances query in the BizTalk administration console I can see the receive ports receive pipeline, the orchestration, the web service transmit and receive, and the receive ports send pipeline all completed. From the results of that query it is not possible to correlate each service instance together. I can correlate the receive pipeline and send pipeline of the receive location because they have the same service instance, but I can't tell which orchestration service instance and which web service instance correlate to those...
This may not be exactly what you want, but if you right click the orchestration service instance and select "Message Flow", find the outbound message that calls the web service and click on the pipeline link, that will give you the message flow for that service (the pipeline), which includes the service id.
Right click orchestration, select "Message Flow".
Click on the link to the send part of your web query.
This will give you the service details (the pipeline)

Resources