Skip to content

Commit cb4b32b

Browse files
authored
Upgrade dubbo 2.7.4 (#98)
* upgrade dubbo 2.7.4.1, Optimized error handling,Remove package names using com.alibaba * support config center * support config center * registry and config center add username password support
1 parent 7825aa7 commit cb4b32b

File tree

9 files changed

+517
-150
lines changed

9 files changed

+517
-150
lines changed

pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<version>${revision}</version>
2323

2424
<properties>
25-
<revision>2.7.3</revision>
25+
<revision>2.7.4</revision>
2626
<java.version>1.8</java.version>
2727
<java.source.version>1.8</java.source.version>
2828
<java.target.version>1.8</java.target.version>
@@ -31,7 +31,7 @@
3131
<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
3232
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3333

34-
<dubbo.version>${revision}</dubbo.version>
34+
<dubbo.version>2.7.4.1</dubbo.version>
3535
<nacos.version>1.1.3</nacos.version>
3636
<!--<dubbo.version>2.7.2</dubbo.version>-->
3737
<jorphan.version>3.0</jorphan.version>

src/main/java/io/github/ningyu/jmeter/plugin/dubbo/gui/DubboCommonPanel.java

+150-16
Original file line numberDiff line numberDiff line change
@@ -43,25 +43,40 @@
4343
* DubboCommonPanel </br>
4444
*/
4545
public class DubboCommonPanel {
46+
/** Registry */
4647
private JComboBox<String> registryProtocolText;
47-
private JComboBox<String> rpcProtocolText;
4848
private JTextField addressText;
4949
private JTextField registryGroupText;
50+
private JTextField registryUserNameText;
51+
private JTextField registryPasswordText;
52+
private JTextField registryTimeoutText;
53+
/** ConfigCenter */
54+
private JComboBox configCenterProtocolText;
55+
private JTextField configCenterGroupText;
56+
private JTextField configCenterNamespaceText;
57+
private JTextField configCenterUserNameText;
58+
private JTextField configCenterPasswordText;
59+
private JTextField configCenterAddressText;
60+
private JTextField configCenterTimeoutText;
61+
/** Rpc Protocol */
62+
private JComboBox<String> rpcProtocolText;
63+
/** Consumer & Service */
5064
private JTextField timeoutText;
5165
private JTextField versionText;
5266
private JTextField retriesText;
5367
private JTextField clusterText;
54-
private JTextField interfaceText;
55-
private JTextField methodText;
5668
private JTextField groupText;
5769
private JTextField connectionsText;
5870
private JComboBox<String> loadbalanceText;
5971
private JComboBox<String> asyncText;
60-
//参数表格
72+
/** Interface */
73+
private JTextField interfaceText;
74+
private JTextField methodText;
75+
/** Method Args Table */
6176
private DefaultTableModel model;
6277
private String[] columnNames = {"paramType", "paramValue"};
6378
private String[] tmpRow = {"", ""};
64-
//隐式参数表格
79+
/** Attachment Table */
6580
private DefaultTableModel modelAttachment;
6681
private String[] columnNamesAttachment = {"key", "value"};
6782
private int textColumns = 2;
@@ -76,7 +91,7 @@ public void bundleElement(TestElement element) {
7691
public JPanel drawRegistrySettingsPanel() {
7792
//Registry Settings
7893
JPanel registrySettings = new VerticalPanel();
79-
registrySettings.setBorder(BorderFactory.createTitledBorder("Registry Settings"));
94+
registrySettings.setBorder(BorderFactory.createTitledBorder("Registry Center"));
8095
//Protocol
8196
JPanel ph = new HorizontalPanel();
8297
JLabel protocolLable = new JLabel("Protocol:", SwingConstants.RIGHT);
@@ -86,6 +101,27 @@ public JPanel drawRegistrySettingsPanel() {
86101
ph.add(protocolLable);
87102
ph.add(registryProtocolText);
88103
ph.add(makeHelper("Registry center address protocol, The 'none' is direct connection. "));
104+
//Group
105+
JLabel registryGroupLable = new JLabel("Group:", SwingConstants.RIGHT);
106+
registryGroupText = new JTextField();
107+
registryGroupLable.setLabelFor(registryGroupText);
108+
ph.add(registryGroupLable);
109+
ph.add(registryGroupText);
110+
ph.add(makeHelper("Service registration grouping, cross-group services will not affect each other, and can not be called each other, suitable for environmental isolation."));
111+
//UserName
112+
JLabel registryUserNameLable = new JLabel("UserName:", SwingConstants.RIGHT);
113+
registryUserNameText = new JTextField();
114+
registryUserNameLable.setLabelFor(registryUserNameText);
115+
ph.add(registryUserNameLable);
116+
ph.add(registryUserNameText);
117+
ph.add(makeHelper("The usename of the registry. Do not set it if the registry doesn't need validation."));
118+
//Password
119+
JLabel registryPasswordLable = new JLabel("Password:", SwingConstants.RIGHT);
120+
registryPasswordText = new JTextField();
121+
registryPasswordLable.setLabelFor(registryPasswordText);
122+
ph.add(registryPasswordLable);
123+
ph.add(registryPasswordText);
124+
ph.add(makeHelper("The password of the registry. Do not set it if the registry doesn't need validation."));
89125
registrySettings.add(ph);
90126
//Address
91127
JPanel ah = new HorizontalPanel();
@@ -95,20 +131,81 @@ public JPanel drawRegistrySettingsPanel() {
95131
ah.add(addressLable);
96132
ah.add(addressText);
97133
ah.add(makeHelper("Use the registry to allow multiple addresses, Use direct connection to allow only one address! Multiple address format: ip1:port1,ip2:port2 . Direct address format: ip:port . "));
98-
JLabel registryGroupLable = new JLabel("Group:", SwingConstants.RIGHT);
99-
registryGroupText = new JTextField();
100-
registryGroupLable.setLabelFor(registryGroupText);
101-
ah.add(registryGroupLable);
102-
ah.add(registryGroupText);
103-
ah.add(makeHelper("Service registration grouping, cross-group services will not affect each other, and can not be called each other, suitable for environmental isolation."));
134+
//Timeout
135+
JLabel registryTimeoutLable = new JLabel("Timeout:", SwingConstants.RIGHT);
136+
registryTimeoutText = new JTextField();
137+
registryTimeoutLable.setLabelFor(registryTimeoutText);
138+
ah.add(registryTimeoutLable);
139+
ah.add(registryTimeoutText);
140+
ah.add(makeHelper("The timeout(ms) of the request to registry."));
104141
registrySettings.add(ah);
105142
return registrySettings;
106143
}
107144

145+
public JPanel drawConfigCenterSettingsPanel() {
146+
//Config Center Settings
147+
JPanel configCenterSettings = new VerticalPanel();
148+
configCenterSettings.setBorder(BorderFactory.createTitledBorder("Config Center"));
149+
//Protocol
150+
JPanel ph = new HorizontalPanel();
151+
JLabel protocolLable = new JLabel("Protocol:", SwingConstants.RIGHT);
152+
configCenterProtocolText = new JComboBox<String>(new String[]{"","zookeeper", "nacos", "apollo"});
153+
protocolLable.setLabelFor(configCenterProtocolText);
154+
ph.add(protocolLable);
155+
ph.add(configCenterProtocolText);
156+
ph.add(makeHelper("Which configuration center to use: apollo, zookeeper, nacos, etc. 2.7.0+"));
157+
//Group
158+
JLabel configCenterGroupLable = new JLabel("Group:", SwingConstants.RIGHT);
159+
configCenterGroupText = new JTextField();
160+
configCenterGroupLable.setLabelFor(configCenterGroupText);
161+
ph.add(configCenterGroupLable);
162+
ph.add(configCenterGroupText);
163+
ph.add(makeHelper("The meaning varies according to the configuration center selected. 2.7.0+"));
164+
//Namespace
165+
JLabel configCenterNamespaceLable = new JLabel("Namespace:", SwingConstants.RIGHT);
166+
configCenterNamespaceText = new JTextField();
167+
configCenterNamespaceLable.setLabelFor(configCenterNamespaceText);
168+
ph.add(configCenterNamespaceLable);
169+
ph.add(configCenterNamespaceText);
170+
ph.add(makeHelper("Using for multi-tenant isolation generally, the actual meaning varies depending on the configuration center. 2.7.0+"));
171+
//UserName
172+
JLabel configCenterUserNameLable = new JLabel("UserName:", SwingConstants.RIGHT);
173+
configCenterUserNameText = new JTextField();
174+
configCenterUserNameLable.setLabelFor(configCenterUserNameText);
175+
ph.add(configCenterUserNameLable);
176+
ph.add(configCenterUserNameText);
177+
ph.add(makeHelper("the username if the configuration center requires validation, Apollo is not yet enabled. 2.7.0+"));
178+
//Password
179+
JLabel configCenterPasswordLable = new JLabel("Password:", SwingConstants.RIGHT);
180+
configCenterPasswordText = new JTextField();
181+
configCenterPasswordLable.setLabelFor(configCenterPasswordText);
182+
ph.add(configCenterPasswordLable);
183+
ph.add(configCenterPasswordText);
184+
ph.add(makeHelper("password if configuration center needs to do check, Apollo is not yet enabled. 2.7.0+"));
185+
configCenterSettings.add(ph);
186+
//Address
187+
JPanel ah = new HorizontalPanel();
188+
JLabel configCenterAddressLable = new JLabel("Address:", SwingConstants.RIGHT);
189+
configCenterAddressText = new JTextField(textColumns);
190+
configCenterAddressLable.setLabelFor(configCenterAddressText);
191+
ah.add(configCenterAddressLable);
192+
ah.add(configCenterAddressText);
193+
ah.add(makeHelper("Configuration center address. 2.7.0+"));
194+
//Timeout
195+
JLabel configCenterTimeoutLable = new JLabel("Timeout:", SwingConstants.RIGHT);
196+
configCenterTimeoutText = new JTextField();
197+
configCenterTimeoutLable.setLabelFor(configCenterTimeoutText);
198+
ah.add(configCenterTimeoutLable);
199+
ah.add(configCenterTimeoutText);
200+
ah.add(makeHelper("Gets the configured timeout. 2.7.0+ "));
201+
configCenterSettings.add(ah);
202+
return configCenterSettings;
203+
}
204+
108205
public JPanel drawProtocolSettingsPanel() {
109206
//RPC Protocol Settings
110207
JPanel protocolSettings = new VerticalPanel();
111-
protocolSettings.setBorder(BorderFactory.createTitledBorder("RPC Protocol Settings"));
208+
protocolSettings.setBorder(BorderFactory.createTitledBorder("RPC Protocol"));
112209
//RPC Protocol
113210
JPanel rpcPh = new HorizontalPanel();
114211
JLabel rpcProtocolLable = new JLabel("Protocol:", SwingConstants.RIGHT);
@@ -124,7 +221,7 @@ public JPanel drawProtocolSettingsPanel() {
124221
public JPanel drawConsumerSettingsPanel() {
125222
//Consumer Settings
126223
JPanel consumerSettings = new VerticalPanel();
127-
consumerSettings.setBorder(BorderFactory.createTitledBorder("Consumer&Service Settings"));
224+
consumerSettings.setBorder(BorderFactory.createTitledBorder("Consumer & Service"));
128225
JPanel h = new HorizontalPanel();
129226
//Timeout
130227
JLabel timeoutLable = new JLabel(" Timeout:", SwingConstants.RIGHT);
@@ -197,7 +294,7 @@ public JPanel drawConsumerSettingsPanel() {
197294
public JPanel drawInterfaceSettingsPanel() {
198295
//Interface Settings
199296
JPanel interfaceSettings = new VerticalPanel();
200-
interfaceSettings.setBorder(BorderFactory.createTitledBorder("Interface Settings"));
297+
interfaceSettings.setBorder(BorderFactory.createTitledBorder("Interface"));
201298
//Selection Interface
202299
JPanel sh = new HorizontalPanel();
203300
JButton jButton = new JButton("Get Provider List");
@@ -340,8 +437,21 @@ public void actionPerformed(ActionEvent arg0) {
340437

341438
public void configureRegistry(TestElement element) {
342439
registryProtocolText.setSelectedItem(Constants.getRegistryProtocol(element));
343-
addressText.setText(Constants.getAddress(element));
344440
registryGroupText.setText(Constants.getRegistryGroup(element));
441+
registryUserNameText.setText(Constants.getRegistryUserName(element));
442+
registryPasswordText.setText(Constants.getRegistryPassword(element));
443+
addressText.setText(Constants.getAddress(element));
444+
registryTimeoutText.setText(Constants.getRegistryTimeout(element));
445+
}
446+
447+
public void configureConfigCenter(TestElement element) {
448+
configCenterProtocolText.setSelectedItem(Constants.getConfigCenterProtocol(element));
449+
configCenterGroupText.setText(Constants.getConfigCenterGroup(element));
450+
configCenterNamespaceText.setText(Constants.getConfigCenterNamespace(element));
451+
configCenterUserNameText.setText(Constants.getConfigCenterUserName(element));
452+
configCenterPasswordText.setText(Constants.getConfigCenterPassword(element));
453+
configCenterAddressText.setText(Constants.getConfigCenterAddress(element));
454+
configCenterTimeoutText.setText(Constants.getConfigCenterTimeout(element));
345455
}
346456

347457
public void configureProtocol(TestElement element) {
@@ -375,7 +485,19 @@ public void configureInterface(TestElement element) {
375485
public void modifyRegistry(TestElement element) {
376486
Constants.setRegistryProtocol(registryProtocolText.getSelectedItem().toString(), element);
377487
Constants.setRegistryGroup(registryGroupText.getText(), element);
488+
Constants.setRegistryUserName(registryUserNameText.getText(), element);
489+
Constants.setRegistryPassword(registryPasswordText.getText(), element);
378490
Constants.setAddress(addressText.getText(), element);
491+
Constants.setRegistryTimeout(registryTimeoutText.getText(), element);
492+
}
493+
public void modifyConfigCenter(TestElement element) {
494+
Constants.setConfigCenterProtocol(configCenterProtocolText.getSelectedItem().toString(), element);
495+
Constants.setConfigCenterGroup(configCenterGroupText.getText(), element);
496+
Constants.setConfigCenterNamespace(configCenterNamespaceText.getText(), element);
497+
Constants.setConfigCenterUserName(configCenterUserNameText.getText(), element);
498+
Constants.setConfigCenterPassword(configCenterPasswordText.getText(), element);
499+
Constants.setConfigCenterAddress(configCenterAddressText.getText(), element);
500+
Constants.setConfigCenterTimeout(configCenterTimeoutText.getText(), element);
379501
}
380502
public void modifyProtocol(TestElement element) {
381503
Constants.setRpcProtocol(rpcProtocolText.getSelectedItem().toString(), element);
@@ -399,7 +521,19 @@ public void modifyInterface(TestElement element) {
399521
public void clearRegistry() {
400522
registryProtocolText.setSelectedIndex(0);
401523
registryGroupText.setText("");
524+
registryUserNameText.setText("");
525+
registryPasswordText.setText("");
402526
addressText.setText("");
527+
registryTimeoutText.setText("");
528+
}
529+
public void clearConfigCenter() {
530+
configCenterProtocolText.setSelectedIndex(0);
531+
configCenterGroupText.setText("");
532+
configCenterNamespaceText.setText("");
533+
configCenterUserNameText.setText("");
534+
configCenterPasswordText.setText("");
535+
configCenterAddressText.setText("");
536+
configCenterTimeoutText.setText("");
403537
}
404538
public void clearProtocol() {
405539
rpcProtocolText.setSelectedIndex(0);

src/main/java/io/github/ningyu/jmeter/plugin/dubbo/gui/DubboDefaultPanel.java

+4
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,28 @@
2626
public class DubboDefaultPanel extends DubboCommonPanel {
2727

2828
public void drawPanel(JPanel parent) {
29+
parent.add(drawConfigCenterSettingsPanel());
2930
parent.add(drawRegistrySettingsPanel());
3031
parent.add(drawProtocolSettingsPanel());
3132
parent.add(drawConsumerSettingsPanel());
3233
}
3334

3435
public void configure(TestElement element) {
36+
configureConfigCenter(element);
3537
configureRegistry(element);
3638
configureProtocol(element);
3739
configureConsumer(element);
3840
}
3941

4042
public void modifyTestElement(TestElement element) {
43+
modifyConfigCenter(element);
4144
modifyRegistry(element);
4245
modifyProtocol(element);
4346
modifyConsumer(element);
4447
}
4548

4649
public void clearGui() {
50+
clearConfigCenter();
4751
clearRegistry();
4852
clearProtocol();
4953
clearConsumer();

0 commit comments

Comments
 (0)