The string you are passing, is it the data, or a file name/path?
If it's the data, I don't see a technical issue with you doing a manual
sFTP transfer from either EJB or the POJO SE. Especially if you are ok
to initiate and tear down the connection for each invocation it should
be pretty straight forward; otherwise it will just incur some more work
to manage the connection appropriately.
You mention sizes of 2 GB, you will need to handle the data as
attachment rather than parsing it into DOM.
If you're passing around file names, you're (probably) still ok, with
some items to be aware of. File access within an EJB will limit
portability (and is controversial, theoretically disallowed by the
spec), but practically as long as you know you will have uniform file
system access on all AS instances and are ok with being tied to your
specific set-up technically it should be ok as most AS do not enforce this.
At the same time also be aware that you are responsible for getting the
appropriate delivery guarantees. You can not (at least not easily)
participate in XA. Let's assume the system is set up for at-least-once
delivery, it means that theoretically the same message could arrive
twice at your logic. If it's because the previous transfer failed, you
will want to re-do the transfer. If it was already transferred
successfully, maybe you're ok with it getting re-done in this infrequent
circumstance to keep it simple. For ultimate robustness also consider
making the system resilient to the duplicate message arriving whilst the
first is still in progress. Depending on your scenario and topology that
can be a very rare use case.
Also, assuming you want at-least-once delivery, do not "ACK" until the
transfer is completed successfully (and hence the original file does not
get removed/archived until then). Currently you do not have another
choice in EJB, so you're good. For POJO SE in asynchronous mode you have
that choice, so just be aware.
HTH,
Andi
dvsridhar wrote:
> Hi,
> I need a suggestion on how to address this issue. I understand SFTP support
> is still in the works with glassfishesb. I am wondering if i could use any
> open source util to achieve this functionality. I found 2 useful links in
> this regard one is open source and other one is commercial.
>
> SSHTools:
>
http://sourceforge.net/projects/sshtools/>
> JScape (Commercial):
>
http://www.jscape.com/sftp/index.html>
> I am planning to have an EJB which accepts a string (FileBC creates this
> string polling to a directory) and uses any of the above API's to sftp the
> data. Do you see any runtime issues with this approach especially with size
> limitation of the file for example 1GB or 2GB etc..
>
> We don't use FTP server, our organization prefer SFTP over FTPS otherwise I
> would have used FTPBC to achieve this task.
>
> Please help me to resolve this issue.
>
> Regards,
> Sridhar
>
---------------------------------------------------------------------
To unsubscribe, e-mail:
[hidden email]
For additional commands, e-mail:
[hidden email]