BizTalk Scheduled Task Adapter is now officially available for BizTalk Server 2013 R2

Posted: February 19, 2015 in BizTalk
Tags: , , , ,

After many requests and many postponements, due to my unavailability and free time to take these tasks, BizTalk Scheduled Task Adapter is finally officially available (version 5.0) and optimized for BizTalk Server 2013 R2!

You can download this new version of the adapter in BizTalk Scheduled Task Adapter CodePlex project page:

The BizTalk Scheduled Task Adapter is an in-process receive adapter that executes a prescribed task on a daily, weekly or monthly schedule. The adapter is configured entirely within BizTalk, all configurations is stored within the SSODB and can be exported and imported via binding files.
The schedule capabilities are similar to those available with the Windows Scheduled Task Service.

In this new version and despite additional custom tasks can be created and I’m planning on adding more, we still have the same four simple tasks present in previous editions:

  • XmlStringStreamProvider – generates a BizTalk message from a configured Xml string
  • FileStreamProvider – generates a BizTalk message from the contents of a file
  • HttpDownload – generates a BizTalk message from data downloaded from a web site
  • SQLStreamProvider – generates a BizTalk message from the contents of a SQL Query (similar to the old SQL adapter)

 

BizTalk Scheduled Task Adapter Release 5.0 for BizTalk Server 2013 R2

Requirements

The Scheduled Task Adapter v5.0 is optimized and designed to be used with BizTalk Server 2013 R2 (Compiled in .NET Framework 4.5).

V5.0 Change log

  • Compiled in Visual Studio 2013 and .NET Framework 4.5.
  • Optimized for BizTalk Server 2013 R2.
  • Support for 32 and 64 bit Host Instances.
  • Bug fixes
    • Bug: Issues multiple messages for timespan with more than 60 seconds – Solved

BizTalk-Server-2013-R2-BizTalk-Scheduled-Task-Adapter-v5.0-timespan

    • Bug: XmlStringStreamProvider task page properties not showing XML Text Editor Box – Solved
    • Bug: FileStreamProvider task page properties not showing Open File Dialog Box – Solved
    • Bug: SQLStreamProvider task page properties not showing Data Link properties Box to easy configure the SQL Connection string – Solved
    • Bug: Find task window showing all task components disabled – Solved
  • Improvements
    • SQLStreamProvider task now enables you to define SQL Timeout property – credits to MACoronado
    • Tasks Properties are now better organized and with better descriptions

BizTalk-Server-2013-R2-BizTalk-Scheduled-Task-Adapter-v5.0

Release History

This adapter is available since BizTalk Server 2004.

  • Release 5.0: release in February 18 2015 by Sandro Pereira, this adapter was tested to work on BizTalk Server 2013 R2. Compiled in .NET Framework 4.5
  • Release 4.0: release in June 12 2012 by Sandro Pereira, this adapter was tested to work on BizTalk Server 2010. Compiled in .NET Framework 4.0
  • Release 3.0: release in Aug 10 2010 by Greg Forsythe, this adapter was tested to work on BizTalk Server 2009. Compiled in .NET Framework 2.0
  • Release 2.0: last release in Apr 20 2008 by Greg Forsythe, this adapter works with BizTalk Server 2006 and BizTalk Server 2006 R2. Compiled in .NET Framework 2.0
  • Release 1.02: last release in Apr 20 2008 by Greg Forsythe, this adapter works with BizTalk Server 2004, BizTalk Server 2006 and BizTalk Server 2006 R2. Compiled in .NET Framework 1.1

 

Download

You can download this new version of the adapter in BizTalk Scheduled Task Adapter CodePlex project page:

Comments
  1. Hi Sandro,

    I’m curious; how do you handle the synchronization when you have multiple host instances using the same adapter? I’ve thought about writing such an adapter myself, but found it difficult to guarantee that only one message is being generated at a time…

    Johannes

  2. I did a quick code check of the source code; I could not find any code that indicates such a feature. That would limit the use of the adapter to a single host instance on a well defined machine. With regards to resiliency such a feature would be really helpful, and is also the main reason we do not use such an Adapter in our Environment.

    • Check Greg Forsythe explanation at: http://biztalkscheduledtask.codeplex.com/discussions/405013

      “You cannot use this adapter on multiple instances of the same Host, just like the FTP adapter. The reason being, a receive location is operational on all running host instances. So the receive location will fire once for every running host instance.
      If you have three servers all running instances of the same host with a schedule task receive location running in this host you will get 3 messages published at the same time.

      You can use the adapter on instances of different hosts. Here the receive location is tied to a particular host, i.e. receivelocation1 on host1 and receivelocation2 on host2

      The only way to overcome this behaviour is for a receive location to synchronise itself with all running instances. Given that the instances will be running on different servers they cannot communicate directly with each other. The easiest way would be for the receive locations to communicate via a database table. And only the first instance hitting this table would fire – not sure of the exact mechanism, maybe a trigger that errors if the scheduled time is the same.”

      Alternatively you can use BizTalk Scheduled Task Adapter on Failover cluster

      • Indeed, the synchronization via database table was the main reason I didn’t start with the implementation, because there’s no “native” place to actually put this table. Creating a database with one table and one database row just for the purpose of synchronization was a path I did not want to follow. We do no produce a Trigger on a time Basis with an external Software (whose main purpose is running Batches at defined Points in time).

        Thanks anyway for explaining this to me.

        Johannes

  3. tr0users says:

    Hi Sandro

    I have v5 of the BizTalk scheduled task adapter installed to test and live servers. It is configured to run with the following class – triggered every 2 minutes

    ScheduledTaskAdapter.TaskComponents.FileStreamProvider, ScheduledTaskAdapter.TaskComponents, Version=4.0.0.0, Culture=neutral, PublicKeyToken=aa9f2dd0f13442dc

    It is pointing at a local xml file

    It works fine on the test environment but on the live environment the receive location shuts down after the first poll and the followed error is logged:

    The receive location “RcvScheduledTask_Loc” with URL “schedule://TimeSpan/GetEmail” is shutting down. Details:”Unable to cast object of type ‘ScheduledTaskAdapter.TaskComponents.FileStreamProvider’ to type ‘ScheduledTaskAdapter.TaskComponents.IScheduledTaskStreamProvider’.”.

    Any ideas where I’m going wrong please?

    Thanks,

    Rob.

    • tr0users says:

      I have now found the cause of this problem – all my fault, again!

      Within the binding for receive location look for

      \\\\
      Here you should find a element. Problem was I’d forgotten to update the version. After the update the content should read:

      ScheduledTaskAdapter.TaskComponents.FileStreamProvider, ScheduledTaskAdapter.TaskComponents, Version=5.0.0.3, Culture=neutral, PublicKeyToken=aa9f2dd0f13442dc
      This problem was being masked on the Test server because v4 of the scheduled task adapter assemblies were still present in the GAC – along with the v5 assemblies

  4. Hi All,

    I have an requirement where I want to read multiple files from location and perform this schedule task activity based on input of files,…

    I am trying to change the GetStream Method so that it can return stream array to adapter .. but it is getting failed with below error.. at receive port

    task is shutting down. Details:”Unable to cast object of type ‘ScheduledTaskAdapter.TaskComponents.FileStreamProvider’ to type ‘ScheduledTaskAdapter.TaskComponents.IScheduledTaskStreamProvider’.”.

    I have changed method as below

    public Stream[] GetStream(object parameter)
    {
    string inputPath = Convert.ToString(parameter);
    string[] totalFiles = Directory.GetFiles(inputPath);
    Stream[] myStream = new Stream[totalFiles.Length];
    for (int i = 0; i < totalFiles.Length; i++)
    {
    myStream[i]= new FileStream(totalFiles[i], FileMode.Open, FileAccess.Read);
    }

    return myStream;

    }

    Thanks,
    Amit Patel

  5. jeffb831 says:

    I am running version 5.0 on a BT 2013 environment and have several tasks scheduled to run at certain times throughout the day. For several days they run at the exact scheduled time but after a few days, they run 10 minutes late and continue to do so until the host instance is restarted. Has anyone seen this issue?

  6. Anonymous says:

    Hi Sandro, Is it planned to release a “ServiceBus” task to publish a message in a ServiceBus Queue / Topics ?

  7. arihant jain says:

    Hi Sandro, we are using your schedule adapter 5.0 and it has been working fine since 1 year, we use it to run the schedule at timespan of 30 mins and 1 hour, from last 2 weeks I have started getting the double trigger issue, and which is causing a real problem in our prod environment. can you please let us know the fix for it

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s