BizTalk DevOps Monitor your BizTalk environment using PowerShell – Monitoring Host Instances with Auto-Healing capabilities

BizTalk DevOps Monitor your BizTalk environment using PowerShell – Monitoring Host Instances with Auto-Healing capabilities

In the sequence of my last two posts, welcome back, once again (probably the last one for now), to this serial of articles about Monitor your BizTalk environment using PowerShell. Today we will talk about a topic that a new topic, “How to monitor Host Instance in BizTalk Server using PowerShell”, and once again, we […]
Blog Post by: Sandro Pereira

BizTalk DevOps: Monitor your BizTalk environment using PowerShell -Monitoring Ports (Stopped/disabled/unelisted) with Auto-Healing capabilities

BizTalk DevOps: Monitor your BizTalk environment using PowerShell -Monitoring Ports (Stopped/disabled/unelisted) with Auto-Healing capabilities

In the sequence of my last post, welcome back, once again, to this serial of articles about Monitor your BizTalk environment using PowerShell. Today we will talk about a topic that was also previously covered by Jeroen, ” Monitor your BizTalk environment using PowerShell – Port monitoring”, but this time, I will also add Auto […]
Blog Post by: Sandro Pereira

Story behind our brand new website

Want tojump straight to the new website? Here you go –http://www.biztalk360.com One of the things that get overlooked often times in a business is the company website. It always takes a back seat.You burn your entire team energy up until the last minute focused on releasing the product and pay very little attention to the […]

The post Story behind our brand new website appeared first on BizTalk360 Blog.

Blog Post by: Saravana Kumar

BizTalk DevOps: Monitor your BizTalk environment using PowerShell -Monitoring Suspended Service Instances with Auto-Healing capabilities

BizTalk DevOps: Monitor your BizTalk environment using PowerShell -Monitoring Suspended Service Instances with Auto-Healing capabilities

Welcome back to this serial of articles about Monitor your BizTalk environment using PowerShell that already have several previous editions: Monitor your BizTalk environment using PowerShell – Disk Space Monitoring Monitor your BizTalk environment using PowerShell – SQL Agent Jobs Monitoring BizTalk DevOps: Monitor your BizTalk environment using PowerShell – SQL Agent Jobs Monitoring (Part […]
Blog Post by: Sandro Pereira

Re-play Production Suspended messages from start

Re-play Production Suspended messages from start

This post is to simply describe how to pull out all messages from the suspended instances in Production.
I’ve been recently involve in remediation work for my client, where they have 50000+ suspended messages due to target system failure and timeouts. Since the design initially do not cater to re-submit these suspended instances, I need to look for other alternative. We took a back up of the Message box and copied re-stored to other similar environment. The task was to pull out one specific schema message to re-play these suspended again in the production.
I’ve came up with a small VB script to actually pull out all messages for the  particular schema from suspended instances in message box.

‘ save_messages.vbs
‘ Enter cscript save_messages.vbs with no arguments from a command prompt for usage
‘ This script needs to be run under a user account that is a member of the BizTalk Administrators
‘ group. This script needs to be run on a machine that is configured with BizTalk administration
‘ tools.

dim objBtsWmiNS, objMsg, svcinsts, inst, msg, ndx, size

Dim aryHostNames()
Dim aryObjQueues()
Dim aryHostBatchSize()

Dim strKey2Instance
Dim strQuery2Msg
Dim strServiceName
Dim strMsgType
Dim strSavePath

On Error Resume Next
Dim objArgs: Set objArgs = WScript.Arguments
If ( objArgs.Count = 0 OR objArgs.Count > 4) Then
PrintUsage()
wscript.quit 0
End If

wmiQuery = “”

‘ServiceStatus = 16 – ‘Completed With Discarded Messages’ in BizTalk Server 2004
‘ServiceStatus = 32 – ‘Suspended (not resumable)’
‘ServiceStatus = 4 – ‘Suspended (resumable)’
‘ServiceClass = 64 – ‘Routing Failure Report’
‘ErrorId = “0xC0C01B4C” – is how ‘Completed With Discarded Messages’ are exposed in BizTalk Server 2006

If (objArgs(0) = “-Z” OR objArgs(0) = “-z”) Then
wmiQuery = “select * from MSBTS_serviceinstance where ServiceStatus=16 OR ErrorId=’0xC0C01B4C’”
End If

If (objArgs(0) = “-A” or objArgs(0) = “-a”) Then
wmiQuery = “select * from MSBTS_serviceinstance where ServiceStatus=4 OR ServiceStatus=32 OR ServiceStatus=16 OR ErrorId=’0xC0C01B4C’ OR ServiceClass=64”
End If

If (objArgs(0) = “-SR” or objArgs(0) = “-sr”) Then
wmiQuery = “select * from MSBTS_serviceinstance where ServiceStatus=4 and ErrorDescription like ‘%ExceptionInformation%’”
End If

If (objArgs(0) = “-SNR” or objArgs(0) = “-snr”) Then
wmiQuery = “select * from MSBTS_serviceinstance where ServiceStatus=32”
End If

If (objArgs(0) = “-DIS” or objArgs(0) = “-dis”) Then
wmiQuery = “select * from MSBTS_serviceinstance where ServiceClass=32 AND ServiceStatus=8”
‘ServiceClass = 32 ‘Isolated Adapter
‘ServiceStatus = 8 ‘Dehydrated
End If

saveMessagesBeforeTermination = True

If ( objArgs.Count > 1) Then
strSavePath = objArgs(1)
End If

If ( objArgs.Count > 2) Then
strServiceName = objArgs(2)
End If

If ( objArgs.Count > 3) Then
strMsgType = objArgs(3)
End If

If(wmiQuery = “”) Then
PrintUsage()
wscript.quit 0
End If

wscript.echo “->Connecting to BizTalk WMI namespace”
Set objBtsWmiNS = GetObject(“WinMgmts:{impersonationLevel=impersonate, (security)}.rootMicrosoftBizTalkServer”)
If Err <> 0 Then
CheckWMIError
wscript.quit 0
End If

wscript.echo “->Getting BizTalk host collection”
Set hosts = objBtsWmiNS.ExecQuery(“select * from MSBTS_HostSetting”)
If Err <> 0 Then
CheckWMIError
wscript.quit 0
End If

hostCount = hosts.count

ReDim aryHostNames(hostCount – 1)
ReDim aryObjQueues(hostCount – 1)
ReDim aryHostBatchSize(hostCount – 1)

wscript.echo “->Retrieve BizTalk host names and loading host queues”
ndx = 0
For Each host in hosts
wscript.echo “Found host ” & host.Properties_(“Name”)
aryHostNames(ndx) = host.Properties_(“Name”)
Set aryObjQueues(ndx) = objBtsWmiNS.Get(“MSBTS_HostQueue.HostName=””” & aryHostNames(ndx) & “”””)
If Err <> 0 Then
CheckWMIError
wscript.quit 0
End If
ndx = ndx + 1
Next

wscript.echo “->Getting collection of service instances”
Set svcinsts = objBtsWmiNS.ExecQuery(wmiQuery)

‘Iterate through instances and save them in host-specific arrays.

wscript.echo “->Start iterating service instances”
totalCount = 0
For Each inst in svcinsts
If (objArgs.Count = 1 Or (objArgs.Count > 1 And strServiceName = inst.Properties_(“ServiceName”) ) ) Then
wscript.echo “Found suspended instance “”” & inst.Properties_(“ServiceName”) & “”” on host ” & inst.Properties_(“HostName”)
‘Resolve host index
For hostIdx = 0 To hostCount-1
If aryHostNames(hostIdx) = inst.Properties_(“HostName”) Then
Exit For
End If
Next

’16 is an internal service class that cannot be terminated
If 16 = inst.Properties_(“ServiceClass”) Then
wscript.echo “Skipping BizTalk internal service instances (they cannot be terminated anyway)”
Else
’64 is a routing failure report and doesn’t have messages that can be saved
If 64 = inst.Properties_(“ServiceClass”) Or 16 = inst.Properties_(“ServiceClass”) Then
saveMessagesBeforeTermination = False
End If

errorCountSavingMessages = 0
If saveMessagesBeforeTermination Then

‘wscript.echo “Build Query”
If strMsgType > “” Then
strQuery2Msg = “select * from MSBTS_MessageInstance where ServiceInstanceID=””” & inst.Properties_(“InstanceId”) & “”” and MessageType = “”” & strMsgType & “”””
Else
strQuery2Msg = “select * from MSBTS_MessageInstance where ServiceInstanceID=””” & inst.Properties_(“InstanceId”) & “”””
End if

‘wscript.echo “Query is:” & strQuery2Msg

Set msgInsts = objBtsWmiNS.ExecQuery(strQuery2Msg)

For Each msg in msgInsts
msg.SaveToFile strSavePath

If Err <> 0 Then
CheckWMIError
wscript.echo “Failed to save MSBTS_MessageInstance”
wscript.echo Err.Description & Err.Number
errorCountSavingMessages = errorCountSavingMessages + 1
Else
wscript.echo “Saved message ” & msg.Properties_(“MessageInstanceID”)
End If
Next
End If
totalCount = totalCount + 1
End If

End If
Next

‘ Delete whatever is left
For hostIdx = 0 To hostCount-1
If aryHostBatchSize(hostIdx) > 0 Then
TerminateAccumulatedInstacesForHost hostIdx
End If
Next

wscript.echo “SUCCESS> ” & totalCount & ” instances were found and attempted to be saved”

‘This subroutine deals with all errors using the WbemScripting object.
‘Error descriptions are returned to the user by printing to the console.
Sub CheckWMIError()

If Err <> 0 Then
On Error Resume Next
Dim strErrDesc: strErrDesc = Err.Description
Dim ErrNum: ErrNum = Err.Number
Dim WMIError : Set WMIError = CreateObject(“WbemScripting.SwbemLastError”)

If (TypeName(WMIError) = “Empty” ) Then
wscript.echo strErrDesc & ” (HRESULT: ” & Hex(ErrNum) & “).”
Else
wscript.echo WMIError.Description & “(HRESULT: ” & Hex(ErrNum) & “).”
Set WMIError = nothing
End If

‘wscript.quit 0
End If

End Sub

Sub PrintUsage()
wscript.echo “Usage:”
wscript.echo “cscript save_messages.vbs < -Z | -A | -DIS | -SR | -SNR > SavePath [Port/Orchestration name] [MessageType]”
wscript.echo
wscript.echo ” -Z saves all “”Zombie”” instances (e.g. completed with discarded messages)”
wscript.echo ” -A saves all suspended and zombie instances as well as all routing failure reports”
wscript.echo ” -SR saves suspended resumable instances only”
wscript.echo ” -SNR saves suspended non-resumable instances only”
wscript.echo ” -DIS saves all dehydrated ‘isolated adapter’ instances”
wscript.echo ” optionally supply the name of the orchestration or port name to filter on specific instances”
wscript.echo
wscript.echo ” Ensure that the SavePath folder exists before running as that is where it saves the instances”
wscript.echo
wscript.echo ” Example: cscript save_messages.vbs -SR D:tempSuspended PublishInvoicePaymentStatusChange http://xyz/Channel/DynamicsAX/PaymentManagement/PublishInvoicePaymentStatusChange/v1#PublishInvoicePaymentStatusChange&#8221;
wscript.echo
End Sub

This Script can be called from the below batch file
cscript save_messages-CustomCluckHA.vbs -SR “C:tempProcessor-SaveHASub_20151027” “Orchestration-TypName” “http://xyz/Assistance/Home/v1#HomeAssistAgreementChangedEvent&#8221;

After pulling out all the messages, we simply do the file drop in the production system. Our orchestrations cater for both one-way and two-way messaging patterns, so at the end it was easy.

Advertisements

Why is so hard to make a simple If-Then-Else Functoid?  well, not anymore!

Why is so hard to make a simple If-Then-Else Functoid? well, not anymore!

Sometimes I ask myself: Why is so hard to make a simple If-Then-Else Functoid, or even so painful to do an If-Then-Else operation, using BizTalk mapper? I don’t mean to say that it is complicated, quite the opposite, is quite easy to make IfThenElse statements using the Mapper. You can use If…Then…Else statements, to be […]
Blog Post by: Sandro Pereira

BizTalk360 Version 8.0 Review

BizTalk360 Version 8.0 Review

A new version of BizTalk360 has been released, version 8 which comes with a boatload of features and a complete overhaul of its user interface to provide an exceptional user experience. The product adopted a concept of widgets in the dashboard similar to the new Microsoft Azure portal. A BizTalk 360 user can now create and customize dashboards for different use cases.

The User Interface, Dashboards and Widgets.

In this post I will review a few of the new features and let’s kick off with the UI, which has improved dramatically. Intially BizTalk360 was a Silverlight application before it migrated to HTML 5. And in version 8.0 it has adjusted to what you experience on the Azure Portal and what you see with UI in devices. Below you see a customized dashboard with several widgets.

Figure 1. An example of my customized monitoring dashboard.

The end user has also the ability to create his own custom widgets via the settings page.

Picture 2. An example of creating a custom widget.

Furthermore the separation of monitoring and analytics is based upon audience targeting. An analyst or support engineer can interpret information of messaging and processes within a BizTalk Group from a different perspective as shown below demonstrating a customized dashboard.

Figure 3. An example of a customized analytics dashboard..

BizTalk360 API’s

Another incredible addition are the API’s, which offer a tremendous amount of value to enterprise customers. It brings extreme extensibility for its end users and enables the for instance to pull information from several environments. The API’s (REST web services) are the core of the BizTalk360 capabilities and the BizTalk360 front-end uses them. And as a BizTalk360 end user you can leverage all of these API’s to have access to your BizTalk environment. In the setting menu under API Documentation you can find the descriptions of each API and operation. For instance if you select BizTalkApplicationService you can observe a list of operations belonging to it. Subsequently select one of the operations, Services.REST/BizTalkApplicationService.svc/GetOrchestrations, specify the environmentId and applicationName and hit “Try it out!”.

Figure 4. BizTalk360 API’s document page..

You can call the API’s from different machines, by setting the appropriate authorization in the user access policy. Calling the API operation from SoapUI will result in the same response as from BizTalk360 API Documentation.

Figure 5. Calling BizTalk360 API from SoapUI.

The look-and-feel are similar when you publish an (Web) API configured with swagger documentation describing it.

Business Rules in a browser

Yet another new feature added to BizTalk360 is the rule engine capability of BizTalk Server i.e. the business rule and composer are accessible from a browser. You can view what type rules are deployed.

Figure 6. Deployed rules in a BizTalk Group.

And one of the capabilities is that you as end user can compose new rules, edit or test them. Below you see an example of testing a deployed rule, which you can do in a browser!

Figure 7. Test of a deployed business rule.

The version of the business rules composer in BizTalk360 only supports pre-created vocabularies. Therefore, to ensure a smooth user experience, you need to create all the vocabularies you will require to develop or edit your rules in the BizTalk Business Rules Composer. In a nutshell follow the instructions on the BizTalk360 portal with regards to rules.

Live feeds

In an enormous environment various operation people perform various actions in a production or UAT environment, and it can be valuable means of real-time tracking of what happens. This new version of BizTalk360 offers live feeds and you view on the right side after click the icon (indicated in red in the picture below).

Figure 8. Live feed in BizTalk Group.

Alarms and notifications

In BizTalk360 you can set alarms, which can result in an email being sent to you.

Figure 9. An example of email indicating a receive location is down.

Or you can leverage one of the out of the box notification channels like Slack and configure an alarm using a notification channel.

Figure 10. Enable the SlackNotification on a custom alarm.

Once you have set up Slack following the instructions on BizTalk360 UI and the alarm you will receive notifications in Slack.

Figure 11. Notification in Slack.

Final words

The BizTalk360 team has worked intensely the last 12 months to bring this to the table. Not just the flexibility with widgets, yet also with the separation of monitoring and analytics, the 360 plus API’s on top of your BizTalk Group, live feeds, notifications and the rules engine. This product has definitely evolved to the next level. Expect the release of 8.0 to change the way BizTalk is being monitored!

Cheers,

Steef-Jan

BizTalk360 Version 8.0 Review

A new version of BizTalk360 has been released, version 8 which comes with a boatload
of features and a complete overhaul of its user interface to provide an
exceptional user experience. The product adopted a concept of widgets in the
dashboard similar to the new Microsoft Azure portal. A BizTalk 360 user can now
create and customize dashboards for different use cases.

The User Interface,

Using API Management user subscription keys in the back-end API App

Using API Management user subscription keys in the back-end API App

When you create a Web API you can use it for your own applications but maybe you also want to expose it to the outside world. In that case you probably want to change the behavior of the Web API. For example add security or hide properties. You can use BizTalk to create a virtual service in front of your Web API to modify the behavior but is that the smartest choice?  Because BizTalk writes every message that it receives a couple of times to the MessageBox database. This increases heavily the execution time and especially with Web APIs it’s important to have a really low execution time!

Another option is to use Sentinet from Nevatech to create a virtual service in front of your Web API.
The virtual service runtime in Sentinet can also be extended with custom messages processing. Sentinet provides a number of build-in message processing components but it is also possible to create custom message processing components.

Let’s have a look at the following example where an Order Web API is used inside an organization to process orders. This Web API must also be exposed to external customers to show the status of an order but if an error occurs in the Web API or in a background process, the OrderStatus property must be modified that the order is still in progress and the ErrorMessage property with the error must not be shown to the customers. Furthermore the output of the Web API must be in XML instead of JSON.

Send request with Postman to Order Web API

The following steps in Sentinet are necessary to make it work:

  • Add the REST service (or API) to the the Sentinet Repository
  • Create a Virtual Service
  • Add custom Pipeline Processing
  • Test the Virtual REST Service

Sentinet makes it really easy to modify the response of a Web API. You only have to create a Virtual Service in front of it and add custom Pipeline Processing! Especially if you are already familiar with XPATH and XSLT, the example above doesn’t take long to implement.

Download:
Sentinet version 4.5

Understand Azure Event Hubs

For the past few months, I got hooked up with BizTalk360 and isolated myself from any deep technology learning. Now BizTalk360 version 8.0 is out of my way the team is kind of settled down, I thought it’s time to look deep into some of the technology areas I was intending to learn for some […]

The post Understand Azure Event Hubs appeared first on BizTalk360 Blog.

Blog Post by: Saravana Kumar