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 » Read latest file in a folder

Post new topic  Reply to topic
 Read latest file in a folder « View previous topic :: View next topic » 
Author Message
shrutiagarwal228
PostPosted: Tue Sep 09, 2014 10:09 pm    Post subject: Read latest file in a folder Reply with quote

Newbie

Joined: 20 Jan 2014
Posts: 3

Please help me to understand if there is a possibilty to read the latest file in the folder.
there is no naming convention defined for the file i just want to read the latest file from a folder
Back to top
View user's profile Send private message
vicentius
PostPosted: Wed Sep 10, 2014 3:02 am    Post subject: Reply with quote

Apprentice

Joined: 01 Mar 2013
Posts: 28

Please share with us what you want to accomplish. I am curious what is the business case that would require reading the newest file in a folder.
I am also curious if said business case imagined that after the newest file is polled from the input folder and successfully processed, the next newest will be read and so on until, maybe, all files are read.
Back to top
View user's profile Send private message
shrutiagarwal228
PostPosted: Wed Sep 10, 2014 3:34 am    Post subject: Reply with quote

Newbie

Joined: 20 Jan 2014
Posts: 3

Yes the requirement is to only pick the newly added file and process.
we need not process the subsequent files. only process the latest file.
Could you please let me know if this is possible in MB
Back to top
View user's profile Send private message
vicentius
PostPosted: Wed Sep 10, 2014 4:20 am    Post subject: Reply with quote

Apprentice

Joined: 01 Mar 2013
Posts: 28

shrutiagarwal228 wrote:
[...]we need not process the subsequent files. only process the latest file.[...]


So you want to develop a flow that picks exactly one file from the input folder, specifically the latest one. Then process the file according to the requirements of the business process, do something with it. Then what do you do? Stop the flow? Undeploy? Or maybe there's a possibility the flow could be used again in the future, for other files?

To not-really-answer your not-a-question, I could think of ways to do exactly once processing inside a flow, mostly hackish to be honest, but I'm pretty sure this was hardly the use case IBM imagined when developing Message Broker.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Sep 10, 2014 4:28 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

So what happens if you read the "newest" file, but before you're done processing it, a newer file arrives in the folder?
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Sep 10, 2014 5:08 am    Post subject: Reply with quote

Grand High Poobah

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

shrutiagarwal228 wrote:
Could you please let me know if this is possible in MB


So you want to point WMB at a given directory filled with files whose names are random, process only the newest one and stop.

When does it start again? How will the flow (which is now somehow ignoring the directory) know a "new" file arrives? Is this some kind of scheduled process where at some random point in time you process the "newest" file? If so, whatever triggers the flow to start can clear out all the files but the newest before it does so.

You must also have a process to stop the flow again after it's processed the file or it'll start working on the contents of the directory as files arrive. This same process can also notify whoever sent a "newer" file after processing started (as my most worthy associate outlines) that they're out of luck and their processing has failed.

This is a clear use case for a retained publication.
_________________
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 » Read latest file in a folder
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.