Author |
Message
|
somjyoti |
Posted: Thu Jan 10, 2008 10:51 am Post subject: Get/Put a file from Server thro FTP using FileInput node. |
|
|
Newbie
Joined: 10 Jan 2008 Posts: 9
|
I am trying to get/put the file from server using File Input/Output node.
I ran the following command in command console.
mqsisetdbparms broker_name -n ftp::service -u server_usrname -p server_password
I gave 'ftp::service' in Security Identity Property in File Input node.
I am not getting the file from the server thro ftp.
Do i need to check or set any other settings.
Thanks in advance.
Som |
|
Back to top |
|
 |
mqmatt |
Posted: Thu Jan 10, 2008 11:03 am Post subject: |
|
|
 Grand Master
Joined: 04 Aug 2004 Posts: 1213 Location: Hursley, UK
|
Use 'service' as the security identity. The 'ftp::' prefix is just used on mqsisetdbparms. |
|
Back to top |
|
 |
somjyoti |
Posted: Fri Jan 11, 2008 9:56 am Post subject: FTP a file using FileInput node. |
|
|
Newbie
Joined: 10 Jan 2008 Posts: 9
|
When i tried to FTP a file using File Input node I am getting the following Exception.
"The FileInput node ''FileInput'' in message flow ''FTPTest'' cannot resolve the relative file path ''/data1/service/WMB''.
Relative file paths must be resolved using the absolute directory path specified in the 'MQSI_FILENODES_ROOT_DIRECTORY' environment variable."
I given the file path ''/data1/service/WMB'' in Input Directory and '.' in Server Directory of the FIle Input node.
Regards
Som |
|
Back to top |
|
 |
mqpaul |
Posted: Mon Jan 14, 2008 3:39 am Post subject: |
|
|
 Acolyte
Joined: 14 Jan 2008 Posts: 66 Location: Hursley, UK
|
I wonder why the FileInput node thinks "/data1/service/WMB'" is a relative directory name. Are you running the broker under a Microsoft Windows operating system? If so, it will expect the file name to be something like "\data1\service\WMB" or even "E:\data1\service\WMB".
Despite the fact that you are using the FileInput node for FTP, the input directory is seen as a normal directory on the broker system; you need to use Windows syntax for a Windows system, or UNIX syntax for a UNIX system.
Does that explain the problem? |
|
Back to top |
|
 |
somjyoti |
Posted: Mon Jan 14, 2008 10:59 am Post subject: |
|
|
Newbie
Joined: 10 Jan 2008 Posts: 9
|
Hi,
My broker is installed in Windows and the ftp server is in UNIX. In this case i can give the unix path, eventhough my broker is in Windows. rite?
Thanks
Som |
|
Back to top |
|
 |
mqpaul |
Posted: Tue Jan 15, 2008 3:31 am Post subject: File node directory paths need to obey the correct OS syntax |
|
|
 Acolyte
Joined: 14 Jan 2008 Posts: 66 Location: Hursley, UK
|
Som,
The FileInput node's "Input directory" property refers to a directory in the file system on the OS running broker, so in your case it needs Windows directory syntax, such as '\data1\service\WMB'. Using UNIX syntax here doesn't work, and that's what caused the error message.
The FTP "Server directory" property is passed to the remote FTP server in a "CWD" (change working directory) command. A UNIX syntax path such as "output/filesForWMB" would be acceptable here. Of course your current value, ".", is perfectly valid too.
The broker doesn't check the Server directory property itself; it delegates checking to the FTP server. If there is a problem with the Server directory syntax, the FTP server will report it to the broker, and I think the broker would issue a BIP3380 message. _________________ Paul |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Jan 15, 2008 3:44 am Post subject: Re: File node directory paths need to obey the correct OS sy |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
mqpaul wrote: |
Som,
The FileInput node's "Input directory" property refers to a directory in the file system on the OS running broker, so in your case it needs Windows directory syntax, such as '\data1\service\WMB'. Using UNIX syntax here doesn't work, and that's what caused the error message.
The FTP "Server directory" property is passed to the remote FTP server in a "CWD" (change working directory) command. A UNIX syntax path such as "output/filesForWMB" would be acceptable here. Of course your current value, ".", is perfectly valid too.
The broker doesn't check the Server directory property itself; it delegates checking to the FTP server. If there is a problem with the Server directory syntax, the FTP server will report it to the broker, and I think the broker would issue a BIP3380 message. |
All of which is to likely say that you want "/data1/service/WMB" in the Server Directory property, rather than the Input Directory property. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
somjyoti |
Posted: Tue Jan 15, 2008 7:56 am Post subject: |
|
|
Newbie
Joined: 10 Jan 2008 Posts: 9
|
Hi,
If I give "/data1/service/WMB" in the Server directory property, What i have to give in the Input directory property.
Thanks
Som
Last edited by somjyoti on Tue Jan 15, 2008 8:08 am; edited 1 time in total |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jan 15, 2008 8:06 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
somjyoti wrote: |
What i have to give in the Input directory property, coz it will not accept the empty value.
|
Probably the directory where the input file is. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
somjyoti |
Posted: Tue Jan 15, 2008 8:20 am Post subject: |
|
|
Newbie
Joined: 10 Jan 2008 Posts: 9
|
I tried with 'data1/service/WMB' in the input directory property.
I am getting the following exception.
"The FileInput node ''FileInput'' in message flow ''FTPTest'' cannot resolve the relative file path ''/data1/service/WMB''.
Relative file paths must be resolved using the absolute directory path specified in the 'MQSI_FILENODES_ROOT_DIRECTORY' environment variable."
How to set or view the value in 'MQSI_FILENODES_ROOT_DIRECTORY' environment variable.
Thanks
Som |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Jan 15, 2008 8:33 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You have two choices, I think.
1) set Input directory to ".", and FTP Server directory to "/data1/service/WMB"
2) set Input directory to "\data1\service\WMB" and FTPServer directory to "."
But I haven't used this node yet. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jan 15, 2008 8:38 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
somjyoti wrote: |
I tried with 'data1/service/WMB' in the input directory property.
|
Where is this in relation to the broker directory?
somjyoti wrote: |
How to set or view the value in 'MQSI_FILENODES_ROOT_DIRECTORY' environment variable.
|
Same way you'd set or view any other environment variable. Be sure you check the one that's in scope for the flow. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mqpaul |
Posted: Tue Jan 15, 2008 8:41 am Post subject: FTP transfers from remote Source to local Input directory |
|
|
 Acolyte
Joined: 14 Jan 2008 Posts: 66 Location: Hursley, UK
|
Som,
The FileInput node first transfers the file from the remote Source directory to the local Input directory, then starts the flow with the transferred file from the Input directory. Specify the Source directory property as the file's location on the FTP server, and the Input directory somewhere on the broker system.
Where you put the file on the broker system is up to you. It should be a local file system for best performance, with enough free space to hold all the files you might transfer or archive. You can specify it as an absolute path, such as "E:\WMB\ftpTransfer\input\myFlow", or a relative path such as "input\myFlow". If you use relative paths, you must set the MQSI_FILENODES_ROOT_DIRECTORY property, such as MQSI_FILENODES_ROOT_DIRECTORY="E:\WMB\ftpTransfer", and the input directory is relative to this value. Note that specifying Input directory="." would be relative, and therefore use the directory in MQSI_FILENODES_ROOT_DIRECTORY.
In general, using a temporary location such as "C:\tmp" is not a good idea if you might want to rerun flows that failed, since the mqsibackout and mqsiarchive directories will get deleted if something clears the temporary directory.
Have a look at the paragraph titled File processing in following link to the Message Broker Information Center:
http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r1m0/topic/com.ibm.etools.mft.doc/ac55150_.htm _________________ Paul |
|
Back to top |
|
 |
|