RMI - JRMP vs IIOP
Asked Answered
M

2

5

I know that JRMP opens a new socket for every invocation request. Also that IIOP can share a single opened socket for multiple requests.

As stated by Wikipedia:

Usage of the term RMI may denote solely the programming interface or may signify both the API and JRMP, whereas the term RMI-IIOP (read: RMI over IIOP) denotes the RMI interface delegating most of the functionality to the supporting CORBA implementation.

One of the questions in my paper where I had to say whether the statement was true/false said:

RMI Servers share a single socket for multiple invocation requests.

At this point,there was ambiguity whether the question was probed considering it was a JRMP or an IIOP server. Is it safe for me to assume that if the questions states only RMI , then in that case it would imply it was a JRMP server and not an IIOP server?

I hope I've made myself clear.

Me answered 3/5, 2011 at 9:33 Comment(2)
No, it's not safe to assume that. The question is ambiguous.Riven
Also, have you considered the pooled RMI invoker used by JBoss?Hector
H
3

No, RMI can share sockets or create them as needed depending on the RMI client implementation. Such a sweeping statement wouldn't be true.

Hector answered 3/5, 2011 at 11:7 Comment(8)
@Pavitar: But that answer is incorrect. It doesn't do that at all.Scalade
Your answer states 'No [it won't share a socket]', and 'it will [my emphasis] create a new client socket for each request'. As you correctly state in your comment, this is implementation-dependent. So 'no' and 'will' are both incorrect. It could. But it won't. I've never seen an RMI/JRMP or RMI/IIOP (or RMI/JERI) implementation that does that, in 14 yearsScalade
And it depends on the RMI client implementation, not the server.Scalade
@Mikaveli RMI connection pooling is implemented at the client. That's the only place it can possibly be implemented. Think about it. Then if you disagree please provide your own reference. My reference is java.rmi: The Guide to Remote Method Invocation in Java, Pitt & McNiff, 2001, but then I did write it.Scalade
community.jboss.org/wiki/Invokers The JRMP invoker makes a new client socket for each request it makes on the client to the server.Hector
@Mikaveli Exactly. The JBoss JRMP client invoker uses a new socket per request. The Sun client built into the JDK doesn't do that. So it depends on the client, not the server. Sun JRMP clients perform connection pooling, which is what several of the system properties described via the RMI Home Page are for, so successive calls from the same client can reuse the same connection, and therefore be invoked in the same thread in the server JVM. And there is no way for the server to force the client to reuse a connection, but the client can at least attempt to reuse a connection.Scalade
@EJP. Ok, I think we're singing from the same hymn sheet, but need to clarify our wording: The server will reuse the same socket, but the client will create a new socket for each new request using JRMP.Hector
@Mikaveli You need to correct your wording. It won't use a new connection per request. I repeat. The RMI/JDK client's connection pooling allows requests at short intervals to reuse the same connection. Your statement about server and client sockets makes no sense. It is impossible. My book is a reliable reference, technically reviewed by the RMI implementors. The documentation of the system properties I referred to is even more reliable. You can get a pretty good idea of how it really works from there: download.oracle.com/javase/6/docs/technotes/guides/rmi/….Scalade
S
4

I know that JRMP opens a new socket for every invocation request.

No it doesn't. The RMI client uses connection pooling.

As stated by Wikipedia:

Usage of the term RMI may denote solely the programming interface or may signify both the API and JRMP, whereas the term RMI-IIOP (read: RMI over IIOP) denotes the RMI interface delegating most of the functionality to the supporting CORBA implementation.

I consider that statement misleading and I've corrected it. The new wording says that the term 'RMI' could refer to the API or any implementation, including JRMP, IIOP, JERI, JBoss Remoting, ..., whereas 'RMI-IIOP' specifically refers to RMI over IIOP.

RMI Servers share a single socket for multiple invocation requests.

The statement is ambiguous, misleading, and implementation-dependent.

Is it safe for me to assume that if the questions states only RMI , then in that case it would imply it was a JRMP server and not an IIOP server?

No. But in this case it doesn't make any difference.

Scalade answered 4/5, 2011 at 10:22 Comment(0)
H
3

No, RMI can share sockets or create them as needed depending on the RMI client implementation. Such a sweeping statement wouldn't be true.

Hector answered 3/5, 2011 at 11:7 Comment(8)
@Pavitar: But that answer is incorrect. It doesn't do that at all.Scalade
Your answer states 'No [it won't share a socket]', and 'it will [my emphasis] create a new client socket for each request'. As you correctly state in your comment, this is implementation-dependent. So 'no' and 'will' are both incorrect. It could. But it won't. I've never seen an RMI/JRMP or RMI/IIOP (or RMI/JERI) implementation that does that, in 14 yearsScalade
And it depends on the RMI client implementation, not the server.Scalade
@Mikaveli RMI connection pooling is implemented at the client. That's the only place it can possibly be implemented. Think about it. Then if you disagree please provide your own reference. My reference is java.rmi: The Guide to Remote Method Invocation in Java, Pitt & McNiff, 2001, but then I did write it.Scalade
community.jboss.org/wiki/Invokers The JRMP invoker makes a new client socket for each request it makes on the client to the server.Hector
@Mikaveli Exactly. The JBoss JRMP client invoker uses a new socket per request. The Sun client built into the JDK doesn't do that. So it depends on the client, not the server. Sun JRMP clients perform connection pooling, which is what several of the system properties described via the RMI Home Page are for, so successive calls from the same client can reuse the same connection, and therefore be invoked in the same thread in the server JVM. And there is no way for the server to force the client to reuse a connection, but the client can at least attempt to reuse a connection.Scalade
@EJP. Ok, I think we're singing from the same hymn sheet, but need to clarify our wording: The server will reuse the same socket, but the client will create a new socket for each new request using JRMP.Hector
@Mikaveli You need to correct your wording. It won't use a new connection per request. I repeat. The RMI/JDK client's connection pooling allows requests at short intervals to reuse the same connection. Your statement about server and client sockets makes no sense. It is impossible. My book is a reliable reference, technically reviewed by the RMI implementors. The documentation of the system properties I referred to is even more reliable. You can get a pretty good idea of how it really works from there: download.oracle.com/javase/6/docs/technotes/guides/rmi/….Scalade

© 2022 - 2024 — McMap. All rights reserved.