-1

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;
}
4
  • Team is using Apache Active MQ Classic, regarding multiple questions…main idea is to understand why messages are not getting picked up intermittently, which is the current problem. And we are using OpenWire Protocol Commented Apr 27 at 1:31
  • What version of ActiveMQ Classic are you using? Commented Apr 27 at 3:07
  • How come you're using NMS instead of some other C# client implementation using, for example, STOMP or AMQP? Commented Apr 27 at 3:17
  • Sure Justin, let me update the question to 1, we are part of the middleware team trying to fetch messages from JMS Queues, earlier it was done bu BizTalk using Out of the Box Adapter , and here we are using custom C# code since no connector is available Commented Apr 27 at 4:35

1 Answer 1

1

How long you should wait to fetch large messages depends on a number of factors, e.g.:

  • How large the messages actually are.
  • What the network is like between the client and the broker (e.g. how fast is it?).
  • How many consumers are competing for these same messages.

I recommend you simply try increasing the wait time until you get the behavior you want.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.