[ 
https://issues.apache.org/jira/browse/FLINK-7267?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17104943#comment-17104943
 ] 

Austin Cawley-Edwards commented on FLINK-7267:
----------------------------------------------

This seems like a reasonable feature to me. The only way to currently achieve 
this would be to override the open method for the source and completely 
re-implement it, which can be messy.

 

I think we could either:

A) create an `RMQSource#setupConnection` method, similar to 
`setupConnectionFactory`. The connection only assigned in the `open` method, so 
I don't think it would be easy to introduce accidental errors in many places. 
This would allow users to make other changes to the connection by just 
overriding that method.

 

B) wrap the RMQ package's Address class and add a list of them to be passed as 
an option to the `RMQConnectionConfig`, which could be used in the 
`RMQSource#setupConnectionFactory`.

 

 

I think option A would be best, as it is a minimal change and would open up the 
possibility of extending the connection in user code. [~aljoscha] [~senegalo] - 
what do you think? Is this change worthwhile?

 

Side-note, should this conversation happen on the dev mailing list?

> Add support for lists of hosts to connect
> -----------------------------------------
>
>                 Key: FLINK-7267
>                 URL: https://issues.apache.org/jira/browse/FLINK-7267
>             Project: Flink
>          Issue Type: Improvement
>          Components: Connectors/ RabbitMQ
>    Affects Versions: 1.3.0
>            Reporter: Hu Hailin
>            Priority: Minor
>
> The RMQConnectionConfig can assign one host:port only. I want to connect to a 
> cluster with an available node.
> My workaround is write my own sink extending RMQSink and override open(), 
> assigning the nodes list in it.
> {code:java}
>       connection = factory.newConnection(addrs)
> {code}
> I still need to build the RMQConnectionConfig with a dummy host:port or a 
> node in list. It's annoying.
> I think it is better to provide a configuration for it.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to