Suppose that I'm having an interface whose actual implementation resides in the service:
public ISomeRemoteObject
{
void SomeMethod(string arg);
int SomeMethodWithResult();
}
I want to be able to call these methods from the client via AMQP, preferably RabbitMQ. What I could do is something like:
public RemoteObjectStub : ISomeRemoteObject
{
public void SomeMethod(string arg)
{
//use RabbitMQ to notify service that SomeMethod() has been called with arg parameter
//and the ID of the object in case there are multiple instances
}
public int SomeMethodWithResult()
{
//use RabbitMQ RPC to make a synchronous call and get the result
}
}
Another alternative is to make a code generator that will take the interface and generate the stub. But I don't know if this is better as well, as where I used to work I've seen people struggling with similar solutions.
Although these things might work, this isn't what my application actually sells and I want to avoid doing the plumbing myself. Is there any library or project (paid, free, open source doesn't matter) to automate the process?