[rabbitmq-discuss] Dead letter message don't show up

Huang Tonglang tlhuang at 800best.com
Fri Nov 15 02:15:40 GMT 2013

Help please.

I declare the dead letter in producer side as following:

channel.exchangeDeclare("dead-exchange", "direct");

            Map<String, Object> args = new HashMap<String, Object>();
            args.put("x-dead-letter-exchange", "dead-exchange1");
            args.put("x-dead-letter-routing-key", "dead-exchange-routing-key");

            channel.queueDeclare(“myqueue”, false, false, false, args);

            channel.queueDeclare("dead-exchange-routing-key", false, false, false, null);
            String message = "Hello World!”;
            channel.basicPublish("",“myqueue”, MessageProperties.PERSISTENT_TEXT_PLAIN, message.getBytes());

and in conumser side:

        QueueingConsumer consumer = new QueueingConsumer(channel);
        channel.basicConsume(QUEUE_NAME, false, consumer);

        while (true) {
          QueueingConsumer.Delivery delivery = consumer.nextDelivery();
          String message = new String(delivery.getBody());
          channel.basicReject(delivery.getEnvelope().getDeliveryTag(), false);

However, the dead letter message don’t show up in Rabbitmq Management page. Can some help me?

Thank you

Tonglang Huang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20131115/c217fac8/attachment.htm>

More information about the rabbitmq-discuss mailing list