0

what is easiest way to run my spring cloud stream application using spring cloud data flow ? My idea is to create custom source using kafka binder and sink as prebuilt starter ,file. I am creating applciation which is pretty basic , similar to this. I tried creating executable jar and registering it as source using dataflow shell, that didn't work at all. I am already following this document.

Dheeraj
  • 173
  • 3
  • 12
  • Can you share your custom source application? GH link, perhaps? – Sabby Anandan Jul 27 '16 at 20:59
  • Here is my source application https://github.com/Dhpandey/SpringStreamDemo/tree/master/StreamDemoApplication. Please provide some reference guide to start with this scenario. – Dheeraj Jul 27 '16 at 21:16
  • I tried to locally run your `StreamDemoApplication` and `StreamDemoSink` - both the applications fail to bootstrap with different errors. We'd highly recommend following the [getting-started](http://docs.spring.io/spring-cloud-stream/docs/current-SNAPSHOT/reference/htmlsingle/#_getting_started) guide by downloading the stream application with the intended binder from [Spring Initializr](http://start.spring.io/). Only when you're able to run them successfully as standalone Boot applications, we can then register in Spring Cloud Data Flow and use it in the stream definition. – Sabby Anandan Jul 28 '16 at 13:43
  • I was able to run both of them as independent applications though . Anyway i will restart with these guide strictly. Thank you. And one more question, Is there any specific way to register stream definition to spring cloud data flow ? – Dheeraj Jul 28 '16 at 13:50
  • Here are my new standalone boot application, running fine independently, https://github.com/Dhpandey/SpringStreamDemo , How can we then register them on dataflow, please provide some reference or worked out demo. – Dheeraj Jul 28 '16 at 15:44
  • 1
    Please review the [app registration](http://docs.spring.io/spring-cloud-dataflow/docs/1.0.0.RELEASE/reference/htmlsingle/#spring-cloud-dataflow-register-apps) docs from the reference guide. All the docs are accessible from the [project site](http://cloud.spring.io/spring-cloud-dataflow/), too. Also, there are some SCDF [samples](https://github.com/spring-cloud/spring-cloud-dataflow-samples) that use the OOTB stream applications. Once you register your apps, you can then use them similarly. – Sabby Anandan Jul 28 '16 at 18:55
  • Thanks Sabby, It was much easier then expected. I was able to register using maven coordinates. – Dheeraj Jul 29 '16 at 15:20
  • Glad you could get it up and running! Perhaps you could share your final findings and mark this thread as resolved? Others in the community might find it useful, too. :) – Sabby Anandan Jul 29 '16 at 18:01

1 Answers1

2

Finally , I found it easier to register custom streams in spring cloud data flow,

I was able to register using maven coordinates as explained here.

My solution:

For coordinates that look like

 <groupId>com.streamdemo</groupId>
 <artifactId>Streamdemo</artifactId>
 <version>0.0.1-SNAPSHOT</version> 

I used maven://com.streamdemo:Streamdemo:0.0.1-SNAPSHOT, and registered to SCDF. Actual command looks like :

dataflow:>app register --name mysource --type source --uri maven://com.streamdemo:Streamdemo:0.0.1-SNAPSHOT

It worked fine. Here is my code for Source stream.

Dheeraj
  • 173
  • 3
  • 12