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 » Specify end of file to FileOuput Node when using FileRFead

Post new topic  Reply to topic
 Specify end of file to FileOuput Node when using FileRFead « View previous topic :: View next topic » 
Author Message
new2z
PostPosted: Mon May 20, 2013 8:05 pm    Post subject: Specify end of file to FileOuput Node when using FileRFead Reply with quote

Novice

Joined: 16 May 2013
Posts: 15

Dear All
I have a question about FileRead Node.

Here is my requirement

1. A dummy message is dropped on to a queue
2. This triggers a message flow which reads a file from the file system
3. The file has multiple records
4. Each of these records are read and processed using the fileRead node
5. Post Processing, all the records are again flushed to a File
6. This is done using a Fileoutput Node

This is how I have put my message flow

MQInput --> FileRead --> Compute --> FileOutput

The problem that I am facing is, I am unable to let Fileoutput node know that I have reached "end of the file". If i were using FileInput node, then I would have connected "End of Data" terminal to the "Finish File" terminal of the FileOuput Node.

I am unable to think of something in similar lines with FileRead Node. Can be "Finish File In" or "Finish File Out" terminal be helpful in this regard?

Kindly advice

Thank You
Back to top
View user's profile Send private message
Esa
PostPosted: Mon May 20, 2013 10:33 pm    Post subject: Re: Specify end of file to FileOuput Node when using FileRFe Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

new2z wrote:

I am unable to think of something in similar lines with FileRead Node. Can be "Finish File In" or "Finish File Out" terminal be helpful in this regard?



Why don't you try wiring "File Read"."Finish file out" to "FileOutput"."Finish File" and testing yourself what happens?
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue May 21, 2013 5:03 am    Post subject: Re: Specify end of file to FileOuput Node when using FileRFe Reply with quote

Grand High Poobah

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

new2z wrote:
If i were using FileInput node, then I would have connected "End of Data" terminal to the "Finish File" terminal of the FileOuput Node.


Why not use the FileInput node? It seems like all this message does is indicate the file is available; there are other methods.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
new2z
PostPosted: Tue May 21, 2013 8:13 am    Post subject: Reply with quote

Novice

Joined: 16 May 2013
Posts: 15

Thanks Esa, Vitor

I cannot use FileInput Node because I am picking up the File in the middle of the flow

Moreover, the incoming message in the MQInput acts as a trigger which tells me that it is time that I start the file processing now.

We are doing the file processing in a batch. I am getting a trigger (from external agent) to start my batch. An Autosys job sends the trigger (an MQ message) to the MQInput, then my flow starts.
Did i make sense?

Can i wire the "Finish File Out" terminal of the FileRead node to the "Finish" Terminal of the Fileoutput node?

I read the fileread node from the infocenter. It doesn't speak explicitly about the use of "Finish File Out" as an "End of Data" indicator. Can you please give me some link to read or may be some ideas? I want to read a little, then start doing experiments.
Kindly advise

Thank You
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue May 21, 2013 8:37 am    Post subject: Reply with quote

Grand High Poobah

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

new2z wrote:
I cannot use FileInput Node because I am picking up the File in the middle of the flow


Are you doing this because the processing of the data in the file requires it, or because your current design has an MQInput node on the front of it?

new2z wrote:
Moreover, the incoming message in the MQInput acts as a trigger which tells me that it is time that I start the file processing now.

We are doing the file processing in a batch. I am getting a trigger (from external agent) to start my batch. An Autosys job sends the trigger (an MQ message) to the MQInput, then my flow starts.
Did i make sense?


Yes, and my point is that there are other ways a flow which processes a file can have the file's availability indicated to it. Consider this: the file is assembled in a directory other than the one being monitored by the FileInput node or with a file name pattern the FileInput node isn't looking for. Once complete and ready to be processed, the file is moved or renamed as applicable, the flow picks it up and no trigger message is required.

Other methods are possible and may be better for your specific use case.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
new2z
PostPosted: Tue May 21, 2013 9:27 am    Post subject: Reply with quote

Novice

Joined: 16 May 2013
Posts: 15

Thanks Vitor

I understand what you are saying. In a shorter term, I cannot change things. There are certain guidelines which have been laid out by my predecessors and I have to abide by it.

I will change things going ahead, but it will take time

If i had no option (to use FileInput) but to use a FileRead node, then how would I do convey "End of Data" to the FileOutput Node?

Will it work, if i wire the "Finish File Out" terminal of the FileRead node to the "Finish" Terminal of the Fileoutput node?
Back to top
View user's profile Send private message
Cogito-Ergo-Sum
PostPosted: Tue May 21, 2013 9:35 am    Post subject: Reply with quote

Master

Joined: 07 Feb 2006
Posts: 293
Location: Bengaluru, India

Your Compute node could look for values in the LocalEnvironment.File.Read to decide if end of file has happened or not.
_________________
ALL opinions are welcome.
-----------------------------
Debugging tip:When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
---Sherlock Holmes
Back to top
View user's profile Send private message
Cogito-Ergo-Sum
PostPosted: Tue May 21, 2013 9:37 am    Post subject: Reply with quote

Master

Joined: 07 Feb 2006
Posts: 293
Location: Bengaluru, India

Esa wrote:
Why don't you try wiring "File Read"."Finish file out" to "FileOutput"."Finish File" and testing yourself what happens?

That is a valid suggestion except for those cases where there are some explicit steps to be taken when end of file happens (what if file had zero records, etc.).
_________________
ALL opinions are welcome.
-----------------------------
Debugging tip:When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
---Sherlock Holmes
Back to top
View user's profile Send private message
Esa
PostPosted: Tue May 21, 2013 11:51 pm    Post subject: Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

new2z wrote:

Will it work, if i wire the "Finish File Out" terminal of the FileRead node to the "Finish" Terminal of the Fileoutput node?


What circumstances prevent you from testing it yourself?
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 » Specify end of file to FileOuput Node when using FileRFead
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.