camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Subhobrata Dey (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-9869) Create Apache Flink Component
Date Thu, 28 Apr 2016 03:30:13 GMT

    [ https://issues.apache.org/jira/browse/CAMEL-9869?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15261477#comment-15261477
] 

Subhobrata Dey commented on CAMEL-9869:
---------------------------------------

Hi [~davsclaus],

I think we can get started with the documentation. I will take a look at the examples on the
documentation of other components & create the camel-flink component page. 
Can you kindly help me in pointing to the location where the wiki pages for other components
are kept? I checked the camel-website module but couldn't find them.

> Create Apache Flink Component
> -----------------------------
>
>                 Key: CAMEL-9869
>                 URL: https://issues.apache.org/jira/browse/CAMEL-9869
>             Project: Camel
>          Issue Type: New Feature
>          Components: camel-flink
>            Reporter: Subhobrata Dey
>            Assignee: Claus Ibsen
>             Fix For: 2.18.0
>
>
> Hello,
> I have created an Apache Flink component for Camel which makes it easier to use Flink
for analytics. One can use DataSet callbacks with Spring beans/OSGI services.
> Using Spring's application context, it can be accessed like 
> {noformat}
> @Bean
> public DataSetCallback<Long> countLinesContaining() {
>     return new DataSetCallback<Long>() {
>         public Long onDataSet(DataSet dataSet, Object... objects) {
>             try {
>                 dataSet.print();
>                 return new Long(0);
>             } catch (Exception e) {
>                 return new Long(-1);
>             }
>         }
>     };
> }
> @Bean
> public DataSet myDataSet() {
>     final ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
>     DataSet<String> text = env.fromElements(
>             "Who's there?",
>             "I think I hear them. Stand ho! Who's there?");
>     return text;
> }
> {noformat}
> The results can be accessed like 
> {noformat}
> Long count = template.requestBody("flink:dataSet?dataSet=#myDataSet&dataSetCallback=#countLinesContaining",
pattern, Long.class);
> {noformat}
> Please review & accept my contribution.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message