[infinispan-issues] [JBoss JIRA] (ISPN-2814) RpcManager doesn't return values properly

William Burns (JIRA) jira-events at lists.jboss.org
Mon Feb 11 16:31:56 EST 2013


William Burns created ISPN-2814:
-----------------------------------

             Summary: RpcManager doesn't return values properly
                 Key: ISPN-2814
                 URL: https://issues.jboss.org/browse/ISPN-2814
             Project: Infinispan
          Issue Type: Bug
    Affects Versions: 5.1.5.FINAL
            Reporter: William Burns
            Assignee: Mircea Markus


We currently use some custom commands with Infinispan.  We have since moved over to wanting to use a custom command with a return value for the response.

We have tried using the various methods on the RpcManager and have found a few issues.

  1. Map<Address, Response> invokeRemotely(Collection<Address> recipients, ReplicableCommand rpc, boolean sync, boolean usePriorityQueue) throws RpcException;

This method always returns a null for cluster responses.  This is a simple issue that can be solved with the following diff

{code}
diff --git a/core/src/main/java/org/infinispan/commands/remote/SingleRpcCommand.
index bf369bc..79bc02e 100644
--- a/core/src/main/java/org/infinispan/commands/remote/SingleRpcCommand.java
+++ b/core/src/main/java/org/infinispan/commands/remote/SingleRpcCommand.java
@@ -107,6 +107,6 @@ public ReplicableCommand getCommand() {
 
    @Override
    public boolean isReturnValueExpected() {
-      return false;
+      return command.isReturnValueExpected();
    }
 }
{code}

The SingleRpcCommand wraps the given command always forcing the return value expectation to be false.

  2. Map<Address, Response> invokeRemotely(Collection<Address> recipients, ReplicableCommand rpcCommand, ResponseMode mode, long timeout);

This method doesn't wrap the return value in a Response thus causing a ClassCastException when the client node gets the response back.  I haven't looked into detail with this one yet.

If needed I can send a sample project that shows the behavior.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the infinispan-issues mailing list