Skip to content

Commit

Permalink
Add Message ID to properties list
Browse files Browse the repository at this point in the history
  • Loading branch information
John Kelly committed Apr 6, 2015
1 parent 7d62133 commit 0154fea
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/main/com/zeroclue/jmeter/protocol/amqp/AMQPPublisher.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public class AMQPPublisher extends AMQPSampler implements Interruptible {
private final static String MESSAGE_TYPE = "AMQPPublisher.MessageType";
private final static String REPLY_TO_QUEUE = "AMQPPublisher.ReplyToQueue";
private final static String CORRELATION_ID = "AMQPPublisher.CorrelationId";
private final static String MESSAGE_ID = "AMQPPublisher.MessageId";
private final static String HEADERS = "AMQPPublisher.Headers";

public static boolean DEFAULT_PERSISTENT = false;
Expand Down Expand Up @@ -181,6 +182,17 @@ public void setCorrelationId(String content) {
setProperty(CORRELATION_ID, content);
}

/**
* @return the message id for the sample
*/
public String getMessageId() {
return getPropertyAsString(MESSAGE_ID);
}

public void setMessageId(String content) {
setProperty(MESSAGE_ID, content);
}

public Arguments getHeaders() {
return (Arguments) getProperty(HEADERS).getObjectValue();
}
Expand Down Expand Up @@ -231,7 +243,7 @@ protected AMQP.BasicProperties getProperties() {
new AMQP.BasicProperties(parentProps.getContentType(), parentProps.getContentEncoding(),
parentProps.getHeaders(), deliveryMode, parentProps.getPriority(),
getCorrelationId(), getReplyToQueue(), parentProps.getExpiration(),
parentProps.getMessageId(), parentProps.getTimestamp(), getMessageType(),
getMessageId(), parentProps.getTimestamp(), getMessageType(),
parentProps.getUserId(), parentProps.getAppId(), parentProps.getClusterId());

return publishProperties;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public class AMQPPublisherGui extends AMQPSamplerGui {
private JLabeledTextField messageType = new JLabeledTextField("Message Type");
private JLabeledTextField replyToQueue = new JLabeledTextField("Reply-To Queue");
private JLabeledTextField correlationId = new JLabeledTextField("Correlation Id");
private JLabeledTextField messageId = new JLabeledTextField("Message Id");

private JCheckBox persistent = new JCheckBox("Persistent?", AMQPPublisher.DEFAULT_PERSISTENT);
private JCheckBox useTx = new JCheckBox("Use Transactions?", AMQPPublisher.DEFAULT_USE_TX);
Expand Down Expand Up @@ -77,6 +78,7 @@ public void configure(TestElement element) {
messageType.setText(sampler.getMessageType());
replyToQueue.setText(sampler.getReplyToQueue());
correlationId.setText(sampler.getCorrelationId());
messageId.setText(sampler.getMessageId());
message.setText(sampler.getMessage());
configureHeaders(sampler);
}
Expand Down Expand Up @@ -110,6 +112,7 @@ public void modifyTestElement(TestElement te) {
sampler.setMessageType(messageType.getText());
sampler.setReplyToQueue(replyToQueue.getText());
sampler.setCorrelationId(correlationId.getText());
sampler.setMessageId(messageId.getText());
sampler.setHeaders((Arguments) headers.createTestElement());
}

Expand All @@ -130,6 +133,7 @@ protected final void init() {
messageType.setPreferredSize(new Dimension(100, 25));
replyToQueue.setPreferredSize(new Dimension(100, 25));
correlationId.setPreferredSize(new Dimension(100, 25));
messageId.setPreferredSize(new Dimension(100, 25));
message.setPreferredSize(new Dimension(400, 150));

mainPanel.add(persistent);
Expand All @@ -138,6 +142,7 @@ protected final void init() {
mainPanel.add(messageType);
mainPanel.add(replyToQueue);
mainPanel.add(correlationId);
mainPanel.add(messageId);
mainPanel.add(headers);
mainPanel.add(message);
}
Expand All @@ -154,6 +159,7 @@ public void clearGui() {
messageType.setText("");
replyToQueue.setText("");
correlationId.setText("");
messageId.setText("");
headers.clearGui();
message.setText("");
}
Expand Down

0 comments on commit 0154fea

Please sign in to comment.