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 » Reading the name of a file without parsing

Post new topic  Reply to topic
 Reading the name of a file without parsing « View previous topic :: View next topic » 
Author Message
csjayakumar
PostPosted: Tue Jan 03, 2012 2:15 pm    Post subject: Reading the name of a file without parsing Reply with quote

Newbie

Joined: 03 Jan 2012
Posts: 3

Hi,
I have this requirement to read the name of the files present in a folder and do some validation before actually reading the content of the file. (The file name has date and I need to ignore files that are older that a particular date)

I tried using 2 FileRead Nodes - 1st one to just get the file name and the 2nd one to actually parse the file.
But 1st node is throwing error even though I have set the message Domain as "BLOB : For messages with an unspecified format". I assumed that this way it will not try to parse the file.

I also believe that using a FileRead node for just getting the file name is not an optimal approach. Wondering if there is any better approach. Have not worked with JCN. Probably that is the way to go....

Appreciate your response.
Thank you!
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Jan 03, 2012 2:50 pm    Post subject: Re: Reading the name of a file without parsing Reply with quote

Grand High Poobah

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

csjayakumar wrote:
But 1st node is throwing error even though I have set the message Domain as "BLOB : For messages with an unspecified format". I assumed that this way it will not try to parse the file.


You'd think that. I certainly would. Given that you've not seen fit to give any details about the error I can't be conclusive that it's not a parser error but I imagine it's a different problem.

csjayakumar wrote:
I also believe that using a FileRead node for just getting the file name is not an optimal approach.


You think?

csjayakumar wrote:
Wondering if there is any better approach.


I'd use a FileInput node.

csjayakumar wrote:
Have not worked with JCN. Probably that is the way to go....


Once you've taught yourself Java, I'm sure you'll be able to invent a perfectly wonderful wheel.

How are you triggering this flow, given that neither a FileRead or a JCN are input nodes?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
kash3338
PostPosted: Wed Jan 04, 2012 9:23 am    Post subject: Reply with quote

Shaman

Joined: 08 Feb 2009
Posts: 709
Location: Chennai, India

Using a FileInput node as suggested by Vitor is a better option here. You have the file name available in the Local Environment when you read the file and you can check the File name from that and parse if required.

The File name is also available as Wildcard when read from FileInput node
Back to top
View user's profile Send private message Send e-mail
csjayakumar
PostPosted: Wed Jan 04, 2012 12:31 pm    Post subject: Reply with quote

Newbie

Joined: 03 Jan 2012
Posts: 3

Thank you so much guys for the reply.

Vitor, my flow gets started via MQinput. But yes, I should have achieved this with FileRead as well, but getting some weird exception.

I am from Java background and moved to broker recently. I was advised not to use JCN and stick with ESQL

Read few articles stating that there is no performance impact with usage of JCN with later versions of Broker. My issue is resolved with Java file operations
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Jan 04, 2012 12:40 pm    Post subject: Reply with quote

Grand High Poobah

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

csjayakumar wrote:
Vitor, my flow gets started via MQinput.


Why? What's in the message? Why doesn't it contain the file name you need?

csjayakumar wrote:
But yes, I should have achieved this with FileRead as well, but getting some weird exception.


Now you'd think IBM would have put more detail in the error message than "something weird happened". Perhaps if you found that and posted it you might have got more assistance here.

csjayakumar wrote:
I am from Java background and moved to broker recently. I was advised not to use JCN and stick with ESQL


This is sound advice. The forum is littered with posts from experienced Java people who have fallen foul of WMB's architecture (i.e. it's not WAS) and other issues.

csjayakumar wrote:
Read few articles stating that there is no performance impact with usage of JCN with later versions of Broker.


Post some links to these articles. And performance is not the biggest issue with JCN v ESQL (and ESQL still outperforms Java, though in newer versions of WMB perhaps not by as much). Aside from the problems I alude to above, ESQL has more features than Java within a WMB environment.

csjayakumar wrote:
My issue is resolved with Java file operations


So you've invented a wheel. Is it better than the IBM wheel? Is it using the very expensive WMB software to its fullest advantage? Is it proping up a dubious requirement? Does it scale well?
_________________
Honesty is the best policy.
Insanity is the best defence.


Last edited by Vitor on Wed Jan 04, 2012 12:47 pm; edited 1 time in total
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Jan 04, 2012 12:45 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

The LocalEnvironment.File tree contains all of the information you need to resolve this by using a FileInput node, and a secondary configuration to a FileOutput.

I.e. you can use this to filter whether the current file is "too old" or not, and make a decision about what to do with it.
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 » Reading the name of a file without parsing
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.