= Spring Cloud Bus
:github: https://github.com/spring-cloud/spring-cloud-config
:githubmaster: {github}/tree/master
:docslink: {githubmaster}/docs/src/main/asciidoc
:toc:

include::intro.adoc[]

include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/docs/src/main/asciidoc/contributing-docs.adoc[]

== Quick Start

include::quickstart.adoc[]

== Customizing the AMQP ConnectionFactory

If you are using AMQP there needs to be a `ConnectionFactory` (from
Spring Rabbit) in the application context. If there is a single
`ConnectionFactory` it will be used, or if there is a one qualified as
`@BusConnectionFactory` it will be preferred over others, otherwise
the `@Primary` one will be used. If there are multiple unqualified
connection factories there will be an error.

Note that Spring Boot (as of 1.2.2) creates a `ConnectionFactory` that
is _not_ `@Primary`, so if you want to use one connection factory for
the bus and another for business messages, you need to create both,
and annotate them `@BusConnectionFactory` and `@Primary` respectively.
= Spring Cloud Bus
:github: https://github.com/spring-cloud/spring-cloud-config
:githubmaster: {github}/tree/master
:docslink: {githubmaster}/docs/src/main/asciidoc
:toc:

include::intro.adoc[]

include::https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/docs/src/main/asciidoc/contributing-docs.adoc[]

== Quick Start

include::quickstart.adoc[]

== Addressing an Instance

The HTTP endpoints accept a "destination" parameter, e.g. "/bus/refresh?destination=customers:9000", where the destination is an `ApplicationContext` ID. If the ID is owned by an instance on the Bus then it will process the message and all other instances will ignore it. Spring Boot sets the ID for you in the `ContextIdApplicationContextInitializer` to a combination of the `spring.application.name`, active profiles and `server.port` by default.

== Customizing the AMQP ConnectionFactory

If you are using AMQP there needs to be a `ConnectionFactory` (from
Spring Rabbit) in the application context. If there is a single
`ConnectionFactory` it will be used, or if there is a one qualified as
`@BusConnectionFactory` it will be preferred over others, otherwise
the `@Primary` one will be used. If there are multiple unqualified
connection factories there will be an error.

Note that Spring Boot (as of 1.2.2) creates a `ConnectionFactory` that
is _not_ `@Primary`, so if you want to use one connection factory for
the bus and another for business messages, you need to create both,
and annotate them `@BusConnectionFactory` and `@Primary` respectively.
Add paragraph about destination parameter in Bus endpoints
Add paragraph about destination parameter in Bus endpoints

Fixes gh-16
