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 » How to delete a file in MessageFlow.??????

Post new topic  Reply to topic Goto page 1, 2  Next
 How to delete a file in MessageFlow.?????? « View previous topic :: View next topic » 
Author Message
iamfat
PostPosted: Mon May 07, 2012 10:00 pm    Post subject: How to delete a file in MessageFlow.?????? Reply with quote

Apprentice

Joined: 08 Mar 2012
Posts: 32
Location: China

I need to delete a file in local, list the file that expired, and delete these files.
How to delete the file? Do i have to use the JCN to delete the file ?
Can the file input node or other node can solve this problem.
Thank you..
Back to top
View user's profile Send private message
mjain
PostPosted: Tue May 08, 2012 1:56 am    Post subject: Reply with quote

Novice

Joined: 01 May 2012
Posts: 15

Is suggested to use JCN for IO operations. You can have a java class and use JCN to get the task done.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Tue May 08, 2012 3:01 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Have you looked at the support packs? There is one there that could do it for you... (hint it has the work 'JOB' in the title)
_________________
WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995

Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue May 08, 2012 3:32 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

what does it mean? list the file that expired?

You can certainly use a FileInput node, instruct it to not save a copy of the file, and choose not to output the data anywhere.
Back to top
View user's profile Send private message
Esa
PostPosted: Tue May 08, 2012 3:57 am    Post subject: Re: How to delete a file in MessageFlow.?????? Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

iamfat wrote:
I need to delete a file in local, list the file that expired, and delete these files.


I am not sure I understand what you mean. How does a file expire?
Does deleting a file in local, whatever it means, produce a list of expired files?

You can delete a file with FileRead node. Select Action Delete in Basic/Finish File.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Tue May 08, 2012 5:07 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

From a JCN or an ESQL Compute, you can execute any command line you want. Why did you not want to do this? From these nodes, you can delete files, list files and file attributes.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
Esa
PostPosted: Tue May 08, 2012 6:26 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

lancelotlinc wrote:
From a JCN or an ESQL Compute, you can execute any command line you want. Why did you not want to do this? From these nodes, you can delete files, list files and file attributes.


I must admit that I don't know how to call command line from ESQL. The only way I know is to create a function wrapper for a java static method.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue May 08, 2012 6:29 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Esa wrote:
lancelotlinc wrote:
From a JCN or an ESQL Compute, you can execute any command line you want. Why did you not want to do this? From these nodes, you can delete files, list files and file attributes.


I must admit that I don't know how to call command line from ESQL. The only way I know is to create a function wrapper for a java static method.


that's what he meant.
Back to top
View user's profile Send private message
iamfat
PostPosted: Tue May 08, 2012 4:46 pm    Post subject: Reply with quote

Apprentice

Joined: 08 Mar 2012
Posts: 32
Location: China

mjain wrote:
Is suggested to use JCN for IO operations. You can have a java class and use JCN to get the task done.


Thank you ,
Maybe JCN is better.
Back to top
View user's profile Send private message
iamfat
PostPosted: Tue May 08, 2012 4:48 pm    Post subject: Reply with quote

Apprentice

Joined: 08 Mar 2012
Posts: 32
Location: China

smdavies99 wrote:
Have you looked at the support packs? There is one there that could do it for you... (hint it has the work 'JOB' in the title)


yeah. i had searched the help content.
but haven't found any useful information.
Back to top
View user's profile Send private message
iamfat
PostPosted: Tue May 08, 2012 4:52 pm    Post subject: Reply with quote

Apprentice

Joined: 08 Mar 2012
Posts: 32
Location: China

mqjeff wrote:
what does it mean? list the file that expired?

You can certainly use a FileInput node, instruct it to not save a copy of the file, and choose not to output the data anywhere.


Sorry, my english is not very good. Let me explain it.
I have a flow that will generate some files, and ftp these files to an FTP server.
And then, move the ftped file to another archive folder in local.
I need another flow, that will triggered on 0:00 everyday, that flow will delete the file in the archive folder that was generated 10 days ago.

The question is i don't know how to delete the file. There is no fileDeleteNode in the Palette. So i'm not sure whether should i use the JCN to do this job.
Back to top
View user's profile Send private message
iamfat
PostPosted: Tue May 08, 2012 4:57 pm    Post subject: Re: How to delete a file in MessageFlow.?????? Reply with quote

Apprentice

Joined: 08 Mar 2012
Posts: 32
Location: China

Esa wrote:
iamfat wrote:
I need to delete a file in local, list the file that expired, and delete these files.


I am not sure I understand what you mean. How does a file expire?
Does deleting a file in local, whatever it means, produce a list of expired files?

You can delete a file with FileRead node. Select Action Delete in Basic/Finish File.


Yeah, that will delete all file. But i need to delete the file that generated 10 days ago. Or maybe i need to use a JCN first, create a wildcard to the FileReadNode, that delete the right file.
For example:
TEST_FILE_2012_04_30_00004.txt.
I need to create a wildcard to the FileReadNode as TEST_FILE_2012_04_30_*.txt
Back to top
View user's profile Send private message
iamfat
PostPosted: Tue May 08, 2012 4:59 pm    Post subject: Reply with quote

Apprentice

Joined: 08 Mar 2012
Posts: 32
Location: China

lancelotlinc wrote:
From a JCN or an ESQL Compute, you can execute any command line you want. Why did you not want to do this? From these nodes, you can delete files, list files and file attributes.


thank you,
i'll do some test for this.
I'm not familiar with ESQL yet.
Back to top
View user's profile Send private message
marko.pitkanen
PostPosted: Tue May 08, 2012 10:08 pm    Post subject: Reply with quote

Chevalier

Joined: 23 Jul 2008
Posts: 440
Location: Jamsa, Finland

Hi,

I wonder if you have to do archive cleaning with message flow? Could you do it instead with cron scheduled shell script?

--
Marko
Back to top
View user's profile Send private message Visit poster's website
Esa
PostPosted: Tue May 08, 2012 10:59 pm    Post subject: Re: How to delete a file in MessageFlow.?????? Reply with quote

Grand Master

Joined: 22 May 2008
Posts: 1387
Location: Finland

iamfat wrote:

Yeah, that will delete all file. But i need to delete the file that generated 10 days ago. Or maybe i need to use a JCN first, create a wildcard to the FileReadNode, that delete the right file.
For example:
TEST_FILE_2012_04_30_00004.txt.
I need to create a wildcard to the FileReadNode as TEST_FILE_2012_04_30_*.txt

You are getting closer. But the FileRead will delete only one file, so you will have to propagate to it several times untill the FileRead node propagates to 'no match' terminal.

You don't need a JCN, you can use ESQL as well to create a Local Environment override for the file name. Unless you prefer java to ESQL, of course.

But I very much agree with Marko, this is a simple maintenance task for which a sheduled shell script might be more suitable.

If you implement a flow that cleans up after itself, you need to plan transcationality and exception handling scopes carefully. Otherwise you risk rolling back the business logic part of the flow if the maintenance logic part happens to fail... ... yes, JCN gives you more control on exception handling and makes this task easier and gives better performance. Only in right hands, though.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » How to delete a file in MessageFlow.??????
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.