Github user pduveau commented on a diff in the pull request:
https://github.com/apache/flink/pull/5410#discussion_r193360923
--- Diff:
flink-connectors/flink-connector-rabbitmq/src/test/java/org/apache/flink/streaming/connectors/rabbitmq/RMQSinkTest.java
---
@@ -83,7 +103,22 @@ public void throwExceptionIfChannelIsNull() throws
Exception {
}
private RMQSink<String> createRMQSink() throws Exception {
- RMQSink rmqSink = new RMQSink<String>(rmqConnectionConfig,
QUEUE_NAME, serializationSchema);
+ RMQSink<String> rmqSink = new
RMQSink<String>(rmqConnectionConfig, QUEUE_NAME, serializationSchema);
+ rmqSink.open(new Configuration());
+ return rmqSink;
+ }
+
+ private RMQSink<String> createRMQSinkFeatured() throws Exception {
+ publishOptions = new DummyPublishOptions();
+ RMQSink<String> rmqSink = new
RMQSink<String>(rmqConnectionConfig, serializationSchema, publishOptions);
+ rmqSink.open(new Configuration());
+ return rmqSink;
+ }
+
+ private RMQSink<String> createRMQSinkFeaturedReturnHandler() throws
Exception {
--- End diff --
You can see that if you do not provide a returnedMessage Handler. You must
not set immediate and/or mandatory to true when you publish even if you set
them to true in class DummyPublishOptions they are overwritten in basicPublish
call as you can see in the two test invokeFeaturedPublishBytesToQueue
(overwritten) and invokeFeaturedReturnHandlerPublishBytesToQueue (not
overwritten).
---