2 Replies Latest reply on May 13, 2014 4:30 AM by jorgemoralespou_2

    Use SCAInvoker from within a Component

    jorgemoralespou_2

      Hi,

      We have a use case, in which we need to invoke an external SCA service. We can not use a binding in the service, because they are not dynamic (at the moment), so we are using HttpInvoker to do the call.

      Because this service is (or might be located) on the same box, we would prefer to use an SCAinvoker/ClusteredInvoker so that we do not hardcode HttpInvoker endpoint, and get the real endpoint to invoke from the RemoteRegistry which should be available. I'm thinking of two options here, if there is not already a way to do it, for an ER to be created.

       

      First option is to have an injected Invoker (like for tests we have the @ServiceOperation).

      @SCAService("{urn:myservice:1.0}MyService")
      private RemoteInvoker invoker;
      

       

      This could be a new type of RemoteInvoker or provide a second parameter for LoadBalancing algorithm, and assume the service is clustered.

      @SCAService("{urn:myservice:1.0}MyService", LoadBalanceStrategy.RandomStrategy)
      private RemoteInvoker invoker;
      

       

      Second option is to add methods to Context, or a Utility Class to get RemoteRegistry or to create the RemoteInvoker, and not injecting anything.

      private RemoteInvoker invoker;
      
      
      invoker = RemoteInvokerUtils.getRemoteInvoker("{urn:myservice:1.0}MyService", LoadBalanceStrategy.RandomStrategy);
      

       

      I need this, so I will probably get a reference to the RemoteRegistry, and do it in a not fancy way, but at least I think I can create a workaround class.