Я знаю, что это старая нить, но и для следующей потерянной души ищет решение ...
Я копал в источнике .NET SDK и обнаружил, что на самом деле это только простой HTTP вызов «/ $ DeadLetterQueue», то есть:
https://mynamespace.servicebus.windows.net/myqueuename/$DeadLetterQueue/messages/head
// Peek-Lock Message from DLQ
curl -X POST -H "authorization: insertSASHere" "https://mynamespace.servicebus.windows.net/myqueuename/%24DeadLetterQueue/messages/head"
Так с помощью Java SDK все, что вам нужно читать сообщения из очереди Letter мертвых:
service.receiveQueueMessage(queueName + "/$DeadLetterQueue", opts);
Вот очень простой, но конкретный пример (Dest ructive чтения):
public static void main(String[] args) throws ServiceException {
String namespace = "namespace";
String sharedKeyName = "keyName";
String sharedSecretKey = "secretKey";
String queueName = "queueName";
// Azure Service Bus Service
Configuration config = ServiceBusConfiguration.configureWithSASAuthentication(namespace, sharedKeyName, sharedSecretKey, ".servicebus.windows.net");
ServiceBusContract service = ServiceBusService.create(config);
// Receive and Delete Messages from DLQ
ReceiveMessageOptions opts = ReceiveMessageOptions.DEFAULT;
opts.setReceiveMode(ReceiveMode.RECEIVE_AND_DELETE);
while (true) {
// To get messages from the DLQ we just need the "$DeadLetterQueue" URI
ReceiveQueueMessageResult resultQM = service.receiveQueueMessage(queueName + "/$DeadLetterQueue", opts);
BrokeredMessage message = resultQM.getValue();
if (message != null && message.getMessageId() != null) {
System.out.println("MessageID: " + message.getMessageId());
} else {
System.out.println("No more messages.");
break;
}
}
}
Конечно это нигде не документированы в API спецификации REST, типичный Microsoft ...