ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » FileOutput Node and locks on files

Post new topic  Reply to topic
 FileOutput Node and locks on files « View previous topic :: View next topic » 
Author Message
zpat
PostPosted: Thu Jun 11, 2009 11:36 pm    Post subject: FileOutput Node and locks on files Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

I have a message flow that produces files in a directory using the FileOutput node. Because we can't use the FTP Append feature in WMB 6.1 (AIX) - I have to run another script to FTP the files, this runs at intervals.

Is there a risk that this script (Korn shell) would pick up a file as it was being moved from the transit directory to the target directory, or does WMB keep the file locked until it's completely ready and moved?

The documentation is not entirely clear on this point. Does the final file move (after the file is finished) actually involve data being copied or is it simply a directory update operation?
Back to top
View user's profile Send private message
ovasquez
PostPosted: Fri Jun 12, 2009 3:55 am    Post subject: Reply with quote

Centurion

Joined: 09 Dec 2005
Posts: 141
Location: Lima, Peru

about your question, Yes is posibled
...BUT you can use long file(5MB) in FileOutput and test, is easy..
_________________
Oscar Vásquez Flores
Back to top
View user's profile Send private message Send e-mail
spazy
PostPosted: Fri Jun 12, 2009 6:59 am    Post subject: Reply with quote

Newbie

Joined: 02 Sep 2008
Posts: 8

in first part WMB store file to working directory and in second part move to target place.

I advice... after wmb stores big file in next step creates in another folder check file with zero size and script always pickup finshed file files.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Jun 12, 2009 7:19 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

The move from mqsitransmit is as atomic as the OS and disk subsystems and etc. allow it.

You should code your script, however, to assume the worst case.

This way you won't get surprised if something goes wrong.

Also, in general, file locks are not trustworthy.
Back to top
View user's profile Send private message
zpat
PostPosted: Fri Jun 12, 2009 9:16 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

OK, I may make the script pause for 1 sec between reading the directory for the files to FTP and actually doing the FTPs - that should avoid any accidents.

I will submit an enhancement request to IBM to add the Append FTP option to WMB 6.1
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Jun 12, 2009 9:41 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

zpat wrote:
OK, I may make the script pause for 1 sec between reading the directory for the files to FTP and actually doing the FTPs - that should avoid any accidents.


... check that the modification time on the file hasn't changed as well.
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Fri Jun 12, 2009 10:55 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

zpat, why can't you use WMB's built in ftp functionality to ftp those file via the FileOutput node?

http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r1m0/topic/com.ibm.etools.mft.doc/ac55462_.htm

I've only just begun reading up on these File* nodes, so maybe I'm missing something basic about our requirement that they can't handle.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
zpat
PostPosted: Fri Jun 12, 2009 12:30 pm    Post subject: Re: FileOutput Node and locks on files Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

zpat wrote:
Because we can't use the FTP Append feature in WMB 6.1 (AIX) - I have to run another script to FTP the files, this runs at intervals.


Because I must append the data at the destination (which happens to be an AS/400) using FTP and WMB 6.1 does not support this (fairly common) FTP option.

I don't want to use NFS or other means of accessing the disks remotely since this has to replace a current FTP process with no changes.
Back to top
View user's profile Send private message
mqpaul
PostPosted: Mon Jun 29, 2009 3:13 am    Post subject: Re: FileOutput Node and locks on files Reply with quote

Acolyte

Joined: 14 Jan 2008
Posts: 66
Location: Hursley, UK

zpat wrote:
I have a message flow that produces files in a directory using the FileOutput node. Because we can't use the FTP Append feature in WMB 6.1 (AIX) - I have to run another script to FTP the files, this runs at intervals.

Is there a risk that this script (Korn shell) would pick up a file as it was being moved from the transit directory to the target directory, or does WMB keep the file locked until it's completely ready and moved?

The documentation is not entirely clear on this point. Does the final file move (after the file is finished) actually involve data being copied or is it simply a directory update operation?

Once it's finished writing the file, WMB will use AIX calls to rename the file. So the file will remain in the transit directory before it's complete, and will appear in the output directory after it's complete. If your script is looking in the transit directory, it may well be trying to use the file when WMB wants to move it to the output directory.

The broker keeps file system locks on the file in the transit directory while it's writing to the file. However, if your flows stop writing for a significant time (currently 5-7 seconds), the broker will close the file and release the locks. Therefore you cannot rely on locks on files in the transit directory.

In summary, you should only be using the file in the output directory. That will be complete, and not locked.
_________________
Paul
Back to top
View user's profile Send private message
zpat
PostPosted: Mon Jun 29, 2009 3:30 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

That what I do, I wouldn't want to mess about with files in the transit directory. Thanks.

Looks like the MQ user group will be at Hursley in time for the heatwave this week. No air-con in the old building I suppose?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » FileOutput Node and locks on files
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.