Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

RMI solution?

20 views
Skip to first unread message

ahmad...@gmail.com

unread,
Mar 24, 2005, 2:20:23 AM3/24/05
to
I have a distributed application requirement which should have a
server listening for requests and a client sending an image and some
data to the server. The server on receiving this, does some
preprocessing and posts this to a database.

I was thinking of using RMI to do the sending from the client, but it
seems to be an overkill to use RMI just for sending data. Is there a
better solution using an alternate technology? Thanks!

Alex Molochnikov

unread,
Mar 24, 2005, 2:35:02 AM3/24/05
to
<ahmad...@gmail.com> wrote in message
news:1111648823....@g14g2000cwa.googlegroups.com...

You can use a floppy, or burn a CD.


ahmad...@gmail.com

unread,
Mar 24, 2005, 9:32:26 AM3/24/05
to
I hope you were being serious.
Anyway, it is really a client/server situation in which there is a
constant stream (10/minute lets say) of message sending with the image
and meta-data. The data needs to be posted to the DB immediately.
Clearly your solution is an overkill as well as costly and time
consuming. But thanks though.

Alex Molochnikov

unread,
Mar 24, 2005, 12:23:59 PM3/24/05
to
No, I am not being serious - just sarcastic. You didn't want to use RMI,
thinking it is an "overkill", so I offered the real overkill instead. Any
solution other than the RMI would be even harder to implement. E.g., a
direct socket-to-socket connection, or JMS, or packaging your server as an
EJB and running it inside an application server etc.

In my experience, RMI is suited for the data exchange just fine.

<ahmad...@gmail.com> wrote in message
news:1111674745.9...@o13g2000cwo.googlegroups.com...

ahmad...@gmail.com

unread,
Mar 24, 2005, 2:44:21 PM3/24/05
to
Thanks for your comments Alex.
Makes sense, except - Why is a direct socket-socket connection harder
to do than RMI? Would it not be easier to do?

Alex Molochnikov

unread,
Mar 24, 2005, 3:23:37 PM3/24/05
to
With the socket-to-socket connection you have to:

1. create an anchor (server) socket on the server side
2. create the connecting socket in the client
3. organize the read/write loops with blocking i/o
4. serialize and de-serialize your data (if it includes objects)

With the RMI, you only need to create a server object, bind it to the
registry and export it on the selected port (equivalent of 1 in the s-s
scenario). You also have to create the RMI stubs by running rmic, but this
can be done once in a script/bat file, and put the Naming.lookup code in
your client (equivalent of 2). After that, you are free to send/receive any
data through simple method calls, without worrying about serialization, i/o
etc. Items 3 and 4 in the s-s version are gone.

RMI is a higher-level abstraction of the socket mechanism, with lots of
mundane socket stuff hidden, and lots of convenience wrapping added.

Decide for yourself, which is easier. Or, if in doubt, try the sockets
first, and it won't be long before you quit and turn to the RMI.

<ahmad...@gmail.com> wrote in message
news:1111693461....@g14g2000cwa.googlegroups.com...

ahmad...@gmail.com

unread,
Mar 24, 2005, 7:39:59 PM3/24/05
to
Thanks. It does make sense.

0 new messages