Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Using J2SSH With MDBs

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hi all,

I have an MDB which receives remote location of file. I need to download that file from remote linux server to local file server. I am planning to use J2SSH library. Following are my options/thoughts:

1. Create SSHClient object at MDB startup. So there is one SSHClient (SSH Connection) per MDB. On every onMessage() method, i will open sftpChannel, download file and quit channel. On MDB shutdown i will disconnect sshclient. Now question is with increased load, number of SSH Connections will increase. Is it a good approach ??

2. Create a singleton class at startup which will create SSHClient. On every onMessage() method, I will get SSHClient from Singleton class and use it to create sftpChannel. Now i have only one ssh connection and using across all MDBs. How will it scale with increased load?

3. Create an Mbean which creates SSHClient on startup. On every onMessage() method, i will call mBean method which open sftpChannel and downloads file. Since mBean is single threaded then i can close / reconnect ssh client after n files download or reconnect in case of connection failure. I do not have to deal with multi threaded program. But i am thinking it may affect performance ?

Please share your thoughts on using j2SSH library?

Thanks and Regards
Chetan

PS Excuse me for posting same question in IO Streams forum as well.
 
Sheriff
Posts: 22781
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator

chetan agg wrote:PS Excuse me for posting same question in IO Streams forum as well.


You know you are doing something wrong or you wouldn't have apologized. And you're right too. So why do you still do it?

Anyway, no need (or possibility) to reply because this thread is now closed.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic