[
https://issues.apache.org/jira/browse/FLINK-8468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16490783#comment-16490783
]
ASF GitHub Bot commented on FLINK-8468:
---------------------------------------
Github user GJL commented on a diff in the pull request:
https://github.com/apache/flink/pull/5410#discussion_r190648628
--- 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;
--- End diff --
This field and `queueName` should be `final`. I think you need a third
private constructor to achieve this:
```
private RMQSink(RMQConnectionConfig rmqConnectionConfig,
String queueName,
SerializationSchema<IN> schema,
RMQSinkPublishOptions<IN>
messageCompute) {
this.rmqConnectionConfig = rmqConnectionConfig;
this.queueName = queueName;
this.schema = schema;
this.messageCompute = messageCompute;
}
```
Then you can write
```
public RMQSink(RMQConnectionConfig rmqConnectionConfig,
SerializationSchema<IN> schema,
RMQSinkPublishOptions<IN> messageCompute) {
this(rmqConnectionConfig, null, schema, messageCompute);
}
```
> Make the connector to take advantage of AMQP features (routing key, exchange
> and message properties)
> ----------------------------------------------------------------------------------------------------
>
> Key: FLINK-8468
> URL: https://issues.apache.org/jira/browse/FLINK-8468
> Project: Flink
> Issue Type: Improvement
> Components: RabbitMQ Connector
> Affects Versions: 1.4.0
> Reporter: Ph.Duveau
> Priority: Major
>
> Make the connector to take advantage of AMQP features by adding a constructor
> and an interface to implement
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)