Hi All,
I am implementing blocked connection notification of RabbitMQ in my java code, i have implemented both handleBlock and handleUnblocked methods, i have pushed some load to my rabbit 3.3.5 server, in UI under Connections tab status is getting changed to blocking,blocked,running but control is not passing to the handleBlock method.Below is the piece of code and configuration for memory management.
{code}
Connection connection = null;
try {
connection = factory.newConnection();
System.out.println(connection.getClientProperties());
} catch (IOException e) {
logger.info("Exception occurred while creating Rabbit connection");
}
connection.addBlockedListener(new BlockedListener() {
@Override
public void handleUnblocked() throws IOException {
System.out.println("unblocked");
logger.info("Rabbit Connection Unblocked");
}
@Override
public void handleBlocked(String arg0) throws IOException {
logger.info("Rabbit Server Error, Connection Blocked");
System.out.println("Blocked");
throw new RuntimeException("RabbitMQ Connection Blocked");
}
});{code}
Below is the memory configuration for testing purpose.
{code}
{vm_memory_high_watermark, 0.02},
{vm_memory_high_watermark_paging_ratio, 0.02},
{disk_free_limit, 20000000}
{code}
Can someone help me to bring control to the overridden methods of BlockedListener Interface.
Regards,
Aplesh Rana