Skip to content

injvm and local call #3638

Closed
Closed

Description

@beiwei30

injvm protocol doesn't work well with scope.

injvm should not be registered to register center

<dubbo:protocol name="injvm"/>
<bean id="target" class="org.apache.dubbo.samples.provider.GreetingsServiceImpl"/>
<dubbo:service interface="org.apache.dubbo.samples.api.GreetingsService" ref="target" protocol="injvm"/>

injvm url is registered

local call doesn't work when protocol is injvm

The following configuration is supposed to work but dubbo complains no provider found from registry center.

<dubbo:protocol name="injvm"/>
<bean id="target" class="org.apache.dubbo.samples.provider.GreetingsServiceImpl"/>
<dubbo:service interface="org.apache.dubbo.samples.api.GreetingsService" ref="target" scope="local" protocol="injvm"/>
<dubbo:reference id="demoService" interface="org.apache.dubbo.samples.api.GreetingsService" scope="local"/>

Activity

  1. added
    type/bug
    on Mar 12, 2019
  2. lkj41110 commented on Apr 9, 2019

    @lkj41110
    Contributor

    I try to reproduce the problem with your config, but it fails.

  3. Leishunyu commented on Apr 11, 2019

    @Leishunyu
    Contributor

    I reproduced your problem and made changes to the injvm export.Will submit a pr fix this bug in the near future

  4. added this to the 2.7.2 milestone on Apr 30, 2019
  5. cvictory commented on May 6, 2019

    @cvictory
    Contributor

    I am not sure what is the best way to fix this issue.

    In a real scene, I think we will use :

    @Autowired
    private GreetingsService target;
    // remove this configuration
    //<dubbo:reference id="demoService" interface="org.apache.dubbo.samples.api.GreetingsService" //scope="local"/>
    

    instead of:

    @Autowired
    private GreetingsService demoService;
    
    
    <dubbo:reference id="demoService" interface="org.apache.dubbo.samples.api.GreetingsService" scope="local"/>
    
  6. cvictory commented on May 6, 2019

    @cvictory
    Contributor

    This modification increase some complex logic and I suggest we donot fix this issue.

  7. beiwei30 commented on May 6, 2019

    @beiwei30
    MemberAuthor

    I merged #3857 since it does solve the two problems I reported. Later we can consider removing 'injvm' and 'scope' from user's configuration entirely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions