Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,10 @@ private void loadTemplateButtonActionPerformed(java.awt.event.ActionEvent evt) {
connectionFactoryNameField.setText(template.getJndiConnectionFactoryName());
connectionFactoryClassField.setText(template.getConnectionFactoryClass());
connectionPropertiesTable.setProperties(template.getConnectionProperties());
usernameField.setText(template.getUsername());
passwordField.setText(template.getPassword());
clientIdField.setText(template.getClientId());
destinationNameField.setText(template.getDestinationName());
Comment on lines +646 to +649
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
usernameField.setText(template.getUsername());
passwordField.setText(template.getPassword());
clientIdField.setText(template.getClientId());
destinationNameField.setText(template.getDestinationName());

I don't think these fields were meant to be saved in a template. They are already clearly labeled in the GUI, are specific to a particular connection, and could contain sensitive data.

}
}
}//GEN-LAST:event_loadTemplateButtonActionPerformed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,17 @@ private JmsTemplateListModel() {
properties.setJndiConnectionFactoryName("java:/ConnectionFactory");
templates.put("JBoss Messaging / MQ", properties);

properties = new JmsConnectorProperties();
properties.setUseJndi(false);
properties.setConnectionFactoryClass("com.rabbitmq.jms.admin.RMQConnectionFactory");
properties.getConnectionProperties().put("brokerURL", "failover:(tcp://localhost:5672)?maxReconnectAttempts=0");
properties.getConnectionProperties().put("closeTimeout", "15000");
properties.getConnectionProperties().put("useCompression", "no");
properties.setUsername("guest");
properties.setPassword("guest");
properties.setDestinationName("myqueue");
Comment on lines +59 to +64
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
properties.getConnectionProperties().put("brokerURL", "failover:(tcp://localhost:5672)?maxReconnectAttempts=0");
properties.getConnectionProperties().put("closeTimeout", "15000");
properties.getConnectionProperties().put("useCompression", "no");
properties.setUsername("guest");
properties.setPassword("guest");
properties.setDestinationName("myqueue");
properties.getConnectionProperties().put("host", "localhost");
properties.getConnectionProperties().put("port", "5672");
properties.getConnectionProperties().put("virtualHost", "/");

Similar to my other comment, I don't think username, password, and destinationName are meant to be saved in the template.

I believe the connection properties are not valid RabbitMQ properties. They appear to be copied from the ActiveMQ template. host, port, and virtualHost are what appear in the documentation. I tested them with non-default values and they worked. You can see what the other valid properties are by scrolling down a bit in that section.

templates.put("RabbitMQ", properties);

templateNames.addAll(templates.keySet());
readOnlyTemplateNames.addAll(templates.keySet());
}
Expand Down
Loading