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 » Need Suggestion on File Handling & FTP Thru JavaComputeN

Post new topic  Reply to topic
 Need Suggestion on File Handling & FTP Thru JavaComputeN « View previous topic :: View next topic » 
Author Message
Ranodip Basu
PostPosted: Thu Oct 26, 2006 2:07 am    Post subject: Need Suggestion on File Handling & FTP Thru JavaComputeN Reply with quote

Apprentice

Joined: 23 Sep 2004
Posts: 48

Hi All,

We are currently using WMB 6.0(config mgr in windows 2003 and broker in suse linux) and WMQ 6.0(in suse linux). We have got a new requirement as in below:

1. User will FTP a text file(in CWF format/Fixed length elements) to a suitable location in broker m/c at a particular time everyday.
2. We need to write a message flow containing Java compute node which will read from the file once after arrival, transfer to XML and FTP the output message to another location(in different network).

The client is very keen to the points that everything should be written in Java only not in ESQL and no WBI adapter (otherthan free downloadable) like JText for file handling should be used as they need to buy the software package.

Since the JavaCompute node is compatible with J2SE 1.4.2 , so we can use FileInputStream and FileOutStream to write in a external file.

I would like to ask your suggestions on the points below :

a) As per my knowledge message should be send to Input node for start up of a message flow. Now as we are not going to use MQ for this purpose so there is no question of sending any input message to the flow. We have thought to send a dummy message using amqsput to the dummy input queue to initiate the message flow and the execute the java nodes which will read directly the file. Is there any other way to start the message flow even without attaching MQInput node in flow ?

b) The input file will come once in a day at a particular time.Now the concern is that how to make message flow to read the file at that time. We have thought to run a OS scheduler(linux) in the broker m/c at time interval and using amqsput will send the dummy message to input queue, for ignition of message flow and read the file after arrival. Is there any other way to make message flow monitoring whether the file has come ?

c) We need to FTP the output message to a m/c situated at a different network. I was looking into the Java-Sinotar FTP client http://www.sinotar.com/download/ftp/doc/com/sinotar/ftp/package-summary.html using which the FTP work from Java compute node will be easier. Now my concern is whether we can attach this .jar to message flow project and use the APIs in Java compute node.

d) One of my friend is talking about free downloadable IBM service pack for WMB 6.0 which consist of FTP node Time controller kind nodes to facilitate the requirement of doing FTP and running of message flow at particular time. Do you have any idea about this ?

Also any sort of designing suggestions are most welcomed.

Thanks & Regards,
Ranodip
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Oct 26, 2006 3:32 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

There is a WMB Support Pack that will act as a WMB Input Node for receiving files via FTP - it implements an FTP Server. This means that a flow with an appropriately configured node will be started when the file is FTPd to the broker (and the file will not be a file on Broker, just a logical message tree). It will act to your flow like the message came in from an MQInput node.

There is no such thing for SENDING files through FTP.

If you search for "FTP SupportPack", I'm sure you'll find a bunch of other comments.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Ranodip Basu
PostPosted: Thu Oct 26, 2006 5:04 am    Post subject: Reply with quote

Apprentice

Joined: 23 Sep 2004
Posts: 48

Thanks Jefflowrey for your reply. I am now looking for that service pack.

Could you please also give your valuable suggestions on the point a) & b) i.e. how to make the message flow working for particular time in a day ?

Regards,
Ranodip
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Oct 26, 2006 5:21 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

The node will start the flow whenever the user sends the file.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Ranodip Basu
PostPosted: Mon Nov 06, 2006 10:06 pm    Post subject: Reply with quote

Apprentice

Joined: 23 Sep 2004
Posts: 48

Hi Jefflowrey,

One can do file/DataStream FTP in JavaCompute node using Java package
sun.net.ftp.FtpClient which comes with JDK 1.4.2 i.e. on which the JavaCompute node is based. So, to use this functionality you don't need to add any external JAR file.

I would liko share the code with you as in below :

Quote:
FtpClient ftpClient = new FtpClient();
ftpClient.openServer(hostName);
ftpClient.login(userID,password);
ftpClient.binary();
ftpClient.cd(destinationFilePath);
OutputStream ous = ftpClient.put(destinationFileName);
ous.write(outString.getBytes());
ous.close();

Thanks & Regards,
Ranodip Basu
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 » Need Suggestion on File Handling & FTP Thru JavaComputeN
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.