[ https://issues.apache.org/jira/browse/FLINK-8468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16490780#comment-16490780 ]
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_r190647503 --- Diff: flink-connectors/flink-connector-rabbitmq/src/test/java/org/apache/flink/streaming/connectors/rabbitmq/RMQSinkTest.java --- @@ -43,14 +49,27 @@ public class RMQSinkTest { private static final String QUEUE_NAME = "queue"; + private static final String EXCHANGE = "exchange"; + private static final String ROUTING_KEY = "application.component.error"; + private static final String EXPIRATION = "10000"; private static final String MESSAGE_STR = "msg"; private static final byte[] MESSAGE = new byte[1]; + private static Map<String, Object> headers = new HashMap<String, Object>(); + private static AMQP.BasicProperties props; --- End diff -- `headers.put("Test", new String("My Value"));` can be simplified to `headers.put("Test", "My Value");` The static field `headers` is mutable state, which should be avoided. Why not just: ``` private static AMQP.BasicProperties props = new AMQP.BasicProperties.Builder() .headers(Collections.singletonMap("Test", "My Value")) .expiration(EXPIRATION) .build(); ``` Then the static initializer is not even needed. > 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)