Dubbo Combat (iv) service start dependent check configuration

Source: Internet
Author: User
start Check

Dubbo the provincial capital at startup, check if dependent services are available, throw exceptions when not available, prevent spring initialization from completing so that problems can be detected early, and default Check=tr?ue.

If your spring container is lazy-loaded, or if you defer referencing the service through API programming, turn off check, otherwise the service is temporarily unavailable, throws an exception, gets a null reference, and, if check=false, always returns a reference, which can be automatically connected when the service resumes. Close Check

Checks can be turned off by check= "false", for example, when testing, some services do not care, or there is a cyclic dependency, a party must start first.

1. Close the start-up check of a service: (No provider times wrong)

<dubbo:reference interface= "Com.foo.BarService" check= "false"/>

2. Close all service start-up checks: (No provider times wrong)

<dubbo:consumer check= "false"/>

3, close the registry startup check: (Register subscription failure times wrong)

<dubbo:registry check= "false"/>

Can also be configured with Dubbo.properties, Dubbo.properties:

Dubbo.reference.com.foo.barservice.check=false
dubbo.reference.check=false
dubbo.consumer.check=false
Dubbo.registry.check=false

You can also use the-D parameter:

Java-ddubbo.reference.com.foo.barservice.check=false
Java-ddubbo.reference.check=false
java- Ddubbo.consumer.check=false 
Java-ddubbo.registry.check=false
Note the difference

Dubbo.reference.check=false, the check value of all reference is forced to change, even if there is a declaration in the configuration, it will be overwritten.
Dubbo.consumer.check=false, which is the default value for set check, is not affected if there are explicit declarations in the configuration, such as:.
Dubbo.registry.check=false, the previous two refers to the success of the subscription, but the provider list is empty whether the error, if the registration of the subscription failed, also allow the start, need to use this option, will be retried in the background timed. Reference

Dubbo User Guide Check at startup: http://dubbo.io/User+Guide-zh.htm#UserGuide-zh-%E5%90%AF%E5%8A%A8%E6%97%B6%E6%A3%80%E6%9F%A5

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.