tags:

views:

266

answers:

3

Hi, I want to be able to copy the file I have which comes in as XML into a new folder location on the server. Essentially I want to hold a back up of the input files in a new folder.

What I have done so far is try to follow what has been said on this forum post - link text

At first I tried the last method which didn't do anything (file renaming while reading). So I tried one of the other options and altered the orchestration and put a Send shape just after the Receive shape. So the same message that comes in is sent out to the logical port. I export the MSI, and I have created a Send Port in the Admin console which has been set to point to my copy location. It copies the file but it continues to create one every second. The Event Viewer also reports warnings saying "The file exists". I have set the Copy Mode of the port to 'overwrite' and 'Create New', both are not working.

I have looked on Google but nothing helps - BTW I support BizTalk but I have no idea how pipelines, ports work. So any help would be appreciated.

A: 

I think you should look at the Biztalk Message Archiving pipeline component. You can find it on Codeplex (http://www.codeplex.com/btsmsgarchcomp).

You will have to create a new pipeline and deploy it to your biztalk group. Then update your receive pipeline to archive the file to a location that the host this receive location is running under has access to.

Ben Runchey
+2  A: 

As the post you linked to suggests there are several ways of achieving this sort of result.

The first question is: What do you need to track?

It sounds like there are two possible answers to that question in your case, which I'll address seperately.

You need to track the message as received off the wire before BizTalk touches it

This scenario often arises where you need to be able to prove that your BizTalk solution is not the source of any message corruption or degradation being seen in messages.

There are two common approaches to this:

  1. Use a pipeline component such as the one as Ben Runchey suggests

    There is another example of a pipeline component for archiving here on codebetter.com. It looks good - just be careful if you use other components, and where you place this component, that you are still following BizTalk streaming model proper practices. BizTalk pipelines are all forwardonly streaming, meaning that your stream is readonly once, and all the work on them the happens in an eventing manner.

    This is a good approach, but with the following caveats:

    • You need to be careful about the streaming employed within the pipeline component
    • You are not actually tracking the on the wire message - what your pipeline actually sees is the message after it has gone through the BizTalk adapter (e.g. HTTP adapter, File etc...)
  2. Rely upon BizTalk's out of the box tracking

    BizTalk automatically persists all messages to the message box database and if you turn on BizTalk tracking you can make BizTalk keep these messages around.

    The main downside here is that enabling this tracking will result in some performance degradation on your server - depending on the exact scenario, this may not be a huge hit, but it can be signifigant.

You can track the message after it has gone through the initial receive pipeline

With this approach there are two main options, to use a pure messaging send port subscribing to the receive port, to use an orchestration send port.

I personally do not like the idea of using an orchestration send port. Orchestrations are generally best used to model the business flow needed. Unless this archiving is part of the business flow as understood by standard users, it could simply confuse what does what in your solution.

The approach I tend to use is to create a messaging send port in the BizTalk admin console that subscribes to your receive port. The send port will then just use a standard BizTalk file adapter, with a pass through pipeline.

David Hall
A: 

Hi guys, thanks for the quick responses.

As David has suggested I want to be able to track the message off the wire before BizTalk does any processing with it.

I have tried to the CodePlex link that Ben supplied and its points to 'Atomic-Scope's BizTalk Message Archiving Pipeline Component' which looks like my client will have to pay for. I have downloaded the trial and will see if I have any luck.

David - I agree that the orchestration should represent the business flow and making a copy of a file isn't part of the business process. I just assumed when I started tinkering around I could do it myself in the orchestration as suggested on the link I posted.

I'd also rather not rely on the BizTalk tracking within the message box database as I suppose the tracked messages will need to be pruned on a regular basis. Is that correct or am I talking nonsense?

However is there a way I can do what Atomic-Scope have done which may be cheaper?

**Hi again, I have figured it out from David's original post as indicated I also created a Send port which just has a "Filter" expression like - BTS.ReceivePortName == ReceivePortName

Thanks all**

BizTalkNewbie
Your idea will only give you the original message if you have not applied a map to the message coming in on the receive port. Otherwise you are going to get the output of the mapped document being sent to the send port that defines the 'BTS.ReceivePortname' filter.Yes the tracked messages in the BizTalkDTA (tracking) database will need to be archived. As for the link to Codeplex, my apologies for not noticing that they have removed support for the project. If you want it "cheaper" you could always code a pipeline yourself. But then you would have to do the dev/test/maintenance on it.
Ben Runchey
@BizTalkNewbie - as Ben said: The BizTalkDTA database will need purging and archiving jobs scheduled for it (it will anyway, since this is part of basic BizTalk server maintenance, but they will be more important the more data you put into tracking). Using the sendport method will not give you the pre-parsing, pre-decoding or pre-mapping document, so may not meet your needs. A pipeline component is probably the best option in your case, just be sure that it is done in a streaming manner and *possibly* look at a forwardonlystream. I'm linked to another implementaiton in my answer.
David Hall