Files
Spring Operator 6068a20f29 URL Cleanup
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# Fixed URLs

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* http://maven.apache.org/xsd/maven-4.0.0.xsd with 19 occurrences migrated to:
  https://maven.apache.org/xsd/maven-4.0.0.xsd ([https](https://maven.apache.org/xsd/maven-4.0.0.xsd) result 200).
* http://www.apache.org/licenses/LICENSE-2.0 with 6 occurrences migrated to:
  https://www.apache.org/licenses/LICENSE-2.0 ([https](https://www.apache.org/licenses/LICENSE-2.0) result 200).
* http://www.spring.io with 1 occurrences migrated to:
  https://www.spring.io ([https](https://www.spring.io) result 301).
* http://repo.spring.io/libs-milestone-local with 5 occurrences migrated to:
  https://repo.spring.io/libs-milestone-local ([https](https://repo.spring.io/libs-milestone-local) result 302).
* http://repo.spring.io/libs-release-local with 1 occurrences migrated to:
  https://repo.spring.io/libs-release-local ([https](https://repo.spring.io/libs-release-local) result 302).
* http://repo.spring.io/libs-snapshot-local with 2 occurrences migrated to:
  https://repo.spring.io/libs-snapshot-local ([https](https://repo.spring.io/libs-snapshot-local) result 302).
* http://repo.spring.io/release with 1 occurrences migrated to:
  https://repo.spring.io/release ([https](https://repo.spring.io/release) result 302).

# Ignored
These URLs were intentionally ignored.

* http://maven.apache.org/POM/4.0.0 with 38 occurrences
* http://www.w3.org/2001/XMLSchema-instance with 19 occurrences
2019-03-21 15:20:21 -04:00
..
2019-03-21 15:17:39 -04:00
2019-03-21 15:20:21 -04:00

Spring Cloud Stream Source Sample

In this Spring Cloud Stream sample, a source application publishes messages to dynamically created destinations.

Requirements

To run this sample, you will need to have installed:

  • Java 8 or Above

This example requires RabbitMQ to be running on localhost.

Code Tour

The class SourceWithDynamicDestination is a REST controller that registers the 'POST' request mapping for '/'. When a payload is sent to 'http://localhost:8080/' by a POST request (port 8080 is the default), this application then uses BinderAwareChannelResolver to resolve the destination dynamically at runtime. Currently, this resolver uses payload as the SpEL expression to resolve the destination name. Hence, if a payload testing is sent to the app, then this source application sends the message testing into the Rabbit exchange testing. This exchange or topic (in case of Kafka if Kafka binder is used) is created dynamically and bound to send the payload.

Upon starting the application on the default port 8080, if the following data are sent:

curl -H "Content-Type: application/json" -X POST -d '{"id":"customerId-1","bill-pay":"100"}' http://localhost:8080

curl -H "Content-Type: application/json" -X POST -d '{"id":"customerId-2","bill-pay":"150"}' http://localhost:8080

The destinations 'customerId-1' and 'customerId-2' are created at the broker (for example: exchange in case of Rabbit or topic in case of Kafka with the names 'customerId-1' and 'customerId-2') and the data are published to the appropriate destinations dynamically.

Building with Maven

Build the sample by executing:

source>$ mvn clean package

Running the Sample

To start the source module execute the following:

source>$ java -jar target/spring-cloud-stream-sample-dynamic-source-1.1.0.BUILD-SNAPSHOT-exec.jar