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 File processing

Post new topic  Reply to topic
 FileInput Node File processing « View previous topic :: View next topic » 
Author Message
mpong
PostPosted: Thu Nov 12, 2015 3:15 pm    Post subject: FileInput Node File processing Reply with quote

Disciple

Joined: 22 Jan 2010
Posts: 164

Is there any way to control file input node from picking up the files until source completes its writing.

We have issue where we are looking for *.xml files in the input directory and JDE places file with .xml and then writs it (We have already told them they should not write the file in IIB directory until jobs completes but not possible there ). As soon as IIB finds .xml file it moves to mqsitransit or backout folder(depending on retry).

We can not implement retry mechanism as we do not know how much time it may take to complete the file writing.

I can not use file read node as file name is randomly generated . There is an another tool which used for this earlier and it is able to wait until the file lock is over and then it process it, is it possible in IIB. Please suggest.
Back to top
View user's profile Send private message
zpat
PostPosted: Thu Nov 12, 2015 11:00 pm    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

Several ways.

1. Make your writing software using file locking (something that, incredibly, is optional in the world of Unix).

2. Create the file with a different suffix, then rename it after it is written (and set the file node to look for the new suffix only).
_________________
Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error.


Last edited by zpat on Mon Apr 25, 2016 5:00 am; edited 1 time in total
Back to top
View user's profile Send private message
mpong
PostPosted: Thu Nov 12, 2015 11:20 pm    Post subject: Reply with quote

Disciple

Joined: 22 Jan 2010
Posts: 164

Thanks for the response, right now JDE creates file with .tmp and then it also creates a actual file with .xml and starts writing, issue is IIB picks up as soon as it finds .xml, from IIB perspective it is correct.

But the problem is source can not change the logic as the impact is high.
Back to top
View user's profile Send private message
zpat
PostPosted: Fri Nov 13, 2015 3:30 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

The file node uses file locking, if the file writing software does not - then it is not really safe.

The rename approach has minimal changes needed.

Increasing the scan interval on the file node will reduce the chance of picking up a partial file.
_________________
Well, I don't think there is any question about it. It can only be attributable to human error. This sort of thing has cropped up before, and it has always been due to human error.


Last edited by zpat on Mon Apr 25, 2016 5:01 am; edited 1 time in total
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Nov 13, 2015 7:33 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

some now overused rant about files and the Halting Problem.
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Nov 13, 2015 7:49 am    Post subject: Re: FileInput Node File processing Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

mpong wrote:
There is an another tool which used for this earlier and it is able to wait until the file lock is over and then it process it, is it possible in IIB.


Yes, but you need to have a real file lock (an OS one). If the product that's writing the file doesn't instantiate a lock (and many don't, to improve performance) then the file isn't actually locked and IIB will be unable to distinguish it from a completed file.

The "another tool" almost certainly isn't using file locking but one of the other "quick & dirty" methods available in Unix to try and see if the file's in use / being written to.

The rename method is your best solution as a "poor man's file lock". I echo my most worthy associates tokenized rant about files and the halting problem.
_________________
Honesty is the best policy.
Insanity is the best defence.
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 File processing
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.