We are planning to use Solace Queue Management. One of the usecase is, After receiving message on consumer, if any exception while processing message, Message should be redeliver automatically.
As of now, I am not sending ack to Queue so message will not removed from Queue but unfortunately it's not able to redeliver automatically. If I restart session then only I am able to receive same message.
I have explore few options ex. session.rollback or session.revoke on exception but it will increased the delivery count of all the messages in the queue. Also there isn't any configuration of delay time to redeliver same message.
The expectation is, same message should be redelivered after 30 min (configured delay) automatically.
Below is sample code I am using for Consumer:
@Override
public void onMessage(Message message) {
try {
if (message instanceof TextMessage) {
System.out.printf("TextMessage received: '%s'%n", ((TextMessage) message).getText());
} else {
System.out.println("Message received.");
}
System.out.printf("Message Content:%n%s%n", SolJmsUtility.dumpMessage(message));
// ACK the received message manually because of the set SupportedProperty.SOL_CLIENT_ACKNOWLEDGE above
message.acknowledge();
latch.countDown(); // unblock the main thread
} catch (JMSException ex) {
System.out.println("Error processing incoming message.");
ex.printStackTrace();
}
}
Appreciate your support. Thanks