Author |
Message
|
UnclDanMan |
Posted: Tue Jul 25, 2006 8:42 am Post subject: Using Java nodes to FTP... |
|
|
Newbie
Joined: 25 Jul 2006 Posts: 6
|
Hi all,
I've read some posts about using IA0X and the JText Adapter and File Extender nodes to do FTP.
I wonder - Has anybody tried to use straight up Java code in a Java compute node to ftp a "message" out as a file?
Does that work? Are there any reasons to do that or not do that?
--Daniel _________________ --Daniel Max Kestin |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Jul 25, 2006 8:50 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
It works. There used to be an FTP Send node that was built like that, I think.
You're probably better off isolating your broker flows from the vaguaries of business partner connectivity, though. I'd tend to use an external file transfer tool, and only use this to pass files TO that external file transfer tool.
Or use such a tool that can read from queues. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
UnclDanMan |
Posted: Tue Jul 25, 2006 8:54 am Post subject: Not for a business partner - for a local app |
|
|
Newbie
Joined: 25 Jul 2006 Posts: 6
|
Thanks for that.
This wouldn't be for a business partner.
It's for a local application - which we cannot modify - which only takes input by file...
So it wouldn't be appropriate to use an external tool like WPG/WBIC.
It's either broker writing the file out and ftp'ing it OR we write it out to a queue and write another program that picks it up and FTPs it. _________________ --Daniel Max Kestin |
|
Back to top |
|
 |
ashoon |
Posted: Tue Jul 25, 2006 10:48 am Post subject: Re: Not for a business partner - for a local app |
|
|
Master
Joined: 26 Oct 2004 Posts: 235
|
why not use MQ to transport across and then write that program to read messages to a local file-system (skipping the FTP)?
UnclDanMan wrote: |
Thanks for that.
This wouldn't be for a business partner.
It's for a local application - which we cannot modify - which only takes input by file...
So it wouldn't be appropriate to use an external tool like WPG/WBIC.
It's either broker writing the file out and ftp'ing it OR we write it out to a queue and write another program that picks it up and FTPs it. |
|
|
Back to top |
|
 |
UnclDanMan |
Posted: Tue Jul 25, 2006 10:52 am Post subject: Sounds logical - but there's one catch... |
|
|
Newbie
Joined: 25 Jul 2006 Posts: 6
|
That would require a local queue manager on the destination host.
We could write an MQ Client on that box to pull stuff off the queue onto a file system...but I'd like to avoid writing extra bits of code to be maintained...
If we can do it all in broker, that'd be best (I think... feel free to convince me otherwise...) _________________ --Daniel Max Kestin |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Jul 25, 2006 12:06 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
So, yes, it is possible to do this from a JCN or a Java plugin node.
You'll want to spend some time doing stress testing to make sure you understand how your code will work under the load you need.
And, of course, you'll need an FTP server on the remote end. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
jbanoop |
Posted: Tue Jul 25, 2006 10:50 pm Post subject: |
|
|
Chevalier
Joined: 17 Sep 2005 Posts: 401 Location: SC
|
We used the so called "FTP node" in one of our projects to read in and write out flat files. It even had a timer feature (as in timeout notification node in V 6) which was configurable with month,yr,day and time values.
It had also the feature in which once the file stream was read we could set MRM/XML params on the node to convert it into internal message structure as well.
Worked pretty neatly I must admit though the files were not very huge i must admit.
Regards,
Anoop |
|
Back to top |
|
 |
elvis_gn |
Posted: Tue Jul 25, 2006 11:15 pm Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi all,
jbanoop wrote: |
It had also the feature in which once the file stream was read we could set MRM/XML params on the node to convert it into internal message structure as well. |
It could have done MRM/XML parsing but without validation i suppose....i'd been trying to get validation working using java for the past two weeks...dosen't work.
I would not suggest you pick files from remote and do read on it directly....rather move to a local directory in binary mode and then read locally....Remote read is a costly IO operation.
You should get the ftp classes from google itself...you just got to call the methods to fetch and put...
Regards. |
|
Back to top |
|
 |
jbanoop |
Posted: Wed Jul 26, 2006 12:14 am Post subject: |
|
|
Chevalier
Joined: 17 Sep 2005 Posts: 401 Location: SC
|
Elvis_gn,
From memory, the file was being read in as a bitstream byte[] and was parsed to the respective XML/MRM setting using
the method
public MbElement createElementAsLastChildFromBitstream(byte[]
bitstream,
String parserName,
String messageType,
String messageSet,
String messageFormat,
int encoding,
int ccsid,
int options)
throws MbException
I would think this would throw an MbException if the parse fails.. I dont remember and have not tried it nw, probably you have already tried this ..
Just thought i'd post the info though.
Regards,
Anoop |
|
Back to top |
|
 |
|