tags:

views:

60

answers:

3

I'm with a problem here. I have a client A code that calls a B via RMI. After that I'm sending a queue request via JMS to the real implementation C. However, I don't know the "address" of A. Is there a way to store the connection data somehow so that I can return the data to A later?

Basically the thing is that B can have tons of requests and need to synchronize this to the requestor. How to do that?

Example:

A:

...
    rmiB.HelloWorld("Sys");
...

B:

String HelloWorld(String s) {
    ...
   sendToJMS(s);
    ...
   return????
}

C:

String HelloWorldOnJMS(String aff) {
    return "aff+2"
}
A: 

Well, since A and B are already connected via a RMI locator, why not just have A register a service as well, and then let B call that service?

Carl Smotricz
Well I can't modify A, since it's a client and I can't modify the interface.Well I'm doing that because on my B code I'm doing balancing of servers. I'm treating a lot of things there for the "client" A.
Marcos Roriz
A: 

An RMI call forwarding to a JMSService? Sounds like Apache Camel is exactly what you need; its a framework for doing just this sort of Enterprise integration.

The components page has examples of how to set up RMI and JMS (and myriad other) endpoints. You'll then write a route using its powerful DSL to forward messages from one endpoint to the other.

sgargan
Definitely going to take a look at that :3
Marcos Roriz
+1  A: 
erickson
Excellent idea!
Marcos Roriz