Skip to content

Commit

Permalink
Merge pull request pentaho#7263 from pentaho/revert-7254-DEV
Browse files Browse the repository at this point in the history
Revert "[PDI-18501] MQTT Client Step to Include "Client ID" to Allow Persistent Connections"
  • Loading branch information
mkambol authored Feb 13, 2020
2 parents 48e018e + 4229363 commit 2c3b2b0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* Pentaho Data Integration
*
* Copyright (C) 2002-2020 by Hitachi Vantara : http://www.pentaho.com
* Copyright (C) 2002-2019 by Hitachi Vantara : http://www.pentaho.com
*
*******************************************************************************
*
Expand Down Expand Up @@ -61,7 +61,6 @@
import static org.pentaho.di.trans.step.mqtt.MQTTConstants.MQTT_VERSION;
import static org.pentaho.di.trans.step.mqtt.MQTTConstants.SERVER_URIS;
import static org.pentaho.di.trans.step.mqtt.MQTTConstants.STORAGE_LEVEL;
import static org.pentaho.di.ui.core.WidgetUtils.formDataBelow;

@SuppressWarnings( "unused" )
public class MQTTConsumerDialog extends BaseStreamingDialog implements StepDialogInterface {
Expand All @@ -70,7 +69,6 @@ public class MQTTConsumerDialog extends BaseStreamingDialog implements StepDialo

private MQTTConsumerMeta mqttMeta;
private TextVar wConnection;
private TextVar wClientId;
private TableView topicsTable;
private ComboVar wQOS;

Expand All @@ -88,7 +86,6 @@ public MQTTConsumerDialog( Shell parent, Object in, TransMeta tr, String sname )
@Override protected void getData() {
super.getData();
wConnection.setText( mqttMeta.getMqttServer() );
wClientId.setText( mqttMeta.getClientId() );
populateTopicsData();
wQOS.setText( mqttMeta.getQos() );

Expand Down Expand Up @@ -139,25 +136,19 @@ public void setSize() {
wConnection = new TextVar( transMeta, wSetupComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
props.setLook( wConnection );
wConnection.addModifyListener( lsMod );
FormData fdConnection = formDataBelow( wlConnection, INPUT_WIDTH, 5 );
FormData fdConnection = new FormData();
fdConnection.left = new FormAttachment( 0, 0 );
fdConnection.right = new FormAttachment( 0, 363 );
fdConnection.top = new FormAttachment( wlConnection, 5 );
wConnection.setLayoutData( fdConnection );

Label wlClientId = new Label( wSetupComp, SWT.LEFT );
props.setLook( wlClientId );
wlClientId.setText( BaseMessages.getString( PKG, "MQTTConsumerDialog.ClientId" ) );
FormData fdlClientId = formDataBelow( wConnection, INPUT_WIDTH, 5 );
wlClientId.setLayoutData( fdlClientId );

wClientId = new TextVar( transMeta, wSetupComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
props.setLook( wClientId );
wClientId.addModifyListener( lsMod );
FormData fdClientId = formDataBelow( wlClientId, INPUT_WIDTH, 5 );
wClientId.setLayoutData( fdClientId );

Label wlTopics = new Label( wSetupComp, SWT.LEFT );
props.setLook( wlTopics );
wlTopics.setText( BaseMessages.getString( PKG, "MQTTConsumerDialog.Topics" ) );
FormData fdlTopics = formDataBelow( wClientId, INPUT_WIDTH, 5 );
FormData fdlTopics = new FormData();
fdlTopics.left = new FormAttachment( 0, 0 );
fdlTopics.top = new FormAttachment( wConnection, 10 );
fdlTopics.right = new FormAttachment( 50, 0 );
wlTopics.setLayoutData( fdlTopics );

wQOS = new ComboVar( transMeta, wSetupComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
Expand Down Expand Up @@ -342,7 +333,6 @@ private ColumnInfo[] getFieldColumns() {

@Override protected void additionalOks( BaseStreamStepMeta meta ) {
mqttMeta.setMqttServer( wConnection.getText() );
mqttMeta.setClientId( wClientId.getText() );
mqttMeta.setTopics( stream( topicsTable.getTable().getItems() )
.map( item -> item.getText( 1 ) )
.filter( t -> !"".equals( t ) )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* Pentaho Data Integration
*
* Copyright (C) 2002-2020 by Hitachi Vantara : http://www.pentaho.com
* Copyright (C) 2002-2019 by Hitachi Vantara : http://www.pentaho.com
*
*******************************************************************************
*
Expand Down Expand Up @@ -61,7 +61,6 @@
import static org.pentaho.di.trans.step.mqtt.MQTTClientBuilder.checkVersion;
import static org.pentaho.di.trans.step.mqtt.MQTTConstants.AUTOMATIC_RECONNECT;
import static org.pentaho.di.trans.step.mqtt.MQTTConstants.CLEAN_SESSION;
import static org.pentaho.di.trans.step.mqtt.MQTTConstants.CLIENT_ID;
import static org.pentaho.di.trans.step.mqtt.MQTTConstants.CONNECTION_TIMEOUT;
import static org.pentaho.di.trans.step.mqtt.MQTTConstants.KEEP_ALIVE_INTERVAL;
import static org.pentaho.di.trans.step.mqtt.MQTTConstants.MAX_INFLIGHT;
Expand Down Expand Up @@ -113,10 +112,6 @@ public class MQTTConsumerMeta extends BaseStreamStepMeta implements StepMetaInte
@Metaverse.Property ( name = MQTT_SERVER_METAVERSE, parentNodeName = MQTT_SERVER_METAVERSE )
@Injection ( name = MQTT_SERVER ) public String mqttServer = "";

@Metaverse.Node ( name = MQTT_SERVER_METAVERSE, type = MQTT_SERVER_METAVERSE )
@Metaverse.Property ( name = CLIENT_ID, parentNodeName = MQTT_SERVER_METAVERSE )
@Injection ( name = CLIENT_ID ) String clientId = "";

@Metaverse.Node ( name = MQTT_TOPIC_METAVERSE, type = MQTT_TOPIC_METAVERSE, link = LINK_READBY )
@Metaverse.Property ( name = TOPIC, parentNodeName = MQTT_TOPIC_METAVERSE )
@Injection ( name = TOPICS ) public List<String> topics = new ArrayList<>();
Expand Down Expand Up @@ -254,14 +249,6 @@ public void setTopics( List<String> topics ) {
this.topics = topics;
}

public void setClientId( String clientId ) {
this.clientId = clientId;
}

public String getClientId() {
return clientId;
}

public String getMsgOutputName() {
return msgOutputName;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* Pentaho Data Integration
*
* Copyright (C) 2002-2020 by Hitachi Vantara : http://www.pentaho.com
* Copyright (C) 2002-2019 by Hitachi Vantara : http://www.pentaho.com
*
*******************************************************************************
*
Expand Down Expand Up @@ -68,7 +68,6 @@ public class MQTTStreamSource extends BlockingQueueStreamSource<List<Object>> {
@Override public void open() {
try {
mqttClient = MQTTClientBuilder.builder()
.withClientId( mqttConsumerMeta.getClientId() )
.withBroker( mqttConsumerMeta.getMqttServer() )
.withTopics( mqttConsumerMeta.getTopics() )
.withQos( mqttConsumerMeta.getQos() )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ MQTTConsumer.TypeTooltipDesc=Subscribes and streams an MQTT Topic

MQTTConsumerDialog.Shell.Title=MQTT consumer
MQTTConsumerDialog.Connection=Connection:
MQTTConsumerDialog.ClientId=Client ID:
MQTTConsumerDialog.Topics=Topics:
MQTTConsumerDialog.TopicHeading=Name:
MQTTConsumerDialog.QOS=Quality of Service:
Expand Down Expand Up @@ -70,7 +69,6 @@ MQTTMeta.CheckResult.NotANumber=The "{0}" value is invalid. Please set the value
MQTTMeta.CheckResult.NotABoolean=The "{0}" value is invalid. Please set the value to true or false
MQTTMeta.CheckResult.NotCorrectVersion=The "{0}" value is invalid. Please set the value to 0, 3, or 4

MQTTConsumerMeta.Injection.CLIENT_ID=The ID used to identify and track requests made to the server.
MQTTConsumerMeta.Injection.MQTT_SERVER=Specify the connection URL for the MQTT server.
MQTTConsumerMeta.Injection.TOPICS=The topic or list of topics to subscribe to.
MQTTConsumerMeta.Injection.MSG_OUTPUT_NAME=The name of the output field for the message.
Expand Down

0 comments on commit 2c3b2b0

Please sign in to comment.