What is the main difference between Messages and Variables?
This basic answer to this question is quite simple, but it is still a complex issue that took me some time to understand.
· Messages can be sent and received, variables cannot.
· Variables are saved in the orchestration state using .NET serialization. Message parts are serialized into XML and are saved in this form (compressed though) in the message box.
· Message parts are not actually copied when copied/sent/received within BTS, as long as they are not modified. They are passed by DB reference.
· Property/distinguished field can only be applied to messages, and is optimized so that in many cases the data doesn't have to be loaded into memory, or is processed in chunks.
· Message parts are automatically converted between several formats (XmlDocument, .NET object, Stream, XmlReader, etc.)
· Messages are tracked, variables are not.
How to debug an assembly called by Orchestration
When a BizTalk component, pipeline component or orchestration, is deployed it references specific version of each of its dependent assemblies. If the version number does not match exactly the assembly will not be loaded, and if there are multiple versions available only the exact match will be loaded even though there are newer versions available. This is the normal behaviour for .NET!
A common mistake when you try to debug an assembly that is executed by BizTalk is that you debug the wrong version. This may be due to that the version number is changed each time you rebuild your project, this is controlled by the 1.0.* in AssembyInfo.cs. You will avoid problems by hard-coding the version to 1.0.0.
To actually put a break point in your dll - here is what you need to do:
· Build and GAC a debug version of your assembly.
· Restart BizTalk service (BTSNtSvc.exe)
· Attach VS.NET debugger to BTSNtSvc.exe and put a break point in your code.
· Run your orchestration.
How can I be sure that a message has been sent?
If your orchestration needs to know IF the message was successfully delivered you need to set the system context property "AckRequired" on the message before sending it, when the messaging run-time sees this property stamped on the message context it will fire an ACK back to the orchestration once the message is successfully sent.
However, you do not actually explicitly set the AckRequired context property in an orchestration. The orchestration designed has a more convinient way to do this, you simply set the Delivery Notification property on the send port to Transmitted. You will then get an exception if the send operation fails.
Normally when you submit a message to a send port this only means that the message has been sent to the MesasageBox accepted the message and informed the engine that it has ownership of that message, in the case of FILE it means the message has been successfully dropped to disc, nothing more. Similarly, if the transmission fails BizTalk will fire a NACK, you can use try-catch in your schedule to determine the outcome of the transmission. To get this behavior in Orchestration, the port should be marked with Delivery notification required; under the covers the property I mention below will be stamped on the message context.
For the ACK there is nothing to catch, you just won't exit the enclosing scope until the ACK (or NACK) has been received.
How much of C# syntax can you use in an Expression shape?
There are multiple limitations to the syntax in an expression shape. The main reason for this is that the language is NOT C#, but rather XLANG/S. The syntax is identical on supported languge constructs, but the limitations area many. As XLANG/S is so similar to C# in syntax you end up writing C#, just to be reminded of that you cannot use that construct or that keyword.
· Arrays are not supported.
· Indexers or parameterized properties are not supported. The lack of support for indexers are tightly coupled to the lack of support for arrays. This means that you cannot write code like this: res = coll[3];
· You cannot to call-chaining, e.g. xmlDoc.Nodex.Count.ToString() is illegal as you cannot call the ToString method. The worka-round for this scenario is to use System.Convert.ToString(xmlDoc.Nodes.Count).
· No support for using, this means that you need to use the namespace.class syntax all the time.
· foreach, for, do/while, break and continue are not supported.
· Simple types (integer, string, floating point) cannot have the dot operator applied to them. I.e, you cannot write code like this: 6.ToString();
· Comments work fine, but you need at least one statement in the expression box.
· Compound assignment (+=, -=, *=, etc) is not supported.
· Nor is it support to usemore than one assignment operator in a statement.
· Assignment within an “if” or “while” predicate is not supported.
· Increment, decrement are not supported (++, --).
· For message parts, the only member access allowed is on distinguished fields.
· Delegates and events are not supported.
· In construct shapes you cannot do any control flow (if/else or while).
How do you prevent occuring of zombies in a Parallel Convoy?
Refer to the article known as "Convoy Deep Drive" on MSDN
What is the difference between a delay shape vs a listen shape?
A 'Delay' is very much similar to a sleep on the current thread. A 'Listen' shape is used to wait for an incoming resource, with a timeout period.
When you use Call Orchestration shape vs Start Orchestration shape?
A Call Orchestration returns the control back to the caller. A Start Ochestration shape starts the orchestration in a non-deterministic way.
What is the difference between a "Message Assignment" shape and an "Expression" shape?
A "Message Assignment" shape is used to create a new message and assign values to it. A Expression shape is used to assign values to variables and also write 'if' conditions.
Does BizTalk Orchestrations support recursion?
An Orchestration does NOT support recursion.
What is the purpose of the property "Activate" in a Receive shape?
It is used to invoke a new instance of an Orchestration.
Can an orchestration Start without an Activatable receive?
A Nested Orchestration can be started without an Activatable receive
Is it necessary for all .NET components being called from an Orchestration be Serializable?
Yes it is necessary. There are cases where a .NET component need not be Serializable.
When do we need set the property "Synchronized" = true for a scope?
This needs to be set, when a variable is shared across the branches of a parallel shape.
What is the difference between an Exception block and a Compensation block? is it the equivalent of try-catch-finally?
Refer to HOW To Compensate a Transaction in a BizTalk Orchestration
Is it possible to have a exception block for an Atomic scope? if not why?
Refer to Parallel Branching and Scoping in BizTalk Orchestrations - Advanced Concepts
How does one enable Correlations in BizTalk?
First create a Correlation type and then create an instance of it.
Is it possible to share variables across two branches in a Parallel shape?
Refer to Parallel Branching and Scoping in BizTalk Orchestrations - Advanced Concepts
Does BizTalk automatically compensate a unsuccessful transaction?
Refer to HOW To Compensate a Transaction in a BizTalk Orchestration
What is the main difference between a Long-Running transaction and an Atomic Transaction in BizTalk context?
Refer to HOW To Compensate a Transaction in a BizTalk Orchestration
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment