Configuring the apps

Before we would start configuring the stream, we would need to register the applications that constitute the stream. We have three applications to register--source, processor, and sink.

To register an application in Spring Cloud Data Flow, you would need to access the application deployable. Spring Cloud Data Flow gives the option of picking up the application deployable from a Maven repository. To keep things simple, we will pick up the applications from a local Maven repository.

Run mvn clean install on all the three applications that we created using Spring Cloud Stream:

  • significant-stock-change-source
  • stock-intelligence-processor
  • event-store-sink

This will ensure that all these applications are built and stored in your local Maven repository.

The syntax of the command to register an app from a Maven repository is shown here:

app register —-name {{NAME_THAT_YOU_WANT_TO_GIVE_TO_APP}} --type source --uri maven://{{GROUP_ID}}:{{ARTIFACT_ID}}:jar:{{VERSION}}

The Maven URIs for the three applications are listed as follows:

maven://com.mastering.spring.cloud.data.flow:significant-stock-change-source:jar:0.0.1-SNAPSHOT
maven://com.mastering.spring.cloud.data.flow:stock-intelligence-processor:jar:0.0.1-SNAPSHOT
maven://com.mastering.spring.cloud.data.flow:event-store-sink:jar:0.0.1-SNAPSHOT

The commands to create the apps are listed here. These commands can be executed on the Data Flow Shell application:

app register --name significant-stock-change-source --type source --uri maven://com.mastering.spring.cloud.data.flow:significant-stock-change-source:jar:0.0.1-SNAPSHOT

app register --name stock-intelligence-processor --type processor --uri maven://com.mastering.spring.cloud.data.flow:stock-intelligence-processor:jar:0.0.1-SNAPSHOT

app register --name event-store-sink --type sink --uri maven://com.mastering.spring.cloud.data.flow:event-store-sink:jar:0.0.1-SNAPSHOT

You will see the messages shown here when the app is successfully registered:

Successfully registered application 'source:significant-stock-change-source'

Successfully registered application 'processor:stock-intelligence-processor'

Successfully registered application 'sink:event-store-sink'

You can also see the registered apps on the Spring Cloud Data Flow Dashboard at http://localhost:9393/dashboard, as shown in the following screenshot:

We can also register an app using the dashboard, as shown in the following screenshot:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset