We are using the Apache.NMS API with the OpenWire client implementation to consume messages from ActiveMQ Classic. We are getting intermittent issues in production in which messages are sitting in the queue, and we are unable to receive them despite polling every 5 seconds. When we checked the logs we are getting null messages even though messages are there. This issue we have observed whenever large files (> 70-80 MB) are the first ones in the queue. We have increased the wait time from 1 second to 5 seconds to allow longer wait to capture large messages.
We are using Azure Function which triggers every 5 seconds with the Apache.NMS C# client to fetch the messages in sequential manner.
I wanted to understand what is the appropriate time setting to be kept fetching large messages?
connection.Start();
session = connection.CreateSession(AcknowledgementMode.IndividualAcknowledge);
IDestination destination = session.GetQueue(Constants.ENDURV11QUEUE);
consume = session.CreateConsumer(destination);
log.LogInformation("JMS queue connection successful");
ITextMessage message = consume.Receive(TimeSpan.FromSeconds(5)) as ITextMessage;
if (message != null)
{
content = message.Text;
}