Skip to content

Commit 1fe3f7e

Browse files
westphal-janyschroeder97
authored andcommitted
[FLINK-20628] RabbitMQ Connector using FLIP-27 Source API
RabbitMQ Connector using the new Source API https://issues.apache.org/jira/browse/FLINK-20628 Co-authored-by: Yannik Schroeder <[email protected]> Co-authored-by: Jan Westphal <[email protected]>
1 parent 4deb609 commit 1fe3f7e

22 files changed

+4244
-0
lines changed

flink-connector-rabbitmq/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# License of the Rabbit MQ Connector
2+
3+
Flink's RabbitMQ connector defines a Maven dependency on the
4+
"RabbitMQ AMQP Java Client", is triple-licensed under the Mozilla Public License 1.1 ("MPL"),
5+
the GNU General Public License version 2 ("GPL") and the Apache License version 2 ("ASL").
6+
7+
Flink itself neither reuses source code from the "RabbitMQ AMQP Java Client"
8+
nor packages binaries from the "RabbitMQ AMQP Java Client".
9+
10+
Users that create and publish derivative work based on Flink's
11+
RabbitMQ connector (thereby re-distributing the "RabbitMQ AMQP Java Client")
12+
must be aware that this may be subject to conditions declared in the
13+
Mozilla Public License 1.1 ("MPL"), the GNU General Public License version 2 ("GPL")
14+
and the Apache License version 2 ("ASL").
15+
16+
This connector allows consuming messages from and publishing to RabbitMQ. It implements the
17+
Source API specified in [FLIP-27](https://cwiki.apache.org/confluence/display/FLINK/FLIP-27%3A+Refactor+Source+Interface)
18+
and the Sink API specified in [FLIP-143](https://cwiki.apache.org/confluence/display/FLINK/FLIP-143%3A+Unified+Sink+API).
19+
20+
For more information about RabbitMQ visit https://www.rabbitmq.com/.
21+
22+
In order to view how to use the connector inspect
23+
[Source](src/main/java/org/apache/flink/connector/rabbitmq2/source/README.md) and
24+
[Sink](src/main/java/org/apache/flink/connector/rabbitmq2/sink/README.md).

flink-connector-rabbitmq/pom.xml

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Licensed to the Apache Software Foundation (ASF) under one
4+
or more contributor license agreements. See the NOTICE file
5+
distributed with this work for additional information
6+
regarding copyright ownership. The ASF licenses this file
7+
to you under the Apache License, Version 2.0 (the
8+
"License"); you may not use this file except in compliance
9+
with the License. You may obtain a copy of the License at
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
Unless required by applicable law or agreed to in writing,
12+
software distributed under the License is distributed on an
13+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
KIND, either express or implied. See the License for the
15+
specific language governing permissions and limitations
16+
under the License.
17+
-->
18+
<project xmlns="http://maven.apache.org/POM/4.0.0"
19+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
20+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
21+
22+
<modelVersion>4.0.0</modelVersion>
23+
24+
<parent>
25+
<groupId>org.apache.flink</groupId>
26+
<artifactId>flink-connectors</artifactId>
27+
<version>1.16-SNAPSHOT</version>
28+
</parent>
29+
30+
<artifactId>flink-connector-rabbitmq</artifactId>
31+
<name>Flink : Connectors : RabbitMQ</name>
32+
33+
<packaging>jar</packaging>
34+
35+
<!-- Allow users to pass custom connector versions -->
36+
<properties>
37+
<rabbitmq.version>5.9.0</rabbitmq.version>
38+
</properties>
39+
40+
<dependencies>
41+
42+
<!-- Core -->
43+
44+
<dependency>
45+
<groupId>org.apache.flink</groupId>
46+
<artifactId>flink-connector-base</artifactId>
47+
<version>${flink.version}</version>
48+
</dependency>
49+
<dependency>
50+
<groupId>org.apache.flink</groupId>
51+
<artifactId>flink-streaming-java</artifactId>
52+
<version>${flink.version}</version>
53+
<scope>provided</scope>
54+
</dependency>
55+
56+
<!-- RabbitMQ -->
57+
58+
<dependency>
59+
<groupId>com.rabbitmq</groupId>
60+
<artifactId>amqp-client</artifactId>
61+
<version>${rabbitmq.version}</version>
62+
</dependency>
63+
64+
<!-- Tests -->
65+
66+
<dependency>
67+
<groupId>org.testcontainers</groupId>
68+
<artifactId>rabbitmq</artifactId>
69+
<version>1.15.1</version>
70+
<scope>test</scope>
71+
</dependency>
72+
73+
<dependency>
74+
<groupId>org.apache.flink</groupId>
75+
<artifactId>flink-test-utils</artifactId>
76+
<scope>test</scope>
77+
</dependency>
78+
79+
<dependency>
80+
<groupId>org.apache.flink</groupId>
81+
<artifactId>flink-connector-test-utils</artifactId>
82+
<version>${flink.version}</version>
83+
<scope>test</scope>
84+
</dependency>
85+
86+
<dependency>
87+
<groupId>org.apache.flink</groupId>
88+
<artifactId>flink-runtime</artifactId>
89+
<version>${flink.version}</version>
90+
<type>test-jar</type>
91+
<scope>test</scope>
92+
</dependency>
93+
94+
<dependency>
95+
<groupId>org.apache.flink</groupId>
96+
<artifactId>flink-streaming-java</artifactId>
97+
<version>${flink.version}</version>
98+
<scope>test</scope>
99+
<type>test-jar</type>
100+
</dependency>
101+
</dependencies>
102+
103+
<build>
104+
<plugins>
105+
<plugin>
106+
<groupId>org.apache.maven.plugins</groupId>
107+
<artifactId>maven-jar-plugin</artifactId>
108+
<executions>
109+
<execution>
110+
<goals>
111+
<goal>test-jar</goal>
112+
</goals>
113+
</execution>
114+
</executions>
115+
</plugin>
116+
</plugins>
117+
</build>
118+
119+
</project>
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
package org.apache.flink.connector.rabbitmq.common;
20+
21+
/**
22+
* The different consistency modes that can be defined for the sink and source individually.
23+
*
24+
* <p>The available consistency modes are as follows.
25+
*
26+
* <ul>
27+
* <li><code>AT_MOST_ONCE</code> Messages are consumed by the output once or never.
28+
* <li><code>AT_LEAST_ONCE</code> Messages are consumed by the output at least once.
29+
* <li><code>EXACTLY_ONCE</code> Messages are consumed by the output exactly once.
30+
* </ul>
31+
*
32+
* <p>Note that the higher the consistency guarantee gets, fewer messages can be processed by the
33+
* system. At-least-once and exactly-once should only be used if necessary.
34+
*/
35+
public enum ConsistencyMode {
36+
AT_MOST_ONCE,
37+
AT_LEAST_ONCE,
38+
EXACTLY_ONCE,
39+
}

0 commit comments

Comments
 (0)