[
https://issues.apache.org/jira/browse/CAMEL-9869?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15242321#comment-15242321
]
ASF GitHub Bot commented on CAMEL-9869:
---------------------------------------
GitHub user sbcd90 opened a pull request:
https://github.com/apache/camel/pull/946
CAMEL-9869 Create Apache Flink Component
Hello,
This is the PR to create Apache Flink component.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/sbcd90/camel CAMEL-9869
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/camel/pull/946.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #946
----
commit 6dd3a5129ca52de412fcef1aa80cc381325b0b89
Author: Subhobrata Dey <[email protected]>
Date: 2016-04-15T02:07:48Z
CAMEL-9869 Create Apache Flink Component
----
> Create Apache Flink Component
> -----------------------------
>
> Key: CAMEL-9869
> URL: https://issues.apache.org/jira/browse/CAMEL-9869
> Project: Camel
> Issue Type: New Feature
> Reporter: Subhobrata Dey
> 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)