17. Explicit Broker Destinations in a Stream
Prev | Part III. Streams | Next

## 17. Explicit Broker Destinations in a Stream

One can connect to a specific destination name located in the broker (Rabbit, Kafka etc.,) either at the `source` or at the `sink` position.

The following stream has the destination name at the `source` position:

    stream create --definition ":myDestination > log" --name ingest_from_broker --deploy

This stream receives messages from the destination `myDestination` located at the broker and connects it to the `log` app.

The following stream has the destination name at the `sink` position:

    stream create --definition "http > :myDestination" --name ingest_to_broker --deploy

This stream sends the messages from the `http` app to the destination `myDestination` located at the broker.

From the above streams, notice that the `http` and `log` apps are interacting with each other via the broker (through the destination `myDestination`) rather than having a pipe directly between `http` and `log` within a single stream.

It is also possible to connect two different destinations (`source` and `sink` positions) at the broker in a stream.

    stream create --definition ":destination1 > :destination2" --name bridge_destinations --deploy

In the above stream, both the destinations (`destination1` and `destination2`) are located in the broker. The messages flow from the source destination to the sink destination via a `bridge` app that connects them.

Prev | Up | Next
16. Using Labels in a Stream | Home | 18. Directed Graphs in a Stream