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 » FileInput Node

Post new topic  Reply to topic
 FileInput Node « View previous topic :: View next topic » 
Author Message
ggriffith
PostPosted: Thu Jun 05, 2008 2:20 am    Post subject: FileInput Node Reply with quote

Acolyte

Joined: 17 Oct 2007
Posts: 67

Is it guaranteed that the FileInput node will not read a file from source until the file has finished being written.
Back to top
View user's profile Send private message
AkankshA
PostPosted: Thu Jun 05, 2008 2:24 am    Post subject: Reply with quote

Grand Master

Joined: 12 Jan 2006
Posts: 1494
Location: Singapore

yes...

from the product documentation..
FileInput has a built-in mechanism that avoids processing of open files (for
example, files that are not yet fully formed because the producing application is still writing to them).
_________________
Cheers
Back to top
View user's profile Send private message Visit poster's website
ggriffith
PostPosted: Thu Jun 05, 2008 2:32 am    Post subject: Reply with quote

Acolyte

Joined: 17 Oct 2007
Posts: 67

Thanks AkankshA
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Jun 05, 2008 3:26 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

With apologies to mqpaul, I think it is not a guarantee. I think it is an 'everything that can be done has been done' situation.

A simple example is the case where an application is repeatedly open/write/close the file to append records.

Or, if a file is on an NFS mount, and the writing application is on a remote machine, the lock will almost certainly not be visible to the Broker (NFS is special that way).

It's a very hard problem to ensure that some given file is not being accessed by a remote application, and to know when a file is 'ready', without having intimate knowledge of the contents of the file and the process writing to it.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
ggriffith
PostPosted: Thu Jun 05, 2008 4:58 am    Post subject: Reply with quote

Acolyte

Joined: 17 Oct 2007
Posts: 67

That's a shame, but understandable. We'll just have to work ( arrange things ) around the problem.

Thanks
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Jun 05, 2008 5:03 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

If you understand your given situation well enough, you may be able to treat it as a guarantee.

It's only when you are putting the FileInput node in a situation where "anything can happen" that you have to take extra steps to increase reliability.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
joebuckeye
PostPosted: Thu Jun 05, 2008 6:06 am    Post subject: Reply with quote

Partisan

Joined: 24 Aug 2007
Posts: 365
Location: Columbus, OH

In the UNIX world I believe it is common when one process is writing a file for another process to use that the writing process uses a filename that starts with a period (a dot-file). This creates a file "hidden" from normal directory queries. When the writing process is done it then renames/moves the file from the dot-filename to the regular filename.

Not sure if this would help you since you didn't mention what environment you are running under. And I don't know if the File Input node ignores dot files or not.
Back to top
View user's profile Send private message
ggriffith
PostPosted: Thu Jun 05, 2008 6:29 am    Post subject: Reply with quote

Acolyte

Joined: 17 Oct 2007
Posts: 67

Interesting point, and yes we are in the unix environment. Dare say someone will comment soon on whether the FileInput node ignores dot files or not. Can't test this myself as I have only have 6.1 on Windows
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Jun 05, 2008 8:28 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

The file node will ignore dot files if you tell it to ignore dot files.

regardless, if you write your file with a pattern that doesn't match the pattern the FileInput is watching, and then rename after completion, then the FileInput will never read the file "while it is being written".

As I said - if you know the situations of your file transfer and they are controllable, then you can ensure that the FileInput will never read a file that is not complete.

It's only when you do things like receive files from unreliable external parties that you have to start thinking about seriously complicated failure scenarios. And then you should question the value of exposing Broker to such an unreliable input source anyway...
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
mqpaul
PostPosted: Mon Jun 09, 2008 1:52 am    Post subject: Three ways to stop FileInput reading incomplete files Reply with quote

Acolyte

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


  1. The FileInput node respects operating system file locks. If the process creating the file locks it for R/W use, the FileInput node won't read it until process releases the lock. However, many UNIX applications don't lock their output file.
  2. Create the input file with a name that doesn't match the FileInput node Pattern - for example, with a leading dot, in which case the pattern should be "?*.*" or similar (you need the "?" to require at least one character before the "."). Rename it when complete.
  3. Create the input file in a subdirectory of the input directory, and when complete, move it to the input directory. This is the same process as the FileOutput node's use of the mqsitransit directory. (On UNIX, it's effectively the same as the rename option.)

_________________
Paul
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 » FileInput Node
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.