Files
spring-cloud-static/Greenwich.SR4/multi/multi__service_id_must_be_unique.html
2019-11-19 16:34:05 +01:00

9 lines
2.8 KiB
HTML

<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>46.&nbsp;Service ID Must Be Unique</title><link rel="stylesheet" type="text/css" href="css/manual-multipage.css"><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"><link rel="home" href="multi_spring-cloud.html" title="Spring Cloud"><link rel="up" href="multi__spring_cloud_bus.html" title="Part&nbsp;VII.&nbsp;Spring Cloud Bus"><link rel="prev" href="multi__addressing_all_instances_of_a_service.html" title="45.&nbsp;Addressing All Instances of a Service"><link rel="next" href="multi__customizing_the_message_broker.html" title="47.&nbsp;Customizing the Message Broker"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">46.&nbsp;Service ID Must Be Unique</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="multi__addressing_all_instances_of_a_service.html">Prev</a>&nbsp;</td><th width="60%" align="center">Part&nbsp;VII.&nbsp;Spring Cloud Bus</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="multi__customizing_the_message_broker.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a name="_service_id_must_be_unique" href="#_service_id_must_be_unique"></a>46.&nbsp;Service ID Must Be Unique</h2></div></div></div><p>The bus tries twice to eliminate processing an event&#8201;&#8212;&#8201;once from the original
<code class="literal">ApplicationEvent</code> and once from the queue. To do so, it checks the sending service ID
against the current service ID. If multiple instances of a service have the same ID,
events are not processed. When running on a local machine, each service is on a different
port, and that port is part of the ID. Cloud Foundry supplies an index to differentiate.
To ensure that the ID is unique outside Cloud Foundry, set <code class="literal">spring.application.index</code> to
something unique for each instance of a service.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="multi__addressing_all_instances_of_a_service.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="multi__spring_cloud_bus.html">Up</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="multi__customizing_the_message_broker.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">45.&nbsp;Addressing All Instances of a Service&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="multi_spring-cloud.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;47.&nbsp;Customizing the Message Broker</td></tr></table></div></body></html>