आप की तरह आप किसी भी spring-boot
एप्लिकेशन बनाना होगा एक Sidecar
आवेदन बना सकते हैं:
@EnableSidecar
@SpringBootApplication
public class SideCarApplication {
public static void main(final String[] args) {
SpringApplication.run(SideCarApplication.class, args);
}
}
महत्वपूर्ण बात यह है कि आप इसे कॉन्फ़िगर करने के लिए सही ढंग से अपने वास्तविक सेवा रजिस्टर करने के लिए होता है। आपका application.yml
इस तरह दिखना चाहिए:
server:
port: 9999 -- the port your spring-boot sidecar is running
spring:
application:
name: nodeapplication -- the name will be your id in eureka
sidecar:
port: 8000 -- the node applications port
health-uri: http://localhost:8000/health.json -- the exposed health eindpoint of your node application
यह ध्यान रखें कि healthpoint लौटना चाहिए UP
तो अपनी सेवाओं स्थिति यूरेका में सही हो जाएगा महत्वपूर्ण है। एक स्वस्थ सेवा के लिए लौट आए json:
{
"status":"UP"
}
यदि आपको कोई spring-boot
एप्लिकेशन की स्थापना हो रही है, एक परियोजना को कॉन्फ़िगर करने के https://start.spring.io/ का उपयोग करें। अफसोस की बात है कि टिक करने के लिए कोई साइडकार विकल्प नहीं है, लेकिन आपको विचार मिल जाएगा। आप STS
(स्प्रिंग टूल सूट) से भी ऐसा कर सकते हैं।
Sidecar
के लिए Maven निर्भरता (एक अभिभावक के रूप वसंत-बादल के साथ):
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-netflix-sidecar</artifactId>
</dependency>
स्रोत
2015-10-08 16:01:40
आपको साइडकार से संबंधित कोई प्रतिक्रिया नहीं मिल रही है? सवाल कहां है? – spencergibb
मुझे लगता है कि आप जिस साइडकार से जुड़े हैं वह प्राण है, इसलिए उपेक्षा करें। – spencergibb