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 » FileNotFoundException in receiving application

Post new topic  Reply to topic
 FileNotFoundException in receiving application « View previous topic :: View next topic » 
Author Message
gs
PostPosted: Fri Aug 22, 2014 3:57 am    Post subject: FileNotFoundException in receiving application Reply with quote

Master

Joined: 31 May 2007
Posts: 254
Location: Sweden

We've got a a message flow which basically looks like this:
FileInput node -> compute node -> FileOutput node.
The file nodes are connected to remote windows servers through windows file sharing.
The messages are XML based and nodes are configured to use the whole file (no records). Output node is configured to use a staging directory (mqsitransit).

Now this works great most of the time but every now and then the receiving (java) application reports errors. They do a listFiles() every 5 seconds on the input directory and then go through every file returned from the method. Sometimes they get a FileNotFoundException for one of these files. Later when they try again it works just fine for the very same file.

Any hints, ideas, comments, similar experiences on this issue?
Could WMB have any part in this or is it strictly an OS issue?

I see two solutions to this which are:
1) have the application wait for a short while between listFiles() and opening the file
2) have the application catch the exception and retry later.

WMB 8.0.0.4 on Windows Server 2008 R2
Back to top
View user's profile Send private message
McueMart
PostPosted: Fri Aug 22, 2014 4:12 am    Post subject: Reply with quote

Chevalier

Joined: 29 Nov 2011
Posts: 490
Location: UK...somewhere

Maybe add a exists() and canRead() check when iterating through the list of files returned from listFiles()?

I expect this is a OS/Windows file sharing issue whereby the file becomes visible before it's actually readable.

Just a guess!
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Aug 22, 2014 5:21 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

It's almost like you're discovering that using files to exchange data between application is a really bad idea.

Knowing whether or not a file is "ready" to be procesesd is THE HALTING PROBLEM.

It is unsolvable!

You can take a *lot* of steps within your code to make sure, EVEN UNDER THE CONTROLLED CONDITIONS OF LOCAL FILE SYSTESM, that you cover all of the eventualities.

Or you can *skip* ALL of that work, and rewrite the java app to accept MQ messages instead of Files.

REALLY. USE MESSAGES NOT FILES.

You're only scratching the surface of the problems you'll have to deal with. "The file wasn't there, except it said it was", "well, we read *most* of the file... "



YOU ARE STARTING DOWN A HARD ROAD. TURN BACK NOW.
Back to top
View user's profile Send private message
gs
PostPosted: Fri Aug 22, 2014 5:33 am    Post subject: Reply with quote

Master

Joined: 31 May 2007
Posts: 254
Location: Sweden

mqjeff,

Different customers have different integration maturity, budget, target architecture etc. Very often the ideal solution doesn't correlate with the reality you work within.
Back to top
View user's profile Send private message
gs
PostPosted: Fri Aug 22, 2014 5:34 am    Post subject: Reply with quote

Master

Joined: 31 May 2007
Posts: 254
Location: Sweden

McueMart wrote:
Maybe add a exists() and canRead() check when iterating through the list of files returned from listFiles()?

I expect this is a OS/Windows file sharing issue whereby the file becomes visible before it's actually readable.

Just a guess!


Thanks, good points to take into account for the application team.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Aug 22, 2014 7:29 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

gs wrote:
mqjeff,

Different customers have different integration maturity, budget, target architecture etc. Very often the ideal solution doesn't correlate with the reality you work within.


So let's review.

Your customer is willing to have you spend what will be *at least a week* of interative changes to make their file based approach more reliable.

But they're not willing to have you spend three days changing it to use MQ?

Customer has Broker. Customer therefore has MQ. Customer therefore can use MQ to receive data at endpoint applications.

I repeat.

You are going to have spend a lot more time fixing this problem than you think you will.

And the fact that "exists" and "canRead" will return true does not remotely tell you that the file is complete and written.
Back to top
View user's profile Send private message
gs
PostPosted: Wed Aug 27, 2014 5:23 am    Post subject: Reply with quote

Master

Joined: 31 May 2007
Posts: 254
Location: Sweden

mqjeff wrote:
gs wrote:
mqjeff,

Different customers have different integration maturity, budget, target architecture etc. Very often the ideal solution doesn't correlate with the reality you work within.


So let's review.

Your customer is willing to have you spend what will be *at least a week* of interative changes to make their file based approach more reliable.

But they're not willing to have you spend three days changing it to use MQ?

Customer has Broker. Customer therefore has MQ. Customer therefore can use MQ to receive data at endpoint applications.

I repeat.

You are going to have spend a lot more time fixing this problem than you think you will.

And the fact that "exists" and "canRead" will return true does not remotely tell you that the file is complete and written.


It's not me you have to convince (in a rather harsh fashion) but the customer.

Let's just say this...what you prefer and recommend as an external partner doesn't always resonate with the customer. Some counter-arguments valid, some not.
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 » FileNotFoundException in receiving application
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.