Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to send messages direct to queues which have a DEAD-LETTER associated. #36

Open
markslilley opened this issue Jan 3, 2023 · 1 comment
Milestone

Comments

@markslilley
Copy link

markslilley commented Jan 3, 2023

I'm trying to fork this and add X-DEAD-LETTER-EXCHANGE and X-DEAD-LETTER-ROUTING-KEY. This will enable direct to queue messages where there is a dead letter attached. I have added fields to AMQPSampler.java and AMQPSamplerGui.java is there anything else I need to update?

When I publish messages with this amended code I see messages land on the Rabbit Overview page but the message does not arrive in the queue (with an attached DEAD LETTER linked)

I've added to AMQPSampler.java

    private static final String X_DEAD_LETTER_EXCHANGE     = "AMQPSampler.XDeadLetterExchange";
    private static final String X_DEAD_LETTER_ROUTING_KEY  = "AMQPSampler.XDeadLetterRoutingKey";
    
    public static final String DEFAULT_X_DEAD_LETTER_EXCHANGE = "jmeterDeadLetterExchange";
    public static final String DEFAULT_X_DEAD_LETTER_ROUTING_KEY = "jmeterDeadLetterRoutingKey";
    
    if (getXDeadLetterExchange() != null && !getXDeadLetterExchange().isEmpty()) {
        arguments.put("x-dead-letter-exchange", getXDeadLetterExchange());
    }

    if (getXDeadLetterRoutingKey() != null && !getXDeadLetterRoutingKey().isEmpty()) {
        arguments.put("x-dead-letter-routing-key", getXDeadLetterRoutingKey());
    }
    
    public String getXDeadLetterRoutingKey() {
        return getPropertyAsString(X_DEAD_LETTER_ROUTING_KEY);
    }

    public void setXDeadLetterExchange(String name) {
        setProperty(X_DEAD_LETTER_EXCHANGE, name);
    }

    public void setXDeadLetterRoutingKey(String name) {
        setProperty(X_DEAD_LETTER_ROUTING_KEY, name);
    }

Added the following to AMQPSamplerGui.java

    protected JLabeledTextField xDeadLetterExchange = new JLabeledTextField("x-dead-letter-exchange");
    protected JLabeledTextField xDeadLetterRoutingKey = new JLabeledTextField("x-dead-letter-routing-key");

    xDeadLetterExchange.setText(sampler.getXDeadLetterExchange());
    xDeadLetterRoutingKey.setText(sampler.getXDeadLetterRoutingKey());

    xDeadLetterExchange.setText(AMQPSampler.DEFAULT_X_DEAD_LETTER_EXCHANGE);
    xDeadLetterRoutingKey.setText(AMQPSampler.DEFAULT_X_DEAD_LETTER_ROUTING_KEY);

    sampler.setXDeadLetterExchange(xDeadLetterExchange.getText());
    sampler.setXDeadLetterRoutingKey(xDeadLetterRoutingKey.getText());

    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 4;
    queueSettings.add(xDeadLetterExchange, gridBagConstraints);

    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 5;
    queueSettings.add(xDeadLetterRoutingKey, gridBagConstraints);
    

Amended GUI showing new fields.

image

@aliesbelik aliesbelik added this to the 0.4.0 milestone Sep 27, 2023
@jddma
Copy link

jddma commented Apr 1, 2024

Hello,

Is this feature going to be released?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants