Github user GJL commented on a diff in the pull request:
https://github.com/apache/flink/pull/5410#discussion_r190888669
--- Diff:
flink-connectors/flink-connector-rabbitmq/src/main/java/org/apache/flink/streaming/connectors/rabbitmq/RMQSink.java
---
@@ -40,22 +40,36 @@
private static final Logger LOG =
LoggerFactory.getLogger(RMQSink.class);
- protected final String queueName;
+ protected String queueName;
private final RMQConnectionConfig rmqConnectionConfig;
protected transient Connection connection;
protected transient Channel channel;
protected SerializationSchema<IN> schema;
- private boolean logFailuresOnly = false;
+ protected boolean logFailuresOnly = false;
+
+ protected RMQSinkPublishOptions<IN> messageCompute;
/**
* @param rmqConnectionConfig The RabbitMQ connection configuration
{@link RMQConnectionConfig}.
* @param queueName The queue to publish messages to.
* @param schema A {@link SerializationSchema} for turning the Java
objects received into bytes
*/
public RMQSink(RMQConnectionConfig rmqConnectionConfig, String
queueName, SerializationSchema<IN> schema) {
- this.rmqConnectionConfig = rmqConnectionConfig;
+ this(rmqConnectionConfig, schema, null);
this.queueName = queueName;
+ }
+
+ /**
+ * @param rmqConnectionConfig The RabbitMQ connection configuration
{@link RMQConnectionConfig}.
+ * @param schema A {@link SerializationSchema} for turning the Java
objects received into bytes
+ * @param messageCompute A {@link RMQSinkPublishOptions} for providing
message's routing key and/or properties
+ */
+ public RMQSink(RMQConnectionConfig rmqConnectionConfig,
SerializationSchema<IN> schema,
--- End diff --
I think the constructor should be annotated with `@PublicEvolving`, and
`messageCompute` should come after `rmqConnectionConfig` to be consistent with
the other constructor.
---