aljoscha commented on a change in pull request #12001:
URL: https://github.com/apache/flink/pull/12001#discussion_r421361436
##########
File path:
flink-connectors/flink-connector-rabbitmq/src/main/java/org/apache/flink/streaming/connectors/rabbitmq/RMQSink.java
##########
@@ -121,7 +121,7 @@ public RMQSink(RMQConnectionConfig rmqConnectionConfig,
SerializationSchema<IN>
*/
protected void setupQueue() throws IOException {
if (queueName != null) {
- channel.queueDeclare(queueName, false, false, false,
null);
+ channel.queueDeclare(queueName, true, false, false,
null);
Review comment:
This would just be icing on the cake but you could factor out these
defaults into a package-private Util, with a method, something like
`declareQueueDefaults(Channel channel, String queueName)`. Totally up to you,
though. This is already an improvement.
If you do it, just do the refactor in a commit on top.
##########
File path:
flink-connectors/flink-connector-rabbitmq/src/test/java/org/apache/flink/streaming/connectors/rabbitmq/RMQSourceTest.java
##########
@@ -86,13 +86,23 @@
private volatile Exception exception;
- @Before
- public void beforeTest() throws Exception {
-
+ /**
+ * Get a mock context for initializing the source's state.
+ *
+ * @return a mocked context that can be used in {@link
org.apache.flink.streaming.api.checkpoint.CheckpointedFunction#initializeState}
Review comment:
Maybe that's just my style but I often prefer Javadoc without a
`@return` clause if it's a duplicate of the main text. Here the main text can
just be `Gets a mock context for initializing the source's state via {@link
org.apache.flink.streaming.api.checkpoint.CheckpointedFunction#initializeState}.`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]