[
https://issues.apache.org/jira/browse/BEAM-3312?focusedWorklogId=221655&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-221655
]
ASF GitHub Bot logged work on BEAM-3312:
----------------------------------------
Author: ASF GitHub Bot
Created on: 02/Apr/19 09:10
Start Date: 02/Apr/19 09:10
Worklog Time Spent: 10m
Work Description: iemejia commented on pull request #8167: [BEAM-3312]
Improve the builder to MqttIO connection
URL: https://github.com/apache/beam/pull/8167#discussion_r271174491
##########
File path:
sdks/java/io/mqtt/src/main/java/org/apache/beam/sdk/io/mqtt/MqttIO.java
##########
@@ -153,40 +153,26 @@ private MqttIO() {}
abstract ConnectionConfiguration build();
}
- /**
- * Describe a connection configuration to the MQTT broker. This method
creates an unique random
- * MQTT client ID.
- *
- * @param serverUri The MQTT broker URI.
- * @param topic The MQTT getTopic pattern.
- * @return A connection configuration to the MQTT broker.
- */
- public static ConnectionConfiguration create(String serverUri, String
topic) {
- checkArgument(serverUri != null, "serverUri can not be null");
- checkArgument(topic != null, "topic can not be null");
- return new AutoValue_MqttIO_ConnectionConfiguration.Builder()
- .setServerUri(serverUri)
- .setTopic(topic)
- .build();
+ public static ConnectionConfiguration create() {
Review comment:
I will revert this because it is an API breaking change.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 221655)
Time Spent: 1h (was: 50m)
> Add convenient "with" to MqttIO.ConnectionConfiguration
> -------------------------------------------------------
>
> Key: BEAM-3312
> URL: https://issues.apache.org/jira/browse/BEAM-3312
> Project: Beam
> Issue Type: Improvement
> Components: io-java-mqtt
> Reporter: Jean-Baptiste Onofré
> Assignee: LI Guobao
> Priority: Major
> Labels: triaged
> Time Spent: 1h
> Remaining Estimate: 0h
>
> Now, for instance, {{MqttIO}}Â requires a {{ConnectionConfiguration}} object
> to pass the URL and topic name. It means, the user has to do something like:
> {code}
> MqttIO.read()
> .withConnectionConfiguration(MqttIO.ConnectionConfiguration.create("tcp://localhost:1883",
> "CAR"))
> {code}
> It's pretty verbose and long. I think it makes sense to provide convenient
> "direct" method allowing to do:
> {code}
> MqttIO.read().withUrl().withTopic()
> {code}
> or even:
> {code}
> MqttIO.read().withConnection("url", "topic")
> {code}
> The same apply for some other IOs (JMS, ...).
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)